[Dovecot] UW-IMAP style mbox snarfing from /var/mail/ to ~/mbox

Timo Sirainen tss at iki.fi
Thu May 17 20:30:18 EEST 2007


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. :)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://dovecot.org/pipermail/dovecot/attachments/20070517/aab7edcf/attachment.pgp 


More information about the dovecot mailing list