Sign inSign up

jauderho/imapsync

By jauderho

•Updated 2 days ago

Email IMAP tool for syncing, copying, migrating and archiving email mailboxes between servers

Image
3

10K+

jauderho/imapsync repository overview

Usage: docker run --rm -it jauderho/imapsync:latest

Build Status Version Docker Pulls Image Size

Up to date multi-platform images are rebuilt at least once a week.

This image differs from the official image in the following ways:

  • Ubuntu 22.04 is used as the base image due to the need to use a version of IO::Socket::SSL >= 2.073
  • Remove testing and modules needed for testing
  • Only add needed packages (--no-install-recommends)
  • Use ENTRYPOINT instead of CMD
  • Half the size!

The examples below show how to migrate from Gmail to Apple Mail.

#
# Create a .env in the same directory with the following information before running docker compose
#
# IMAPSYNC_USER1=
# IMAPSYNC_PASSWORD1=
# IMAPSYNC_USER2=
# IMAPSYNC_PASSWORD2=
#

services:
  imapsync:
    #build: .
    container_name: imapsync
    image: jauderho/imapsync:latest
    command: ["--errorsmax", "200", 
              "--gmail1", 
              "--user1", "${IMAPSYNC_USER1}", 
              "--password1", "${IMAPSYNC_PASSWORD1}",
              "--compress1", 
              "--ssl1", 
              "--sslargs1", "SSL_verify_mode=1", 
              "--host2", "imap.mail.me.com", 
              "--user2", "${IMAPSYNC_USER2}", 
              "--password2", "${IMAPSYNC_PASSWORD2}", 
              "--compress2", 
              "--ssl2", 
              "--sslargs2", "SSL_verify_mode=1", 
              "--maxbytespersecond", "200_000", 
              "--maxbytesafter", "3_000_000_000", 
              "--addheader", "--useheader", 'Message-Id', 
              "--no-modulesversion", 
              "--nochecknoabletosearch", 
              "--nofoldersizes", 
              "--nofoldersizesatend", 
              "--skipcrossduplicates", 
              "--syncinternaldates", 
              "--folderlast", '[Gmail]/All Mail',  
              "--f1f2", '[Gmail]/All Mail=Archive']

Store environment variables in .env:

IMAPSYNC_USER1=
IMAPSYNC_PASSWORD1=
IMAPSYNC_USER2=
IMAPSYNC_PASSWORD2=

⁠Docker

⁠First run

This can be rerun repeatedly until all messages are fully copied over to the destination.

docker run --rm -it jauderho/imapsync:latest \
	--errorsmax 200 \
	--gmail1 \
	--user1 <[email protected]> \
	--compress1 \
	--ssl1 --sslargs1 SSL_verify_mode=1 \
	--host2 imap.mail.me.com \
	--user2 <[email protected]> \
	--compress2 \
	--ssl2 --sslargs2 SSL_verify_mode=1 \
	--maxbytespersecond 200_000 \
	--maxbytesafter 3_000_000_000 \
	--addheader --useheader 'Message-Id' \
	--no-modulesversion \
	--nochecknoabletosearch \
	--nofoldersizes \
	--nofoldersizesatend \
	--skipcrossduplicates \
	--syncinternaldates \
	--folderlast '[Gmail]/All Mail' \
	--f1f2 '[Gmail]/All Mail=Archive'
⁠Final run

WARNING: This will delete all emails from the source system as part of the final run.

docker run --rm -it jauderho/imapsync:latest \
	--errorsmax 200 \
	--gmail1 \
	--user1 <[email protected]> \
	--compress1 \
	--ssl1 --sslargs1 SSL_verify_mode=1 \
	--host2 imap.mail.me.com \
	--user2 <[email protected]> \
	--compress2 \
	--ssl2 --sslargs2 SSL_verify_mode=1 \
	--maxbytespersecond 200_000 \
	--maxbytesafter 3_000_000_000 \
	--addheader --useheader 'Message-Id' \
	--no-modulesversion \
	--nochecknoabletosearch \
	--nofoldersizes \
	--nofoldersizesatend \
	--skipcrossduplicates \
	--syncinternaldates \
	--folderlast '[Gmail]/All Mail' \
	--f1f2 '[Gmail]/All Mail=Archive'

Tag summary

Content type

Image

Digest

sha256:6afdd7208…

Size

70 MB

Last updated

2 days ago

docker pull jauderho/imapsync