Networking

Unix and Linux network configuration. Multiple network interfaces. Bridged NICs. High-availability network configurations.

Applications

Reviews of latest Unix and Linux software. Helpful tips for application support admins. Automating application support.

Data

Disk partitioning, filesystems, directories, and files. Volume management, logical volumes, HA filesystems. Backups and disaster recovery.

Monitoring

Distributed server monitoring. Server performance and capacity planning. Monitoring applications, network status and user activity.

Commands & Shells

Cool Unix shell commands and options. Command-line tools and application. Things every Unix sysadmin needs to know.

Home » Email

Migrating email between hosted providers

Submitted by on May 23, 2008 – 9:38 pm 2 Comments

Recently I ran into a small problem. A customer of mine was moving her site to a new hosting provider. Her old provider was Windows-based and her new provider was Linux-based. The old provider did not use cPanel. The old mail system was SmarterMail Enterprise 4.3 and the new Linux-based mail system was Courier.

The customer had a few mailboxes at the old location that were accessed via a webmail interface, so there were lots of emails stored in the Inbox and Sent folders in all of the accounts. To complicate matters, I only had POP3 access to old email server. Luckily, with the new provider I had SSH access, so this gave me some options.

I knew that with fetchmail I could transfer the contents of the old Inbox to the new one. But what about the Sent folder? Those email had to be moved as well, but with POP3 fetchmail does not support alternate folders. As it turned out, there was a low-tech solution to this annoying problem: creating a temporary folder in both email accounts. Here are the steps:

  1. In your OLD webmail create a folder called “temp”
  2. in your NEW webmail create a folder called “temp”
  3. Login to your NEW server via SSH and type the following fetchmail command:
    fetchmail --keep --all --protocol POP3 --username --smtphost localhost --smtpname  --batchlimit 10 --invisible --norewrite

    Example: your old e-mail account is user@oldprovider.com and your new email is user@newprovider.com. In this case the above fetchmail string will look something like this:

    fetchmail --keep --all --protocol POP3 --username user@oldprovider.com --smtphost localhost --smtpname user@newprovider.com --batchlimit 10 --invisible --norewrite pop3.oldprovider.com

    You will be prompted for your old email password and then fetchmail will start the transfer, which may take some time. This will transfer (without deleting) your old Inbox contents to your Inbox at the new provider.

  4. In your NEW webmail move everything from Inbox to the “temp” folder you created.
  5. In your OLD webmail move everything from Inbox to the “temp” folder.
  6. In your OLD webmail move everything from Sent to Inbox
  7. Repeat step 3. This will put the contents of your OLD Sent folder into your NEW Inbox.
  8. In NEW webmail move contents of Inbox to Sent.
  9. In NEW webmail move contents of “temp” to Inbox.
  10. In OLD webmail move contents of Inbox to Sent
  11. In OLD webmail move contents of “temp” to Inbox

It is a tedious process but it works. If there is no other alternative and the emails have to be moved, then make yourself some coffee and get ready to do some heavy email moving.

Print Friendly, PDF & Email

2 Comments »

  • diggn4richez says:

    Do you have any links. I want to migrate to my email, i have premium account. How do you just login with username and pass and migrate it not knowing the email. (I forgot my email i used for that) Don’t say you can’t cause my friend has done it tons of times.

  • JOHN KAISER PHD says:

    When I paid the 10 bucks for plus the adds said I could eaisly transfere another email account into my new one. How?

Leave a Reply to diggn4richez Cancel reply

%d bloggers like this: