Springe zum Inhalt

With ImapSync from Gilles Lamiral it is easy to migrate or backup IMAP accounts between to servers; the command-line tool uses the Internet Mail Protocol 4 (IMAP 4). It is perfect to migrate from one mail or hosting provider to another or to use two IMAP based mailboxes as backup solution.

ImapSync supports incremental, duplicate free transfers. It also supports recursion to transfer complete mail folder trees.

Note: The tool transfers data beween two servers, but neither supports local backups (or restoration) nor bidirectional synchronisation, like offlineimap or mbsync. It also does not support groupware features, i.e. backing up calendars, contacts, or tasks.

Install dependencies:

sudo apt update && apt upgrade && apt install  \
libauthen-ntlm-perl     \
libclass-load-perl      \
libcrypt-openssl-rsa-perl \
libcrypt-ssleay-perl    \
libdata-uniqid-perl     \
libdigest-hmac-perl     \
libdist-checkconflicts-perl \
libencode-imaputf7-perl     \
libfile-copy-recursive-perl \
libfile-tail-perl       \
libio-compress-perl     \
libio-socket-inet6-perl \
libio-socket-ssl-perl   \
libio-tee-perl          \
libjson-webtoken-perl   \
libmail-imapclient-perl \
libmodule-scandeps-perl \
libnet-dbus-perl        \
libnet-ssleay-perl      \
libpar-packer-perl      \
libproc-processtable-perl \
libreadonly-perl        \
libregexp-common-perl   \
libsys-meminfo-perl     \
libterm-readkey-perl    \
libtest-fatal-perl      \
libtest-mock-guard-perl \
libtest-mockobject-perl \
libtest-pod-perl        \
libtest-requires-perl   \
libtest-simple-perl     \
libunicode-string-perl  \
liburi-perl             \
libtest-nowarnings-perl \
libtest-deep-perl       \
libtest-warn-perl       \
make                    \
time                    \
cpanminus

Get and install umapsync

Downloads the latest build on Github to the current directory, adds execution permission, and moves it to /usr/bin:

wget -N https://raw.githubusercontent.com/imapsync/imapsync/master/imapsync
chmod +x imapsync
mv imapsync /usr/bin/

Run imapsync

imapsync

To check for the latest release and library dependencies, add the --releasecheck parameter:

imapsync --releasecheck

Example: Incremental backup between two distinct IMAP servers:

USR1='user1@giesecke.org'
PWD1='somepassword1'
USR2='user2@giesecke.org'
PWD2='somepassword2'
imapsync --releasecheck --addheader --automap --prefix1 "INBOX." --prefix2 "INBOX/" --no-modulesversion --host1 mail.giesecke.org --user1 $USR1 --password1 $PWD1 --host2 backup.giesecke.org --user2 $USR2 --password2 $PWD2

Note that imapsync could create a log directory in the current working directory (pwd).