Tony Kay
2006-Feb-02 19:33 UTC
[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: 1. Let dovecot autodetect mail storage 2. 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) 3. 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
Thomas Wouters
2006-Feb-03 12:51 UTC
[Dovecot] mbox to maildir conversion on a user-by-user basis!
On Thu, Feb 02, 2006 at 11:33:11AM -0800, Tony Kay wrote:> 2. 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 at xs4all.net> Hi! I'm a .signature virus! copy me into your .signature file to help me spread! -------------- next part -------------- --- src/foldinfo.c.orig Tue Sep 11 06:57:32 2001 +++ src/foldinfo.c Tue Sep 24 17:18:34 2002 @@ -29,6 +29,7 @@ extra trailing slashes */ static int folderparse P((void)) { char*chp;int type; + struct stat ft_STAT; type=ft_FILE;chp=strchr(buf,'\0'); switch(chp-buf) { case 2: @@ -47,6 +48,7 @@ chp--; ret: *chp='\0'; + if (!stat(buf,&ft_STAT)&&S_ISDIR(ft_STAT.st_mode)){return ft_MAILDIR;} return type; }
Seemingly Similar Threads
- Samba-created files with POSIX ACLs gaining execute bit
- Samba-created files with POSIX ACLs gaining execute bit
- about http basic authentication dashboard
- Troubleshooting poor (small) random read performance -- serverid.tdb?
- Netbios : Network Browsing on multiple subnets