![]() Mbox to Maildir migrationWhen upgrading a mail server, you may be faced with a rather 'interesting' problem: migrating old user account in the classic monolithic mbox format to the more tolerant and performant maildir. Mbox is way to store emails in a single file. It's old, compatible with most mail applications, but as your mail store grows, it becomes harder to manage emails contained within and things start to become shaky if you're mailbox is big, with the risk of corruption or connection time-out becoming likely. Maildir on the other hand is newer and not supported by all systems. Basically it's just a way top store emails as files within a folder hierarchy. Its advantages are mostly to have good performance and be more tolerant in case of failure since you're more likely to lose just one email instead of your whole mailbox. Postfix (MTA) and Dovecot (POP3 and IMAP server) both support the maildir format and can integrate with each other seamlessly. MigrationIt's nevertheless a great pain when you have to migrate existing mailboxes to the new format, on a new server for instance. There is apparently only one tool that allows this type of thing: it's a small Perl script maintained by Philip Mak that is available as Perfect_maildir. Just download the single file script and you are ready to convert, unless you're getting a long error message and in that case you may need to download the To install it, just enter: # perl -MCPAN -e 'install Date::Parse' If this is the first time you install a module, you will be asked a series of question. Just keep pressing Enter until you're asked about your geographic area. Make your selection of mirrors to download from and Perl will do the rest. Next time, you won't be asked anything. If you have a handfull of accounts to migrate, doing it by hand may be tedious, but it can still be faster than going through setting up an automated process. I found useful to use my mail client to create IMAP accounts for every user I needed to migrate, then use their original mailbox layout to re-create the directories they had. You can get the old mailbox layout by viewing the # perfect_maildir.pl /mail/michael/email < /oldmail/var/mail/michael # perfect_maildir.pl /mail/michael/email/.Drafts < \ /oldmail/home/michael/Drafts # chown michael.michael -R /mail/michael/email Would first move the inbox and then the old Draft mboxes to the new maildirs and ensure that the files belong to the user; this is particularly important if you're doing the migration as If you need to migrate a lot of accounts, then you should use the migration tools below. They make use of Resources
Leave your comments below |