[Dovecot] Migrating mbox to maildir
Sorry to bother everyone but I was wondering if it is possible for Dovecot to handle mbox AND maildir at the same time?
Example:
I want to convert from UW Imap using mbox to Dovecot using maildir.
Do I need to convert ALL my users mbox mailboxes to maildir right away or can I convert them one at a time?
I'd like to use maildir with all my new users, but I'd like to be able to continue using mbox for my old users and slowly convert them as I get time.
Is this possible? I know Dovecot supports both formats, I just couldn't find anything in the install notes about using both at the same time.
Thank you,
mike
On Aug 14, 2008, at 3:46 PM, Mike Hobbs wrote:
Sorry to bother everyone but I was wondering if it is possible for
Dovecot to handle mbox AND maildir at the same time?
Sure.
I'd like to use maildir with all my new users, but I'd like to be
able to continue using mbox for my old users and slowly convert them
as I get time.
Here are some possibilities:
a) Let Dovecot auto-detect the mailbox location by leaving
mail_location setting empty. If ~/Maildir exists it's used, if not
mbox is used (assuming you're using a standard ~/mail location or such).
b) Explicitly specify mail_location for each user in userdb. This
requires that you use a userdb that allows extra fields (so passwd
won't work) and remember to update it after each user is converted.
c) Like a) but do the auto-detection yourself using post-login
scripting: http://wiki.dovecot.org/PostLoginScripting. This won't work
if you're using Dovecot's deliver though.
d) Let Dovecot do the conversion for you. When a user logs in, his/her
mails are converted. http://wiki.dovecot.org/Plugins/Convert
It's even possible for the same user to use both mbox and maildir at
the same time using namespaces.
On Thursday, August 14, 2008 3:46 PM -0400 Mike Hobbs mhobbs@mtl.mit.edu wrote:
I'd like to use maildir with all my new users, but I'd like to be able to continue using mbox for my old users and slowly convert them as I get time.
I did this a week ago for about a dozen users and the system seems more responsive.
Timo covered the Dovecot side. You didn't say what delivery agent you're using. I use procmail and put this .procmailrc in the home directories of the converted users:
# deliver to Maildir MAILDIR=$HOME/Maildir DEFAULT=$MAILDIR/
The file should be owned by the user. (I forgot to chown the file for one user and mail was delivered to the old /var/spool/mail/user mbox file. After I figured it out, I did another conversion with convert-tool to a temporary Maildir-new and moved the converted inbox into a new folder under his previously-converted ~/Maildir.)
If a user is using procmail for filtering, he'll need to change the destination folder lines in his filters. This list could be filtered with a rule like this:
:0 :
- ^Sender:.*dovecot $HOME/Maildir/.Lists.Mail.Dovecot/
Note the trailing slash on delivery lines to indicate that the destination is in Maildir format.
To avoid reconfiguring the folder separator on clients, you can add this namespace directive to dovecot.conf:
namespace private { separator = / inbox = yes }
participants (3)
-
Kenneth Porter
-
Mike Hobbs
-
Timo Sirainen