<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.daxtech.net:443/index.php?action=history&amp;feed=atom&amp;title=Install_imapsync_on_debian</id>
	<title>Install imapsync on debian - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.daxtech.net:443/index.php?action=history&amp;feed=atom&amp;title=Install_imapsync_on_debian"/>
	<link rel="alternate" type="text/html" href="https://wiki.daxtech.net:443/index.php?title=Install_imapsync_on_debian&amp;action=history"/>
	<updated>2026-04-19T07:59:02Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://wiki.daxtech.net:443/index.php?title=Install_imapsync_on_debian&amp;diff=37&amp;oldid=prev</id>
		<title>Dax: Created page with &quot;====Setup==== &lt;syntaxhighlight lang=&quot;bash&quot;&gt;  sudo apt-get install  \ libauthen-ntlm-perl     \ libclass-load-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          \ libmail-imapclient-perl \ libmodule-scandeps-perl \ libn...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.daxtech.net:443/index.php?title=Install_imapsync_on_debian&amp;diff=37&amp;oldid=prev"/>
		<updated>2024-01-12T09:54:31Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;====Setup==== &amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;  sudo apt-get install  \ libauthen-ntlm-perl     \ libclass-load-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          \ libmail-imapclient-perl \ libmodule-scandeps-perl \ libn...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;====Setup====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
 sudo apt-get install  \&lt;br /&gt;
libauthen-ntlm-perl     \&lt;br /&gt;
libclass-load-perl      \&lt;br /&gt;
libcrypt-ssleay-perl    \&lt;br /&gt;
libdata-uniqid-perl     \&lt;br /&gt;
libdigest-hmac-perl     \&lt;br /&gt;
libdist-checkconflicts-perl \&lt;br /&gt;
libencode-imaputf7-perl     \&lt;br /&gt;
libfile-copy-recursive-perl \&lt;br /&gt;
libfile-tail-perl       \&lt;br /&gt;
libio-compress-perl     \&lt;br /&gt;
libio-socket-inet6-perl \&lt;br /&gt;
libio-socket-ssl-perl   \&lt;br /&gt;
libio-tee-perl          \&lt;br /&gt;
libmail-imapclient-perl \&lt;br /&gt;
libmodule-scandeps-perl \&lt;br /&gt;
libnet-dbus-perl        \&lt;br /&gt;
libnet-ssleay-perl      \&lt;br /&gt;
libpar-packer-perl      \&lt;br /&gt;
libreadonly-perl        \&lt;br /&gt;
libregexp-common-perl   \&lt;br /&gt;
libsys-meminfo-perl     \&lt;br /&gt;
libterm-readkey-perl    \&lt;br /&gt;
libtest-fatal-perl      \&lt;br /&gt;
libtest-mock-guard-perl \&lt;br /&gt;
libtest-mockobject-perl \&lt;br /&gt;
libtest-pod-perl        \&lt;br /&gt;
libtest-requires-perl   \&lt;br /&gt;
libtest-simple-perl     \&lt;br /&gt;
libunicode-string-perl  \&lt;br /&gt;
liburi-perl             \&lt;br /&gt;
libtest-nowarnings-perl \&lt;br /&gt;
libtest-deep-perl       \&lt;br /&gt;
libtest-warn-perl       \&lt;br /&gt;
make                    \&lt;br /&gt;
time                    \&lt;br /&gt;
cpanminus&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;Download current from https://imapsync.lamiral.info/dist2/&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Usage===&lt;br /&gt;
 imapsync --host1 &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;HostSorgente&amp;lt;/span&amp;gt; --user1 &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;casella@su-server.sorgente&amp;lt;/span&amp;gt; --password1 &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;password&amp;lt;/span&amp;gt; --host2 &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;HostDestinazione&amp;lt;/span&amp;gt; --user2 &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;casella-di@destinazione&amp;lt;/span&amp;gt; --password2 &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;password&amp;lt;/span&amp;gt; --automap --nolog --subscribeall&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== man ==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
root@imapsync:~# imapsync&lt;br /&gt;
Name:&lt;br /&gt;
&lt;br /&gt;
 imapsync - Email IMAP tool for syncing, copying, migrating and archiving&lt;br /&gt;
 email mailboxes between two imap servers, one way, and without duplicates.&lt;br /&gt;
&lt;br /&gt;
Version:&lt;br /&gt;
&lt;br /&gt;
 This documentation refers to Imapsync $Revision: 2.140 $&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
&lt;br /&gt;
  To synchronize the source imap account&lt;br /&gt;
    &amp;quot;test1&amp;quot; on server &amp;quot;test1.lamiral.info&amp;quot; with password &amp;quot;secret1&amp;quot;&lt;br /&gt;
  to the destination imap account&lt;br /&gt;
    &amp;quot;test2&amp;quot; on server &amp;quot;test2.lamiral.info&amp;quot; with password &amp;quot;secret2&amp;quot;&lt;br /&gt;
  do:&lt;br /&gt;
&lt;br /&gt;
   imapsync \&lt;br /&gt;
    --host1 test1.lamiral.info --user1 test1 --password1 secret1 \&lt;br /&gt;
    --host2 test2.lamiral.info --user2 test2 --password2 secret2&lt;br /&gt;
