Table of Contents

Copy/move/synch IMAP account

Debian packages

in Maildir format, using SSH to transfer data. It provides the smd-pull utility to pull changes made on the remote mailbox, smd-push to propagate local changes to the remote mailbox, and smd-loop to iterate push and pull in a timely way. Unlike OfflineIMAP, it does not require an IMAP server to be installed on the remote host

3rd party

imapsync

copy_emails.sh
#!/bin/bash -eux
USER="username.surname"
LOGIN="${USER}@example.com"
PASS="userpass"
IMAP="imap.example.com"
 
SUBFOLDER=${USER/./_}
 
SUBFOLDER="archive-${SUBFOLDER}"
 
ARGS="--host1 ${IMAP} --user1 ${LOGIN} --password1 ${PASS}"
ARGS="${ARGS}  --host2 imap.destination.example.com --user2 archive@destination.example.com --password2 dest_pass --subfolder2 ${SUBFOLDER}"
 
#ARGS="${ARGS} --dry"
 
 
eval docker run gilleslamiral/imapsync /usr/bin/imapsync ${ARGS}

http://cmsj.net/2019/05/20/imapsync-docker.html