I'm trying to migrate a client's hosting from a really bad host to a new one.
The current host provides no control panel (they're a bit control freaks, you have to lodge a ticket to do anything) so I can't back up the mail from the control panel.
I need a way to grab the mail from the mailboxes and transfer it onto the new host.
As far as I know, they only provide pop3 on their server either so I can't use imapsync.
The new host is a vps with cpanel, I can install whatever could help on it.
Is there any way that I can automate the transfer from the old host to the new one?
Am I doomed?
If you use a Unix/Linux solution (like Postfix/Dovecot), you could just use fetchmail or something like that to get the mails from the old server and inject it into the local mail system on the new one.
All you would need is a list of usernames/passwords for the POP accounts on the old server.
SvenW's answer was spot on helpful, thanks!
For those interested here are the details of the command to run.
Notes:
i'm running this as root on the new server
A fetchmailrc file is not necessary, can be all done with one command (since it's once off it's good)
Password are not passed on the command line, so the first step is to create a .netrc in the home folder with the following syntax:
machine server.com
login [email protected]
password thepassword
If you need multiple, just keep adding them in the netrc file.
Run this command
fetchmail -v -a -k -p APOP -S localhost --smtpname [email protected] -u [email protected] server.com
-v makes it more verbose, helpful
-a grabs everything (including read email)
-k keep mail on the old server (up to you, may be good for testing)
-p the protocol to use. APOP worked for me, but check the fetchmail documentation
-S (that's uppercase S) the destination server (localhost since i'm already on the machine)
--smtpname the local recipient (should be the same mailbox as the source server)
-u the username to connect to the remote server (some servers use [email protected], some just email, or sometimes something else)
and finally the last server.com is the address of the remote (old) server
for testing you can also add a -c parameter, that checks but doesn't retrieve. Good way to check if the setup is correct
pop2imap is designed to transfer messages from a pop3 server to an imap server incrementally. Same usage as imapsync.
http://www.linux-france.org/prj/pop2imap/