Sync IMAP accounts (when migrating from linux to lion server)

Problem
When moving to a new server in the LAN, the imap accounts should be moved, too.

Solution
Use imapsync

Install via mac ports

sudo port install imapsync

Example

// Hints
// Set port from 143 to 993 and use SSL
// Set --authmech2 "CRAM-MD5" for the mac
// Set --sep2 to "." for the mac
// Set --prefix2 to "" for the mac
clear; \
imapsync --dry \
--host1 192.168.1.2  --ssl1 993 --user1 "foo" --password1 "bar" --authmech1 "PLAIN" \
--host2 192.168.1.12 --ssl2 993 --user2 "foo" --password2 "bar" --authmech2 "CRAM-MD5" --sep2 "." --prefix2 ""

Hint
If your passwords contain special chars, use single quotes

--password1 'foo!bar'

Links