Skip to content

Instantly share code, notes, and snippets.

@DanielVF
Last active August 29, 2015 14:01
Show Gist options
  • Select an option

  • Save DanielVF/61229d54311a42fe2a93 to your computer and use it in GitHub Desktop.

Select an option

Save DanielVF/61229d54311a42fe2a93 to your computer and use it in GitHub Desktop.
Using imapsync to copy accounts
# Install and use imapsync to copy imap accounts between servers
# Known issues:
# - Same username on both servers
# - Same password on both servers
# - No special characters in passwords
# - You'll want to run in parallel on big moves.
aptitude install libmail-imapclient-perl libterm-readkey-perl libio-socket-ssl-perl libdigest-hmac-perl liburi-perl libfile-copy-recursive-perl
git clone https://github.com/imapsync/imapsync.git
cd imapsync
function transfer {
USER=$1
PASS=$2
SRC=#PUT SRC IP HERE
DEST=#PUT DEST IP HERE
echo transfering $USER
./imapsync --host1 $SRC --user1 $USER --password1 $PASS --host2 $DEST --user2 $USER --password2 $PASS
}
# usage
# transfer [email protected] paskfwpekfpwkf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment