Importing Email from Another Provider
Opalstack supports two methods to import mail from other providers for use with your Opalstack mail users: direct import and IMAP-to-IMAP transfers.
If you're migrating to Opalstack from WebFaction.com then please use our automatic migration utility to import your mailboxes and addresses. More information is available at: HOWTO migrate your email addresses and mailboxes from WebFaction
If your other mail provider stores your mail on their servers in Maildir format, then that mail can be copied directly into a mail user account on Opalstack.
- 1
Ask your mail provider to provide a zipped archive of your Maildir directory.
- 2
Upload the zipped archive into one of your shell user home directories. You may use SFTP for this purpose.
- 3
Create a mail user if you haven't done so already.
- 4
Contact Opalstack Support to ask them to drop your mail into your mail user's home directory. Please include the mail user name and the location of your mail archive in your request.
If your other mail provider offers IMAP mail service, then you can copy your mail over to your Opalstack mail users over IMAP. There are a couple of different approaches to this - with a specialized tool for transferring mail between servers or by moving messages with with your desktop mail client software.
- 1
Create a mail user if you have not done so already.
- 2
Create a shell user if you have not done so already. You can use an existing shell user if you wish.
- 3
Log in to a SSH session on your Opalstack server as your shell user.
- 4
Create a file named
oldpasswd.txt
containing your old mailbox password.- 5
Create a file
newpasswd.txt
with your Opalstack mail user password.- 6
Test with the following command, replacing the the following:
-
OLD_MAILUSERNAME
: your old mail username - NEW_MAILUSERNAME`: your Opalstack mail username
-
OLD_MAILSERVER
: your old incoming mail server -
NEW_MAILSERVER
: your Opalstack incoming mail server, eithermail.us.opalstack.com
ormail.de.opalstack.com
.
imapsync --dry --host1 OLD_MAILSERVER --ssl1 --user1 OLD_MAILUSERNAME --passfile1 ./oldpasswd.txt --host2 NEW_MAILSERVER --ssl2 --user2 NEW_MAILUSERNAME --passfile2 ./newpasswd.txt
-
- 7
Assuming that works, repeat the command without the dry option.
imapsync --host1 OLD_MAILSERVER --ssl1 --user1 OLD_MAILUSERNAME --passfile1 ./oldpasswd.txt --host2 NEW_MAILSERVER --ssl2 --user2 NEW_MAILUSERNAME --passfile2 ./newpasswd.txt
⚠️ mbsync
can use a lot of memory on large mailboxes. If you're moving more than 1GB of mail then please use imapsync
as described above.
- 1
Create a mail user if you have not done so already.
- 2
Create a shell user if you have not done so already. You can use an existing shell user if you wish.
- 3
Log in to a SSH session on your Opalstack server as your shell user.
- 4
Create a file in your shell user's home directory named
~/.mbsyncrc
with the following contents, making the changes as directed:IMAPAccount oldhost SSLType IMAPS # change the following two lines to your old mail server and user Host mail.oldhost.com User your_old_mail_username IMAPStore oldhost Account oldhost IMAPAccount opalstack SSLType IMAPS # change the following two lines to your Opalstack mail server and user Host mail.us.opalstack.com User your_mail_user_name IMAPStore opalstack Account opalstack Channel main Master :oldhost: Slave :opalstack: Patterns * Create Slave Sync Pull CopyArrivalDate yes
- 5
Save the configuration file from step 4 and you are ready to migrate your mail by running the following command:
mbsync --pull --all
mbsync
will then report its progress as it copies your mail over.
If you need to move only a small amount of mail from your old provider, then Opalstack recommends this approach:
- 1
Create a mail user if you haven't done so already.
- 2
Configure your mail client with your Opalstack mail user credentials.
- 3
Configure your mail client with your other mail provider's credentials if you have not done so already.
- 4
Make a note of the folders and subfolders that exist on your old mail account and create them for your Opalstack mail account if they do not exist already.
- 5
For each folder and subfolder in your old mail account:
- Click the folder in your mail client.
- Select all of the messages in the folder.
- Drag the messages into the corresponding folder for your Opalstack mail user.
Your mail client may have other menu options for moving and copying mail between folders and accounts. Check your mail client documentation for more information.