&lt;br /&gt;
Options:&lt;br /&gt;
&lt;br /&gt;
  usage: imapsync [options]&lt;br /&gt;
&lt;br /&gt;
 The standard options are the six values forming the credentials. Three&lt;br /&gt;
 values on each side are needed in order to login into the IMAP servers.&lt;br /&gt;
 These six values are a hostname, a username, and a password, two times.&lt;br /&gt;
&lt;br /&gt;
 Conventions used in the following descriptions of the options:&lt;br /&gt;
&lt;br /&gt;
  str means string&lt;br /&gt;
  int means integer number&lt;br /&gt;
  flo means float number&lt;br /&gt;
  reg means regular expression&lt;br /&gt;
  cmd means command&lt;br /&gt;
&lt;br /&gt;
  --dry               : Makes imapsync doing nothing for real; it just print what&lt;br /&gt;
                        would be done without --dry.&lt;br /&gt;
&lt;br /&gt;
Options/credentials:&lt;br /&gt;
&lt;br /&gt;
  --host1        str  : Source or &amp;quot;from&amp;quot; imap server.&lt;br /&gt;
  --port1        int  : Port to connect on host1.&lt;br /&gt;
                        Optional since default ports are the&lt;br /&gt;
                        well known ports imap/143 or imaps/993.&lt;br /&gt;
  --user1        str  : User to login on host1.&lt;br /&gt;
  --password1    str  : Password of user1.&lt;br /&gt;
&lt;br /&gt;
  --host2        str  : &amp;quot;destination&amp;quot; imap server.&lt;br /&gt;
  --port2        int  : Port to connect on host2. Optional&lt;br /&gt;
  --user2        str  : User to login on host2.&lt;br /&gt;
  --password2    str  : Password of user2.&lt;br /&gt;
&lt;br /&gt;
  --showpasswords     : Shows passwords on output instead of &amp;quot;MASKED&amp;quot;.&lt;br /&gt;
                        Useful to restart a complete run by just reading&lt;br /&gt;
                        the command line used in the log,&lt;br /&gt;
                        or to debug passwords.&lt;br /&gt;
                        It&amp;#039;s not a secure practice at all!&lt;br /&gt;
&lt;br /&gt;
  --passfile1    str  : Password file for the user1. It must contain the&lt;br /&gt;
                        password on the first line. This option avoids showing&lt;br /&gt;
                        the password on the command line like --password1 does.&lt;br /&gt;
  --passfile2    str  : Password file for the user2.&lt;br /&gt;
&lt;br /&gt;
 You can also pass the passwords in the environment variables&lt;br /&gt;
 IMAPSYNC_PASSWORD1 and IMAPSYNC_PASSWORD2. If you don&amp;#039;t pass the user1&lt;br /&gt;
 password via --password1 nor --passfile1 nor $IMAPSYNC_PASSWORD1 then&lt;br /&gt;
 imapsync will prompt to enter the password on the terminal. Same thing for&lt;br /&gt;
 user2 password.&lt;br /&gt;
&lt;br /&gt;
Options/encryption:&lt;br /&gt;
&lt;br /&gt;
  --nossl1            : Do not use a SSL connection on host1.&lt;br /&gt;
  --ssl1              : Use a SSL connection on host1. On by default if possible.&lt;br /&gt;
&lt;br /&gt;
  --nossl2            : Do not use a SSL connection on host2.&lt;br /&gt;
  --ssl2              : Use a SSL connection on host2. On by default if possible.&lt;br /&gt;
&lt;br /&gt;
  --notls1            : Do not use a TLS connection on host1.&lt;br /&gt;
  --tls1              : Use a TLS connection on host1. On by default if possible.&lt;br /&gt;
&lt;br /&gt;
  --notls2            : Do not use a TLS connection on host2.&lt;br /&gt;
  --tls2              : Use a TLS connection on host2. On by default if possible.&lt;br /&gt;
&lt;br /&gt;
  --debugssl     int  : SSL debug mode from 0 to 4.&lt;br /&gt;
&lt;br /&gt;
  --sslargs1     str  : Pass any ssl parameter for host1 ssl or tls connection. Example:&lt;br /&gt;
                        --sslargs1 SSL_verify_mode=1 --sslargs1 SSL_version=SSLv3&lt;br /&gt;
                        See all possibilities in the new() method of IO::Socket::SSL&lt;br /&gt;
                        http://search.cpan.org/perldoc?IO::Socket::SSL#Description_Of_Methods&lt;br /&gt;
  --sslargs2     str  : Pass any ssl parameter for host2 ssl or tls connection.&lt;br /&gt;
                        See --sslargs1&lt;br /&gt;
&lt;br /&gt;
  --timeout1     flo  : Connection timeout in seconds for host1.&lt;br /&gt;
                        Default is 120 and 0 means no timeout at all.&lt;br /&gt;
  --timeout2     flo  : Connection timeout in seconds for host2.&lt;br /&gt;
                        Default is 120 and 0 means no timeout at all.&lt;br /&gt;
&lt;br /&gt;
                        Caveat, under CGI context, you may encounter a timeout&lt;br /&gt;
                        from the webserver, killing imapsync and the imap connexions.&lt;br /&gt;
                        See the document INSTALL.OnlineUI.txt and search&lt;br /&gt;
                        for &amp;quot;Timeout&amp;quot; for how to deal with this issue.&lt;br /&gt;
