The imapsync application to copy IMAP mail between IMAP mail servers
UNDER CONSTRUCTION
Information about imapsync
The application is available for unix systems and Windows. View the man page for detailed information.
Ubuntu systems can install imapsync via the package manager.
imapsync can be installed on any machine (not necessarily the imap servers).
imapsync can copy mail folders containing sub-folders and files
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]
Installing imapsync
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.
Basic imapsync command
/usr/bin$ imapsync --host1 server1.example.com --user1 sales@example.com --passfile1 /etc/secret1 --host2 server2.example.com --user2 sales@example.com --passfile2 /etc/secret2
Where 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 PlainPW
In 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 ~/secret2
Where 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/secret2
The 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