imapsync on 16.04 Xenial (on a fresh/basic install) do:
sudo apt-get install libio-tee-perl
sudo apt-get install libmail-imapclient-perl
sudo apt-get install libterm-readkey-perl
sudo apt-get install libunicode-string-perl
## The rest is optional I believe:
sudo apt-get install libcrypt-openssl-rsa-perl
sudo apt-get install libauthen-ntlm-perl
sudo apt-get install libdata-uniqid-perl
sudo apt-get install libjson-perl
sudo apt-get install liblwp-online-perl
## For Xenial/16.04 I could not locate these packages nor would 'cpan'
## work for me - but you could try (as user running imapsync):
cpan install JSON::WebToken
cpan install Filesys::DfPortable
Then test:
./imapsync --dry --host1 localhost --user1 1@localhost --password1 1 --host2 localhost --user2 2@localhost --password2 2
You should see a module list within the error output:
Modules version list:
Mail::IMAPClient 3.38
IO::Socket 1.38
IO::Socket::IP 0.37
IO::Socket::INET 1.35
IO::Socket::SSL 2.024
Net::SSLeay 1.72
Compress::Zlib 2.068
Digest::MD5 2.54
Digest::HMAC_MD5 1.01
Digest::HMAC_SHA1 1.03
Term::ReadKey 2.33
File::Spec 3.56
Time::HiRes 1.9726
Unicode::String 2.09
IO::Tee 0.64
File::Copy::Recursive 0.38
Authen::NTLM 1.09
URI::Escape 3.31
Data::Uniqid 0.12
JSON 2.90
JSON::WebToken ?
Crypt::OpenSSL::RSA 0.28
LWP 6.15
HTML::Entities 3.69
Filesys::DfPortable ?
I can confirm the imap sync worked using the above package installs on 14.04/16.04 Dovecot systems using TLS. As I mentioned, you may only need the first ones listed to get it working at a basic level. The perl modules needed should be basically the same under 14.04 fresh install.