&lt;br /&gt;
Options/authentication:&lt;br /&gt;
&lt;br /&gt;
  --authmech1    str  : Auth mechanism to use with host1:&lt;br /&gt;
                        PLAIN, LOGIN, CRAM-MD5 etc. Use UPPERCASE.&lt;br /&gt;
  --authmech2    str  : Auth mechanism to use with host2. See --authmech1&lt;br /&gt;
&lt;br /&gt;
  --authuser1    str  : User to auth with on host1 (admin user).&lt;br /&gt;
                        Avoid using --authmech1 SOMETHING with --authuser1.&lt;br /&gt;
  --authuser2    str  : User to auth with on host2 (admin user).&lt;br /&gt;
  --proxyauth1        : Use proxyauth on host1. Requires --authuser1.&lt;br /&gt;
                        Required by Sun/iPlanet/Netscape IMAP servers to&lt;br /&gt;
                        be able to use an administrative user.&lt;br /&gt;
  --proxyauth2        : Use proxyauth on host2. Requires --authuser2.&lt;br /&gt;
&lt;br /&gt;
  --authmd51          : Use MD5 authentication for host1.&lt;br /&gt;
  --authmd52          : Use MD5 authentication for host2.&lt;br /&gt;
  --domain1      str  : Domain on host1 (NTLM authentication).&lt;br /&gt;
  --domain2      str  : Domain on host2 (NTLM authentication).&lt;br /&gt;
&lt;br /&gt;
  --oauthaccesstoken1 str : The access token to authenticate with OAUTH2.&lt;br /&gt;
                        It will be combined with the --user1 value to form the &lt;br /&gt;
                        string to pass with XOAUTH2 authentication.&lt;br /&gt;
                        The password given by --password1 or --passfile1&lt;br /&gt;
                        is ignored.&lt;br /&gt;
                        Instead of the access token itself, the value can be a&lt;br /&gt;
                        file containing the access token on the first line.&lt;br /&gt;
                        If the value is a file, imapsync reads its first line&lt;br /&gt;
                        and take this line as the access token. The advantage&lt;br /&gt;
                        of the file is that if the access token changes then&lt;br /&gt;
                        imapsync can read it again when it needs to reconnect &lt;br /&gt;
                        during a run.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  --oauthaccesstoken2 str : same thing as --oauthaccesstoken1 &lt;br /&gt;
&lt;br /&gt;
  --oauthdirect1 str  : The direct string to pass with XOAUTH2 authentication.&lt;br /&gt;
                        The password given by --password1 or --passfile1 and &lt;br /&gt;
                        the user given by --user1 are ignored.&lt;br /&gt;
&lt;br /&gt;
  --oauthdirect2 str  : same thing as oauthdirect1&lt;br /&gt;
&lt;br /&gt;
Options/folders:&lt;br /&gt;
&lt;br /&gt;
  --folder       str  : Sync this folder.&lt;br /&gt;
  --folder       str  : and this one, etc.&lt;br /&gt;
  --folderrec    str  : Sync this folder recursively.&lt;br /&gt;
  --folderrec    str  : and this one, etc.&lt;br /&gt;
&lt;br /&gt;
  --folderfirst  str  : Sync this folder first. Ex. --folderfirst &amp;quot;INBOX&amp;quot;&lt;br /&gt;
  --folderfirst  str  : then this one, etc.&lt;br /&gt;
  --folderlast   str  : Sync this folder last. --folderlast &amp;quot;[Gmail]/All Mail&amp;quot;&lt;br /&gt;
  --folderlast   str  : then this one, etc.&lt;br /&gt;
&lt;br /&gt;
  --nomixfolders      : Do not merge folders when host1 is case-sensitive&lt;br /&gt;
                        while host2 is not (like Exchange). Only the first&lt;br /&gt;
                        similar folder is synced (example: with folders&lt;br /&gt;
                        &amp;quot;Sent&amp;quot;, &amp;quot;SENT&amp;quot; and &amp;quot;sent&amp;quot;&lt;br /&gt;
                        on host1 only &amp;quot;Sent&amp;quot; will be synced to host2).&lt;br /&gt;
&lt;br /&gt;
  --skipemptyfolders  : Empty host1 folders are not created on host2.&lt;br /&gt;
&lt;br /&gt;
  --include      reg  : Sync folders matching this regular expression&lt;br /&gt;
  --include      reg  : or this one, etc.&lt;br /&gt;
                        If both --include --exclude options are used, then&lt;br /&gt;
                        include is done before.&lt;br /&gt;
  --exclude      reg  : Skips folders matching this regular expression&lt;br /&gt;
                        Several folders to avoid:&lt;br /&gt;
                         --exclude &amp;#039;fold1|fold2|f3&amp;#039; skips fold1, fold2 and f3.&lt;br /&gt;
  --exclude      reg  : or this one, etc.&lt;br /&gt;
