Todd Piket wrote:
This is bascially what UW-IMAP does. It is quite handy in our situation. The problem with doing this with Dovecot and/or Maildir is, I believe, you must introduce some kind of locking mechanism in /var/mail/%u because the delivery agent and Dovecot may step on each other's toes otherwise. Since locking is "bad" in maildir this is not ideal.
Two points.
There's nothing to say /var/mail/%u can't be mbox. Dovecot already supports the INBOX being a different format to the rest of the mail. Handy if you don't run a Maildir capable LDA (but who does that? :)
Maildir was designed to not need locking. If dovecot tries to move a mail out of /new, it knows implicitly that the LDA is finished with it. This is because the LDA doesn't rename() new mail into /new from /tmp until it's finished writing it.
For some reason I recall there being an "on login" script hook possible with dovecot - if nothing else, just wrap the imap binary. This script could iterate over the /var/mail/%u/new/ directory, moving each file to ~/Maildir/tmp, then /new, and bailing out when it hits quota full.
Or am I missing some complexity here?
-- Curtis Maloney cmaloney@cardgate.net