Migrating email

Migrating from unix /var/mail/spool mail to maildir:

Moving from a old Verio VPS server to Softlayer’s cloud required migrating from the old “unix” email format where all mail for a user was kept in a single file.
Softlayer/WHM offered two email formats, courier or dovecot. I had luck with dovecot and did not pursue courier.

as root:
copy old mail file to /var/spool/mail/user_name

make sure permissions are user_name / mail

as user_name, from /home/user_name/mail/domain.com
mb2md.pl -m -d /home/user_name/mail/domain-com/mail_user

mail is now in dovecot format and readable via POP/IMAP or webmail (:2092/:2093 or webmail.domain.com)

repeat for all needed accounts

consider running “/etc/init.d/postfix stop’ on the old server

on softlayer/centos6/LAMP, yum install perl-TimeDate was required for mb2md.pl to ‘compile’.

helpful sites:
http://batleth.sapienti-sat.org/projects/mb2md/
http://danielpocock.com/linux-doc/mbox-maildir.html
http://dovecot.org/tools/mb2md.pl
http://wiki2.dovecot.org/Migration/MailFormat

1 comment to Migrating email

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>