&lt;br /&gt;
  --automap           : guesses folders mapping, for folders well known as&lt;br /&gt;
                        &amp;quot;Sent&amp;quot;, &amp;quot;Junk&amp;quot;, &amp;quot;Drafts&amp;quot;, &amp;quot;All&amp;quot;, &amp;quot;Archive&amp;quot;, &amp;quot;Flagged&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
  --f1f2    str1=str2 : Force folder str1 to be synced to str2,&lt;br /&gt;
                        --f1f2 overrides --automap and --regextrans2.&lt;br /&gt;
                        Use several --f1f2 options to map several folders.&lt;br /&gt;
                        Option --f1f2 is a one to one only folder mapping,&lt;br /&gt;
                        str1 and str2 have to be full path folder names.&lt;br /&gt;
&lt;br /&gt;
  --subfolder2   str  : Syncs the whole host1 folders hierarchy under the&lt;br /&gt;
                        host2 folder named str.&lt;br /&gt;
                        It does it internally by adding three&lt;br /&gt;
                        --regextrans2 options before all others.&lt;br /&gt;
                        Add --debug to see what&amp;#039;s really going on.&lt;br /&gt;
&lt;br /&gt;
  --subfolder1   str  : Syncs the host1 folders hierarchy which is under folder&lt;br /&gt;
                        str to the root hierarchy of host2.&lt;br /&gt;
                        It&amp;#039;s the couterpart of a sync done by --subfolder2&lt;br /&gt;
                        when doing it in the reverse order.&lt;br /&gt;
                        Backup/Restore scenario:&lt;br /&gt;
                        Use --subfolder2 str for a backup to the folder str&lt;br /&gt;
                        on host2. Then use --subfolder1 str for restoring&lt;br /&gt;
                        from the folder str, after inverting&lt;br /&gt;
                        host1/host2 user1/user2 values.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  --subscribed        : Transfers subscribed folders.&lt;br /&gt;
  --subscribe         : Subscribe to the folders transferred on the&lt;br /&gt;
                        host2 that are subscribed on host1. On by default.&lt;br /&gt;
  --subscribeall      : Subscribe to the folders transferred on the&lt;br /&gt;
                        host2 even if they are not subscribed on host1.&lt;br /&gt;
&lt;br /&gt;
  --prefix1      str  : Remove prefix str to all destination folders,&lt;br /&gt;
                        usually &amp;quot;INBOX.&amp;quot; or &amp;quot;INBOX/&amp;quot; or an empty string &amp;quot;&amp;quot;.&lt;br /&gt;
                        imapsync guesses the prefix if host1 imap server&lt;br /&gt;
                        does not have NAMESPACE capability. So this option&lt;br /&gt;
                        should not be used most of the time.&lt;br /&gt;
  --prefix2      str  : Add prefix to all host2 folders. See --prefix1&lt;br /&gt;
