17 May
2007
17 May
'07
8:30 p.m.
http://dovecot.org/patches/mbox-snarf-plugin.c
Also committed to CVS HEAD.
Usage:
mail_location = mbox:~/mail:INBOX=/var/mail/%u
protocol imap { mail_plugins = mbox_snarf } protocol pop3 { mail_plugins = mbox_snarf }
plugin { mbox_snarf = ~/mbox }
If ~/mbox doesn't exist, nothing special is done.
If ~/mbox exists, it's treated as INBOX and mails are moved from /var/mail/%u whenever the mailbox is synchronized. If all the messages couldn't be copied, for example because of out of quota, then none of the messages are copied. I suppose that could be a problem. It might be possible to fix that by changing:
if (mailbox_copy(dest_trans, mail, 0, NULL, NULL) < 0) {
if (!mail->expunged) {
ret = -1;
break;
}
}
to just:
if (mailbox_copy(dest_trans, mail, 0, NULL, NULL) < 0) {
if (!mail->expunged)
break;
}
But I'm not sure about that. Try and tell me. :)