Skip to content

Instantly share code, notes, and snippets.

@BananaAcid
Last active July 18, 2024 10:00
Show Gist options
  • Select an option

  • Save BananaAcid/174a9a45ecf284118b2016f41f55840f to your computer and use it in GitHub Desktop.

Select an option

Save BananaAcid/174a9a45ecf284118b2016f41f55840f to your computer and use it in GitHub Desktop.
ImapSync from source Mar 2024

ImapSync

Special case:

Linux (Ubuntu)

see ./imapsync.sh

MacOS

brew install imapsync

Windows

use WSL2 and see ./imapsync.sh

then use:

bash -c "/home/administrator/imapsync/imapsync --host1 imap.server.tld --user1 email@domain.tld --password1 PW1 --host2 imap.server2.tld --user2 email@domain.tld --password2 PW2 --automap --delete2 --delete2folders --showpasswords --nossl2 --dry"

Params

 // source
 --host1 imap.server.tld
 --user1 email@domain.tld
 --password1 PW1
 
 // target
 --host2 imap.server2.tld
 --user2 email@domain.tld
 --password2 PW2
 --nossl2          // ignore ssl errors on target
 
 --automap         // map IMAP folders in different languages and alternatives 
 --delete2         // delete emails from target if they have been removed from source
 --delete2folders  // same for folders
 --showpasswords   // log passwords (check for commandline errors)
 
 --dry             // dry-run - do not change mails and folders, but check if everything would work
# install: curl https://gist.githubusercontent.com/BananaAcid/174a9a45ecf284118b2016f41f55840f/raw/imapsync.sh | sh
# ImapSync from source Mar 2024 commit: b0619eb
# based on: https://kb.vander.host/email/how-to-install-and-use-imapsync-on-ubuntu/
sudo apt update && sudo apt upgrade --yes
sudo apt --yes install apt-file && sudo apt-file update
sudo apt-get --yes install \
git \
rcs \
make \
makepasswd \
cpanminus \
gcc \
libssl-dev \
libauthen-ntlm-perl \
libclass-load-perl \
libcrypt-ssleay-perl \
liburi-perl \
libdata-uniqid-perl \
libdigest-hmac-perl \
libdist-checkconflicts-perl \
libfile-copy-recursive-perl \
libio-compress-perl \
libio-socket-inet6-perl \
libio-socket-ssl-perl \
libio-tee-perl \
libmail-imapclient-perl \
libmodule-scandeps-perl \
libnet-ssleay-perl \
libpar-packer-perl \
libreadonly-perl \
libsys-meminfo-perl \
libterm-readkey-perl \
libtest-fatal-perl \
libtest-mock-guard-perl \
libtest-pod-perl \
libtest-requires-perl \
libtest-simple-perl \
libunicode-string-perl \
libtest-warn-perl \
libtest-deep-perl \
libtest-nowarnings-perl \
libtest-mockobject-perl \
libregexp-common-perl \
libnet-dbus-perl \
libfile-tail-perl \
libencode-imaputf7-perl \
libcgi-pm-perl \
libproc-processtable-perl
sudo cpanm Crypt::OpenSSL::RSA Crypt::OpenSSL::Random --force
sudo cpanm Mail::IMAPClient JSON::WebToken Test::MockObject
sudo cpanm Unicode::String Data::Uniqid
git clone https://github.com/imapsync/imapsync.git
cd imapsync
mkdir -p dist
sudo make install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment