Imapsync moves mail for an account from one IMAP mail server to another IMAP mail server.
It will only move files with mail headers. If mail was stored in a non-mail folder it will be moved as well.
The man page for imapsync shows it successful for the following servers (among others): - Dovecot 0.99.10.4, 0.99.14, 0.99.14-8.fc4, 1.0-0.beta2.7, 1.0.0 [dest/source] (LGPL) (http://www.dovecot.org/) and Exchange2007-EP-SP2, Exchange 2010 RTM (Release to Manufacturing) [host2], Exchange 2010 SP1 RU2[host2]
Ubuntu installs imapsync from Synaptic Package Manager.
$ which imapsync /usr/bin/imapsync
/usr/bin$ ls -la imapsync -rwxr-xr-x 1 root root 119254 2010-07-08 08:14 imapsync
It is in the imapsync
package.
$ dpkg-query --search /usr/bin/imapsync imapsync: /usr/bin/imapsync
Windows requires the imapsync.exe file.
/usr/bin$ imapsync --host1 server1.example.com --user1 sales@example.com --passfile1 /etc/secret1 --host2 server2.example.com --user2 sales@example.com --passfile2 /etc/secret2Where the secret1 file holds the imap user password for the account on server1.
/usr/bin$ imapsync --noauthmd5 --ssl1 --host1 maildir.cs.uwaterloo.ca --user1 theuerid --password1 'MyPw!4u' --ssl2 --host2 connect.uwaterloo.ca --delete2 --folderrec ZDnet --user2 theuserid --password2 PlainPWIn the above example the password "MyPw!4u" contains a ! and must be surrounded by single quotes. The "PlainPW" password has no special characters, so does not require quotes. This command shows the passwords as entered and hence not secure if others are present.
/usr/bin$ imapsync --noauthmd5 --ssl1 --host1 maildir.cs.uwaterloo.ca --folder INBOX --user1 gchopiak --passfile1 /home/gboerke/secret1 --host2 connect.uwaterloo.ca --folder INBOX --user2 nexus\\gchopiak --passfile2 ~/secret2Where only one folder i.e. INBOX is transferred.
/usr/bin$ imapsync --noauthmd5 --ssl1 --host1 mail.cs.uwaterloo.ca --user1 jwwong --passfile1 ~/Desktop/secret1 --sep1 / --prefix1 "" --syncinternaldates --ssl2 --host2 connect.uwaterloo.ca --user2 nexus\\jwwong --passfile2 ~/Desktop/secret2The above command uses separators. This may be required if the "imapsync" fails and reports this:
... ignored many folders Warning: ignoring folder WindowsDocs/upstair/citr/01-02 ec because it is not selectable Warning: ignoring folder correspondence/memo because it is not selectable No NAMESPACE capability in imap server mail.cs.uwaterloo.ca Give the separator character with the --sep1 option
-- Main.gboerke - 22 Mar 2012