[Dovecot] mbox to maildir conversion on a user-by-user basis!
In the midst of evaluating Dovecot for use in solving some mbox locking issues (while also waiting for our eventual migration to maildir), I had an epiphany.
It looks like Dovecot's auto-detection of mail formats would allow us to migrate from mbox to maildir on a user-by-user basis!
I was thinking:
- Let dovecot autodetect mail storage
- Use some procmail trickery to detect which format to deliver into (I am researching how to do the detection on a user-by-user basis)
- Manually convert users as you want by:
- Temporarily disable mail delivery for that user (at least make it look like the inbox is locked)
- Run conversion on mbox files -> maildir format
- Put in the procmail hack for them
- Re-enable delivery
Way cool.
I am still working out the details, but I was wondering if anyone sees a problem with this???
-- Anthony Kay University Computing Center (541) 346-1719 GPG Fingerprint: B0DB D46A 60AF FAE7 A94A 5075 0CB4 4D88 9F4F 7F09
Sanity is a cozy lie.
Susan Sontag
On Thu, Feb 02, 2006 at 11:33:11AM -0800, Tony Kay wrote:
- Use some procmail trickery to detect which format to deliver into (I am researching how to do the detection on a user-by-user basis)
procmail is smarter than dovecot in that (sorry, timo.) When delivering to a mailbox 'mboxname', it will actually look at what 'mboxname' is. If it's a file, it assumes mbox. If it's a directory, and 'mboxname' doesn't end in /, it assumes MH. If 'mboxname' does end in /, it assumes maildir.
Of course, this doesn't completely fix your problem, since the default for a directory is MH. That's relatively (considering procmail's *%*!@$* source) easily fixed; we've used the attached patch for the last 8 or so years ;P
It would be nice if dovecot had similar intelligence: autodetect per mailbox name, rather than per namespace. I have a half-finished 'mixed' namespace, which ''subclasses'' from both mbox and maildir namespaces and chooses per-mailbox on which functions to call. I hvaen't had the time to finish it, though, and it depends fairly greatly on dovecot's mbox/maildir internals (which is a bit problematic, considering dovecot's fluidity at the moment :)
-- Thomas Wouters thomas@xs4all.net
Hi! I'm a .signature virus! copy me into your .signature file to help me spread!
participants (2)
-
Thomas Wouters
-
Tony Kay