&lt;br /&gt;
  --sep1         str  : Host1 separator. This option should not be used&lt;br /&gt;
                        most of the time.&lt;br /&gt;
                        Imapsync gets the separator from the server itself,&lt;br /&gt;
                        by using NAMESPACE, or it tries to guess it&lt;br /&gt;
                        from the folders listing (it counts&lt;br /&gt;
                        characters / . \\ \ in folder names and choose the&lt;br /&gt;
                        more frequent, or finally / if nothing is found.&lt;br /&gt;
  --sep2         str  : Host2 separator. See --sep1&lt;br /&gt;
&lt;br /&gt;
  --regextrans2  reg  : Apply the whole regex to each destination folders.&lt;br /&gt;
  --regextrans2  reg  : and this one. etc.&lt;br /&gt;
                        When you play with the --regextrans2 option, first&lt;br /&gt;
                        add also the safe options --dry --justfolders&lt;br /&gt;
                        Then, when happy, remove --dry for a run, then&lt;br /&gt;
                        remove --justfolders for the next ones.&lt;br /&gt;
                        Have in mind that --regextrans2 is applied after&lt;br /&gt;
                        the automatic prefix and separator inversion.&lt;br /&gt;
                        For examples see:&lt;br /&gt;
                        https://imapsync.lamiral.info/FAQ.d/FAQ.Folders_Mapping.txt&lt;br /&gt;
&lt;br /&gt;
Options/folders sizes:&lt;br /&gt;
&lt;br /&gt;
  --nofoldersizes     : Do not calculate the size of each folder at the&lt;br /&gt;
                        beginning of the sync. Default is to calculate them.&lt;br /&gt;
  --nofoldersizesatend: Do not calculate the size of each folder at the&lt;br /&gt;
                        end of the sync. Default is to calculate them.&lt;br /&gt;
  --justfoldersizes   : Exit after having printed the initial folder sizes.&lt;br /&gt;
&lt;br /&gt;
Options/tmp:&lt;br /&gt;
&lt;br /&gt;
  --tmpdir       str  : Where to store temporary files and subdirectories.&lt;br /&gt;
                        Will be created if it doesn&amp;#039;t exist.&lt;br /&gt;
                        Default is system specific, Unix is /tmp but&lt;br /&gt;
                        /tmp is often too small and deleted at reboot.&lt;br /&gt;
                        --tmpdir /var/tmp should be better.&lt;br /&gt;
&lt;br /&gt;
  --pidfile      str  : The file where imapsync pid is written,&lt;br /&gt;
                        it can be dirname/filename complete path.&lt;br /&gt;
                        The default name is imapsync.pid in tmpdir.&lt;br /&gt;
&lt;br /&gt;
  --pidfilelocking    : Abort if pidfile already exists. Useful to avoid&lt;br /&gt;
                        concurrent transfers on the same mailbox.&lt;br /&gt;
&lt;br /&gt;
Options/log:&lt;br /&gt;
&lt;br /&gt;
  --nolog             : Turn off logging on file&lt;br /&gt;
  --logfile      str  : Change the default log filename (can be dirname/filename).&lt;br /&gt;
  --logdir       str  : Change the default log directory. Default is LOG_imapsync/&lt;br /&gt;
&lt;br /&gt;
 The default logfile name is for example&lt;br /&gt;
&lt;br /&gt;
  LOG_imapsync/2019_12_22_23_57_59_532_user1_user2.txt&lt;br /&gt;
&lt;br /&gt;
 where:&lt;br /&gt;
&lt;br /&gt;
  2019_12_22_23_57_59_532 is nearly the date of the start&lt;br /&gt;
  YYYY_MM_DD_HH_MM_SS_mmm&lt;br /&gt;
  year_month_day_hour_minute_seconde_millisecond&lt;br /&gt;
&lt;br /&gt;
 and user1 user2 are the --user1 --user2 values.&lt;br /&gt;
&lt;br /&gt;
Options/messages:&lt;br /&gt;
&lt;br /&gt;
  --skipmess     reg  : Skips messages matching the regex.&lt;br /&gt;
                        Example: &amp;#039;m/[\x80-\xff]/&amp;#039; # to avoid 8bits messages.&lt;br /&gt;
                        --skipmess is applied before --regexmess&lt;br /&gt;
  --skipmess     reg  : or this one, etc.&lt;br /&gt;
&lt;br /&gt;
  --skipcrossduplicates : Avoid copying messages that are already copied&lt;br /&gt;
                          in another folder, good from Gmail to XYZ when&lt;br /&gt;
                          XYZ is not also Gmail.&lt;br /&gt;
                          Activated with --gmail1 unless --noskipcrossduplicates&lt;br /&gt;
&lt;br /&gt;
  --debugcrossduplicates : Prints which messages (UIDs) are skipped with&lt;br /&gt;
                           --skipcrossduplicates and in what other folders&lt;br /&gt;
                           they are.&lt;br /&gt;
&lt;br /&gt;
  --pipemess     cmd  : Apply this cmd command to each message content&lt;br /&gt;
                        before the copy.&lt;br /&gt;
  --pipemess     cmd  : and this one, etc.&lt;br /&gt;
                        With several --pipemess, the output of each cmd&lt;br /&gt;
                        command (STDOUT) is given to the input (STDIN)&lt;br /&gt;
                        of the next command.&lt;br /&gt;
                        For example,&lt;br /&gt;
                        --pipemess cmd1 --pipemess cmd2 --pipemess cmd3&lt;br /&gt;
                        is like a Unix pipe:&lt;br /&gt;
                        &amp;quot;cat message | cmd1 | cmd2 | cmd3&amp;quot;&lt;br /&gt;
&lt;br /&gt;
  --disarmreadreceipts : Disarms read receipts (host2 Exchange issue)&lt;br /&gt;
&lt;br /&gt;
  --regexmess    reg  : Apply the whole regex to each message before transfer.&lt;br /&gt;
                        Example: &amp;#039;s/\000/ /g&amp;#039; # to replace null characters&lt;br /&gt;
                        by spaces.&lt;br /&gt;
  --regexmess    reg  : and this one, etc.&lt;br /&gt;
&lt;br /&gt;
Options/labels:&lt;br /&gt;
&lt;br /&gt;
 Gmail present labels as folders in imap. Imapsync can accelerate the sync&lt;br /&gt;
 by syncing X-GM-LABELS, it will avoid to transfer messages when they are&lt;br /&gt;
 already on host2 in another folder.&lt;br /&gt;
&lt;br /&gt;
  --synclabels        : Syncs also Gmail labels when a message is copied to host2.&lt;br /&gt;
                        Activated by default with --gmail1 --gmail2 unless&lt;br /&gt;
                        --nosynclabels is added.&lt;br /&gt;
&lt;br /&gt;
  --resynclabels      : Resyncs Gmail labels when a message is already on host2.&lt;br /&gt;
                        Activated by default with --gmail1 --gmail2 unless&lt;br /&gt;
                        --noresynclabels is added.&lt;br /&gt;
&lt;br /&gt;
 For Gmail syncs, see also:&lt;br /&gt;
 https://imapsync.lamiral.info/FAQ.d/FAQ.Gmail.txt&lt;br /&gt;
&lt;br /&gt;
Options/flags:&lt;br /&gt;
&lt;br /&gt;
  If you encounter flag problems see also:&lt;br /&gt;
  https://imapsync.lamiral.info/FAQ.d/FAQ.Flags.txt&lt;br /&gt;
&lt;br /&gt;
  --regexflag    reg  : Apply the whole regex to each flags list.&lt;br /&gt;
                        Example: &amp;#039;s/&amp;quot;Junk&amp;quot;//g&amp;#039; # to remove &amp;quot;Junk&amp;quot; flag.&lt;br /&gt;
  --regexflag    reg  : then this one, etc.&lt;br /&gt;
&lt;br /&gt;
  --resyncflags       : Resync flags for already transferred messages.&lt;br /&gt;
                        On by default.&lt;br /&gt;
  --noresyncflags     : Do not resync flags for already transferred messages.&lt;br /&gt;
                        May be useful when a user has already started to play&lt;br /&gt;
                        with its host2 account.&lt;br /&gt;
&lt;br /&gt;
  --filterbuggyflags  : Filter flags known to be buggy and generators of errors&lt;br /&gt;
                        &amp;quot;BAD Invalid system flag&amp;quot; or &amp;quot;NO APPEND Invalid flag list&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Options/deletions:&lt;br /&gt;
&lt;br /&gt;
  --delete1           : Deletes messages on host1 server after a successful&lt;br /&gt;
                        transfer. Option --delete1 has the following behavior:&lt;br /&gt;
                        it marks messages as deleted with the IMAP flag&lt;br /&gt;
                        \Deleted, then messages are really deleted with an&lt;br /&gt;
                        EXPUNGE IMAP command. If expunging after each message&lt;br /&gt;
                        slows down too much the sync then use&lt;br /&gt;
                        --noexpungeaftereach to speed up, expunging will then be&lt;br /&gt;
                        done only twice per folder, one at the beginning and&lt;br /&gt;
                        one at the end of a folder sync.&lt;br /&gt;
&lt;br /&gt;
  --expunge1          : Expunge messages on host1 just before syncing a folder.&lt;br /&gt;
                        Expunge is done per folder.&lt;br /&gt;
                        Expunge aims is to really delete messages marked deleted.&lt;br /&gt;
                        An expunge is also done after each message copied&lt;br /&gt;
                        if option --delete1 is set (unless --noexpungeaftereach).&lt;br /&gt;
&lt;br /&gt;
  --noexpunge1        : Do not expunge messages on host1.&lt;br /&gt;
&lt;br /&gt;
  --delete1emptyfolders : Deletes empty folders on host1, INBOX excepted.&lt;br /&gt;
                          Useful with --delete1 since what remains on host1&lt;br /&gt;
                          is only what failed to be synced.&lt;br /&gt;
&lt;br /&gt;
  --delete2           : Delete messages in the host2 account that are not in&lt;br /&gt;
                        the host1 account. Useful for backup or pre-sync.&lt;br /&gt;
                        --delete2 implies --uidexpunge2&lt;br /&gt;
&lt;br /&gt;
  --delete2duplicates : Deletes messages in host2 that are duplicates in host2.&lt;br /&gt;
                        Works only without --useuid since duplicates are&lt;br /&gt;
                        detected with an header part of each message.&lt;br /&gt;
                        NB: --delete2duplicates is far less violent than --delete2&lt;br /&gt;
                        since it removes only duplicates.&lt;br /&gt;
&lt;br /&gt;
  --delete2folders    : Delete folders in host2 that are not in host1.&lt;br /&gt;
                        For safety, first try it like this, it is safe:&lt;br /&gt;
                        --delete2folders --dry --justfolders --nofoldersizes&lt;br /&gt;
                        and see what folders will be deleted.&lt;br /&gt;
&lt;br /&gt;
  --delete2foldersonly   reg : Delete only folders matching the regex reg.&lt;br /&gt;
                               Example: --delete2foldersonly &amp;quot;/^Junk$|^INBOX.Junk$/&amp;quot;&lt;br /&gt;
                               This option activates --delete2folders&lt;br /&gt;
&lt;br /&gt;
  --delete2foldersbutnot reg : Do not delete folders matching the regex rex.&lt;br /&gt;
                               Example: --delete2foldersbutnot &amp;quot;/Tasks$|Contacts$|Foo$/&amp;quot;&lt;br /&gt;
                               This option activates --delete2folders&lt;br /&gt;
&lt;br /&gt;
  --noexpunge2        : Do not expunge messages on host2.&lt;br /&gt;
  --nouidexpunge2     : Do not uidexpunge messages on the host2 account&lt;br /&gt;
                        that are not on the host1 account.&lt;br /&gt;
&lt;br /&gt;
Options/dates:&lt;br /&gt;
&lt;br /&gt;
  If you encounter problems with dates, see also:&lt;br /&gt;
  https://imapsync.lamiral.info/FAQ.d/FAQ.Dates.txt&lt;br /&gt;
&lt;br /&gt;
  --syncinternaldates : Sets the internal dates on host2 as the same as host1.&lt;br /&gt;
                        Turned on by default. Internal date is the date&lt;br /&gt;
                        a message arrived on a host (Unix mtime usually).&lt;br /&gt;
  --idatefromheader   : Sets the internal dates on host2 as same as the&lt;br /&gt;
                        ones in &amp;quot;Date:&amp;quot; headers.&lt;br /&gt;
&lt;br /&gt;
Options/message selection:&lt;br /&gt;
&lt;br /&gt;
  --maxsize      int  : Skip messages larger  (or equal) than  int  bytes&lt;br /&gt;
  --minsize      int  : Skip messages smaller (or equal) than  int  bytes&lt;br /&gt;
&lt;br /&gt;
  --maxage       int  : Skip messages older than  int days.&lt;br /&gt;
                        final stats (skipped) don&amp;#039;t count older messages&lt;br /&gt;
                        see also --minage&lt;br /&gt;
  --minage       int  : Skip messages newer than  int  days.&lt;br /&gt;
                        final stats (skipped) don&amp;#039;t count newer messages&lt;br /&gt;
                        You can do (+ zone are the messages selected):&lt;br /&gt;
                        past|----maxage+++++++++++++++&amp;gt;now&lt;br /&gt;
                        past|+++++++++++++++minage----&amp;gt;now&lt;br /&gt;
                        past|----maxage+++++minage----&amp;gt;now (intersection)&lt;br /&gt;
                        past|++++minage-----maxage++++&amp;gt;now (union)&lt;br /&gt;
&lt;br /&gt;
  --search       str  : Selects only messages returned by this IMAP SEARCH&lt;br /&gt;
                        command. Applied on both sides.&lt;br /&gt;
                        For a complete set of what can be search see&lt;br /&gt;
                        https://imapsync.lamiral.info/FAQ.d/FAQ.Messages_Selection.txt&lt;br /&gt;
&lt;br /&gt;
  --search1      str  : Same as --search but for selecting host1 messages only.&lt;br /&gt;
  --search2      str  : Same as --search but for selecting host2 messages only.&lt;br /&gt;
                        So --search CRIT equals --search1 CRIT --search2 CRIT&lt;br /&gt;
&lt;br /&gt;
  --noabletosearch    : Makes --minage and --maxage options use the internal&lt;br /&gt;
                        dates given by a FETCH imap command instead of the&lt;br /&gt;
                        &amp;quot;Date:&amp;quot; header. Internal date is the arrival date&lt;br /&gt;
                        in the mailbox.&lt;br /&gt;
                        --noabletosearch equals --noabletosearch1 --noabletosearch2&lt;br /&gt;
&lt;br /&gt;
  --noabletosearch1   : Like --noabletosearch but for host1 only.&lt;br /&gt;
  --noabletosearch2   : Like --noabletosearch but for host2 only.&lt;br /&gt;
&lt;br /&gt;
  --maxlinelength int : skip messages with a line length longer than  int  bytes.&lt;br /&gt;
                        RFC 2822 says it must be no more than 1000 bytes but&lt;br /&gt;
                        real life servers and email clients do more.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  --useheader    str  : Use this header to compare messages on both sides.&lt;br /&gt;
                        Example: &amp;quot;Message-Id&amp;quot; or &amp;quot;Received&amp;quot; or &amp;quot;Date&amp;quot;.&lt;br /&gt;
  --useheader    str    and this one, etc.&lt;br /&gt;
&lt;br /&gt;
  --syncduplicates    : Sync also duplicates. Off by default.&lt;br /&gt;
&lt;br /&gt;
  --usecache          : Use cache to speed up next syncs. Off by default.&lt;br /&gt;
  --nousecache        : Do not use cache. Caveat: --useuid --nousecache creates&lt;br /&gt;
                        duplicates on multiple runs.&lt;br /&gt;
&lt;br /&gt;
  --useuid            : Use UIDs instead of headers as a criterion to recognize&lt;br /&gt;
                        messages. Option --usecache is then implied unless&lt;br /&gt;
                        --nousecache is used.&lt;br /&gt;
&lt;br /&gt;
Options/miscellaneous:&lt;br /&gt;
&lt;br /&gt;
  --syncacls          : Synchronizes acls (Access Control Lists).&lt;br /&gt;
                        Acls in IMAP are not standardized, be careful&lt;br /&gt;
                        since one acl code on one side may signify something&lt;br /&gt;
                        else on the other one.&lt;br /&gt;
  --nosyncacls        : Does not synchronize acls. This is the default.&lt;br /&gt;
&lt;br /&gt;
  --addheader         : When a message has no headers to be identified,&lt;br /&gt;
                        --addheader adds a &amp;quot;Message-Id&amp;quot; header,&lt;br /&gt;
                        like &amp;quot;Message-Id: 12345@imapsync&amp;quot;, where 12345&lt;br /&gt;
                        is the imap UID of the message on the host1 folder.&lt;br /&gt;
                        Useful to sync folders &amp;quot;Sent&amp;quot; or &amp;quot;Draft&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Options/debugging:&lt;br /&gt;
&lt;br /&gt;
  --debug             : Debug mode.&lt;br /&gt;
  --debugfolders      : Debug mode for the folders part only.&lt;br /&gt;
  --debugcontent      : Debug content of the messages transferred. Huge output.&lt;br /&gt;
  --debugflags        : Debug mode for flags.&lt;br /&gt;
  --debugimap1        : IMAP debug mode for host1. Very verbose.&lt;br /&gt;
  --debugimap2        : IMAP debug mode for host2. Very verbose.&lt;br /&gt;
  --debugimap         : IMAP debug mode for host1 and host2. Twice very verbose.&lt;br /&gt;
  --debugmemory       : Debug mode showing memory consumption after each copy.&lt;br /&gt;
&lt;br /&gt;
  --errorsmax     int : Exit when int number of errors is reached. Default is 50.&lt;br /&gt;
&lt;br /&gt;
  --tests             : Run local non-regression tests. Exit code 0 means all ok.&lt;br /&gt;
  --testslive         : Run a live test with test1.lamiral.info imap server.&lt;br /&gt;
                        Useful to check the basics. Needs internet connection.&lt;br /&gt;
  --testslive6        : Run a live test with ks6ipv6.lamiral.info imap server.&lt;br /&gt;
                        Useful to check the ipv6 connectivity. Needs internet.&lt;br /&gt;
&lt;br /&gt;
Options/specific:&lt;br /&gt;
&lt;br /&gt;
   --gmail1           : sets --host1 to Gmail and other options. See FAQ.Gmail.txt&lt;br /&gt;
   --gmail2           : sets --host2 to Gmail and other options. See FAQ.Gmail.txt&lt;br /&gt;
&lt;br /&gt;
   --office1          : sets --host1 to Office365 and other options. See FAQ.Office365.txt&lt;br /&gt;
   --office2          : sets --host2 to Office365 and other options. See FAQ.Office365.txt&lt;br /&gt;
&lt;br /&gt;
   --exchange1        : sets options for Exchange. See FAQ.Exchange.txt&lt;br /&gt;
   --exchange2        : sets options for Exchange. See FAQ.Exchange.txt&lt;br /&gt;
&lt;br /&gt;
   --domino1          : sets options for Domino. See FAQ.Domino.txt&lt;br /&gt;
   --domino2          : sets options for Domino. See FAQ.Domino.txt&lt;br /&gt;
&lt;br /&gt;
Options/behavior:&lt;br /&gt;
&lt;br /&gt;
  --maxmessagespersecond flo : limits the average number of messages &lt;br /&gt;
                               transferred per second.&lt;br /&gt;
&lt;br /&gt;
  --maxbytespersecond int : limits the average transfer rate per second.&lt;br /&gt;
  --maxbytesafter     int : starts --maxbytespersecond limitation only after&lt;br /&gt;
                            --maxbytesafter amount of data transferred.&lt;br /&gt;
&lt;br /&gt;
  --maxsleep      flo : do not sleep more than int seconds.&lt;br /&gt;
                        On by default, 2 seconds max, like --maxsleep 2&lt;br /&gt;
&lt;br /&gt;
  --abort             : terminates a previous call still running.&lt;br /&gt;
                        It uses the pidfile to know what process to abort.&lt;br /&gt;
&lt;br /&gt;
  --exitwhenover int  : Stop syncing and exits when int total bytes&lt;br /&gt;
                        transferred is reached.&lt;br /&gt;
&lt;br /&gt;
  --version           : Print only the software version.&lt;br /&gt;
  --noreleasecheck    : Do not check for any new imapsync release.&lt;br /&gt;
  --releasecheck      : Check for new imapsync release.&lt;br /&gt;
                        it&amp;#039;s an http request to&lt;br /&gt;
                        http://imapsync.lamiral.info/prj/imapsync/VERSION&lt;br /&gt;
&lt;br /&gt;
  --noid              : Do not send/receive IMAP &amp;quot;ID&amp;quot; command to imap servers.&lt;br /&gt;
&lt;br /&gt;
  --justconnect       : Just connect to both servers and print useful&lt;br /&gt;
                        information. Need only --host1 and --host2 options.&lt;br /&gt;
                        Obsolete since &amp;quot;imapsync --host1 imaphost&amp;quot; alone&lt;br /&gt;
                        implies --justconnect&lt;br /&gt;
&lt;br /&gt;
  --justlogin         : Just login to both host1 and host2 with users&lt;br /&gt;
                        credentials, then exit.&lt;br /&gt;
&lt;br /&gt;
  --justfolders       : Do only things about folders (ignore messages).&lt;br /&gt;
&lt;br /&gt;
  --help              : print this help.&lt;br /&gt;
&lt;br /&gt;
  Example: to synchronize imap account &amp;quot;test1&amp;quot; on &amp;quot;test1.lamiral.info&amp;quot;&lt;br /&gt;
                      to  imap account &amp;quot;test2&amp;quot; on &amp;quot;test2.lamiral.info&amp;quot;&lt;br /&gt;
                      with test1 password &amp;quot;secret1&amp;quot;&lt;br /&gt;
                      and  test2 password &amp;quot;secret2&amp;quot;&lt;br /&gt;
&lt;br /&gt;
  imapsync \&lt;br /&gt;
     --host1 test1.lamiral.info --user1 test1 --password1 secret1 \&lt;br /&gt;
     --host2 test2.lamiral.info --user2 test2 --password2 secret2&lt;br /&gt;
&lt;br /&gt;
Here is imapsync 2.140 on host imapsync, a linux system with 2.2/3.8 free GiB of RAM&lt;br /&gt;
with Perl 5.30.0 and Mail::IMAPClient 3.42&lt;br /&gt;
$Id: imapsync,v 2.140 2021/07/05 20:14:18 gilles Exp gilles $&lt;br /&gt;
This imapsync is up to date. ( local 2.140 &amp;gt;= official 2.140 )( Use --noreleasecheck to avoid this release check. )&lt;br /&gt;
Homepage: https://imapsync.lamiral.info/&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Dax</name></author>
	</entry>
</feed>