Migrating users and mailboxes from postfix / Maildir to Postfix with Mysql backend

imappostfixshell

So I've got 60 or so users on a hand rolled postfix installation on openbsd and I'd like to move their mailboxes to our new mail server running iRedMail (postfix, vmail/mysql back end)

Does anyone know of a good way to do this? Preferably a script I can run to keep syncing the users mailboxes as MX records get updated?

I presume one way (though I don't have all their passwords!) would be to have a command line imap client that simulated the users copying their mail themselves but I'm sure there must be a shell / php script to migrate users?

Anyone got any bright ideas?

Best Answer

I don't know anything about iRedMail, but have done many mail migrations before on heavily used mail servers. I wouldn't recommend doing this during normal production hours. You should schedule downtime of at least an hour or two depending on how long it takes to migrate the data and turn off the mail servers while this is happening so that users aren't updating their mailboxes or getting different sets of messages.

If DNS cache time is an issue, then lower the TTL on any zone you're changing to about 10 minutes, then wait at least the previous TTL's time before doing the migration. That way when you make the switch over, you can be sure that all clients will only be about 10 minutes behind the DNS change. Then change the TTL back after you're sure everything went smoothly.