1# Imapsync sponsoring
2
3You are a great imapsync user or perhaps a future one! I thank you for that, very much.
4The paradox to get imapsync stay free and gratis for anyone is that the imapsync author needs to be paid for maintening and improving it.
5
6In case you're using imapsync in a professional context,
7then consider buying imapsync and support at https://imapsync.lamiral.info/#buy_all,
8you will get also a regular invoice for your company.
9
10If it's too much, then consider a smaller donation:
11
12[![paypal](https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=TUENPW59U9LL2) or on regular monthly donation via the new github sponsoring campaign https://github.com/sponsors/gilleslamiral
13
14**Thanks in any case, even no money, I'm ok with that!**
15
16# README
17````
18NAME
19
20    imapsync - Email IMAP tool for syncing, copying, migrating and archiving
21    email mailboxes between two imap servers, one way, and without
22    duplicates.
23
24VERSION
25
26    This documentation refers to Imapsync $Revision: 1.977 $
27
28USAGE
29
30     To synchronize the source imap account
31       "test1" on server "test1.lamiral.info" with password "secret1"
32     to the destination imap account
33       "test2" on server "test2.lamiral.info" with password "secret2"
34     do:
35
36      imapsync \
37       --host1 test1.lamiral.info --user1 test1 --password1 secret1 \
38       --host2 test2.lamiral.info --user2 test2 --password2 secret2
39
40DESCRIPTION
41
42    We sometimes need to transfer mailboxes from one imap server to one
43    another.
44
45    Imapsync command is a tool allowing incremental and recursive imap
46    transfers from one mailbox to another. If you don't understand the
47    previous sentence, it's normal, it's pedantic computer oriented jargon.
48
49    All folders are transferred, recursively, meaning the whole folder
50    hierarchy is taken, all messages in them, and all messages flags (\Seen
51    \Answered \Flagged etc.) are synced too.
52
53    Imapsync reduces the amount of data transferred by not transferring a
54    given message if it already resides on the destination side. Messages
55    that are on the destination side but not on the source side stay as they
56    are (see the --delete2 option to have a strict sync).
57
58    How imapsync knows a message is already on both sides? Same specific
59    headers and the transfer is done only once. By default, the
60    identification headers are "Message-Id:" and "Received:" lines but this
61    choice can be changed with the --useheader option.
62
63    All flags are preserved, unread messages will stay unread, read ones
64    will stay read, deleted will stay deleted.
65
66    You can abort the transfer at any time and restart it later, imapsync
67    works well with bad connections and interruptions, by design. On a
68    terminal hit Ctr-c twice within two seconds in order to abort the
69    program. Hit Ctr-c just once makes imapsync reconnect to both imap
70    servers.
71
72    A classical scenario is synchronizing a mailbox B from another mailbox A
73    where you just want to keep a strict copy of A in B. Strict meaning all
74    messages in A will be in B but no more.
75
76    For this, option --delete2 has to be used, it deletes messages in host2
77    folder B that are not in host1 folder A. If you also need to destroy
78    host2 folders that are not in host1 then use --delete2folders. See also
79    --delete2foldersonly and --delete2foldersbutnot to set up exceptions on
80    folders to destroy. INBOX will never be destroy, it's a mandatory folder
81    in IMAP.
82
83    A different scenario is to delete the messages from the source mailbox
84    after a successful transfer, it can be a good feature when migrating
85    mailboxes since messages will be only on one side. The source account
86    will only have messages that are not on the destination yet, ie,
87    messages that arrived after a sync or that failed to be copied.
88
89    In that case, use the --delete1 option. Option --delete1 implies also
90    option --expunge1 so all messages marked deleted on host1 will be really
91    deleted. In IMAP protocol deleting a message does not really delete it,
92    it marks it with the flag \Deleted, allowing an undelete. Expunging a
93    folder removes, definitively, all the messages marked as \Deleted in
94    this folder.
95
96    You can also decide to remove empty folders once all of their messages
97    have been transferred. Add --delete1emptyfolders to obtain this
98    behavior.
99
100    Imapsync is not adequate for maintaining two active imap accounts in
101    synchronization when the user plays independently on both sides. Use
102    offlineimap (written by John Goerzen) or mbsync (written by Michael R.
103    Elkins) for a 2 ways synchronization.
104
105OPTIONS
106
107     usage: imapsync [options]
108
109    The standard options are the six values forming the credentials. Three
110    values on each side are needed in order to log in into the IMAP servers.
111    These six values are a host, a username, and a password, two times.
112
113    Conventions used in the following descriptions of the options:
114
115     str means string
116     int means integer
117     reg means regular expression
118     cmd means command
119
120     --dry               : Makes imapsync doing nothing for real, just print what
121                           would be done without --dry.
122
123  OPTIONS/credentials
124
125     --host1        str  : Source or "from" imap server.
126     --port1        int  : Port to connect on host1.
127                           Optional since default ports are the
128                           well known ports imap/143 or imaps/993.
129     --user1        str  : User to login on host1.
130     --password1    str  : Password for the user1.
131
132     --host2        str  : "destination" imap server.
133     --port2        int  : Port to connect on host2. Optional
134     --user2        str  : User to login on host2.
135     --password2    str  : Password for the user2.
136
137     --showpasswords     : Shows passwords on output instead of "MASKED".
138                           Useful to restart a complete run by just reading
139                           the command line used in the log,
140                           or to debug passwords.
141                           It's not a secure practice at all.
142
143     --passfile1    str  : Password file for the user1. It must contain the
144                           password on the first line. This option avoids showing
145                           the password on the command line like --password1 does.
146     --passfile2    str  : Password file for the user2.
147
148    You can also pass the passwords in the environment variables
149    IMAPSYNC_PASSWORD1 and IMAPSYNC_PASSWORD2
150
151  OPTIONS/encryption
152
153     --nossl1            : Do not use a SSL connection on host1.
154     --ssl1              : Use a SSL connection on host1. On by default if possible.
155
156     --nossl2            : Do not use a SSL connection on host2.
157     --ssl2              : Use a SSL connection on host2. On by default if possible.
158
159     --notls1            : Do not use a TLS connection on host1.
160     --tls1              : Use a TLS connection on host1. On by default if possible.
161
162     --notls2            : Do not use a TLS connection on host2.
163     --tls2              : Use a TLS connection on host2. On by default if possible.
164
165     --debugssl     int  : SSL debug mode from 0 to 4.
166
167     --sslargs1     str  : Pass any ssl parameter for host1 ssl or tls connection. Example:
168                           --sslargs1 SSL_verify_mode=1 --sslargs1 SSL_version=SSLv3
169                           See all possibilities in the new() method of IO::Socket::SSL
170                           http://search.cpan.org/perldoc?IO::Socket::SSL#Description_Of_Methods
171     --sslargs2     str  : Pass any ssl parameter for host2 ssl or tls connection.
172                           See --sslargs1
173
174     --timeout1     int  : Connection timeout in seconds for host1.
175                           Default is 120 and 0 means no timeout at all.
176     --timeout2     int  : Connection timeout in seconds for host2.
177                           Default is 120 and 0 means no timeout at all.
178
179  OPTIONS/authentication
180
181     --authmech1    str  : Auth mechanism to use with host1:
182                           PLAIN, LOGIN, CRAM-MD5 etc. Use UPPERCASE.
183     --authmech2    str  : Auth mechanism to use with host2. See --authmech1
184
185     --authuser1    str  : User to auth with on host1 (admin user).
186                           Avoid using --authmech1 SOMETHING with --authuser1.
187     --authuser2    str  : User to auth with on host2 (admin user).
188     --proxyauth1        : Use proxyauth on host1. Requires --authuser1.
189                           Required by Sun/iPlanet/Netscape IMAP servers to
190                           be able to use an administrative user.
191     --proxyauth2        : Use proxyauth on host2. Requires --authuser2.
192
193     --authmd51          : Use MD5 authentication for host1.
194     --authmd52          : Use MD5 authentication for host2.
195     --domain1      str  : Domain on host1 (NTLM authentication).
196     --domain2      str  : Domain on host2 (NTLM authentication).
197
198  OPTIONS/folders
199
200     --folder       str  : Sync this folder.
201     --folder       str  : and this one, etc.
202     --folderrec    str  : Sync this folder recursively.
203     --folderrec    str  : and this one, etc.
204
205     --folderfirst  str  : Sync this folder first. Ex. --folderfirst "INBOX"
206     --folderfirst  str  : then this one, etc.
207     --folderlast   str  : Sync this folder last. --folderlast "[Gmail]/All Mail"
208     --folderlast   str  : then this one, etc.
209
210     --nomixfolders      : Do not merge folders when host1 is case-sensitive
211                           while host2 is not (like Exchange). Only the first
212                           similar folder is synced (example: with folders
213                           "Sent", "SENT" and "sent"
214                           on host1 only "Sent" will be synced to host2).
215
216     --skipemptyfolders  : Empty host1 folders are not created on host2.
217
218     --include      reg  : Sync folders matching this regular expression
219     --include      reg  : or this one, etc.
220                           If both --include --exclude options are used, then
221                           include is done before.
222     --exclude      reg  : Skips folders matching this regular expression
223                           Several folders to avoid:
224                            --exclude 'fold1|fold2|f3' skips fold1, fold2 and f3.
225     --exclude      reg  : or this one, etc.
226
227     --automap           : guesses folders mapping, for folders well known as
228                           "Sent", "Junk", "Drafts", "All", "Archive", "Flagged".
229
230     --f1f2    str1=str2 : Force folder str1 to be synced to str2,
231                           --f1f2 overrides --automap and --regextrans2.
232
233     --subfolder2   str  : Syncs the whole host1 folders hierarchy under the
234                           host2 folder named str.
235                           It does it internally by adding three
236                           --regextrans2 options before all others.
237                           Add --debug to see what's really going on.
238
239     --subfolder1   str  : Syncs the host1 folders hierarchy which is under folder
240                           str to the root hierarchy of host2.
241                           It's the couterpart of a sync done by --subfolder2
242                           when doing it in the reverse order.
243                           Backup/Restore scenario:
244                           Use --subfolder2 str for a backup to the folder str
245                           on host2. Then use --subfolder1 str for restoring
246                           from the folder str, after inverting
247                           host1/host2 user1/user2 values.
248
249
250     --subscribed        : Transfers subscribed folders.
251     --subscribe         : Subscribe to the folders transferred on the
252                           host2 that are subscribed on host1. On by default.
253     --subscribeall      : Subscribe to the folders transferred on the
254                           host2 even if they are not subscribed on host1.
255
256     --prefix1      str  : Remove prefix str to all destination folders,
257                           usually "INBOX." or "INBOX/" or an empty string "".
258                           imapsync guesses the prefix if host1 imap server
259                           does not have NAMESPACE capability. So this option
260                           should not be used most of the time.
261     --prefix2      str  : Add prefix to all host2 folders. See --prefix1
262
263     --sep1         str  : Host1 separator. This option should not be used
264                           most of the time.
265                           Imapsync gets the separator from the server itself,
266                           by using NAMESPACE, or it tries to guess it
267                           from the folders listing (it counts
268                           characters / . \\ \ in folder names and choose the
269                           more frequent, or finally / if nothing is found.
270     --sep2         str  : Host2 separator. See --sep1
271
272     --regextrans2  reg  : Apply the whole regex to each destination folders.
273     --regextrans2  reg  : and this one. etc.
274                           When you play with the --regextrans2 option, first
275                           add also the safe options --dry --justfolders
276                           Then, when happy, remove --dry for a run, then
277                           remove --justfolders for the next ones.
278                           Have in mind that --regextrans2 is applied after
279                           the automatic prefix and separator inversion.
280                           For examples see:
281                           https://imapsync.lamiral.info/FAQ.d/FAQ.Folders_Mapping.txt
282
283  OPTIONS/folders sizes
284
285     --nofoldersizes     : Do not calculate the size of each folder at the
286                           beginning of the sync. Default is to calculate them.
287     --nofoldersizesatend: Do not calculate the size of each folder at the
288                           end of the sync. Default is to calculate them.
289     --justfoldersizes   : Exit after having printed the initial folder sizes.
290
291  OPTIONS/tmp
292
293     --tmpdir       str  : Where to store temporary files and subdirectories.
294                           Will be created if it doesn't exist.
295                           Default is system specific, Unix is /tmp but
296                           /tmp is often too small and deleted at reboot.
297                           --tmpdir /var/tmp should be better.
298     --pidfile      str  : The file where imapsync pid is written,
299                           it can be dirname/filename.
300                           Default name is imapsync.pid in tmpdir.
301     --pidfilelocking    : Abort if pidfile already exists. Useful to avoid
302                           concurrent transfers on the same mailbox.
303
304  OPTIONS/log
305
306     --nolog             : Turn off logging on file
307     --logfile      str  : Change the default log filename (can be dirname/filename).
308     --logdir       str  : Change the default log directory. Default is LOG_imapsync/
309
310    The default logfile name is for example
311
312     LOG_imapsync/2019_12_22_23_57_59_532_user1_user2.txt
313
314    where:
315
316     2019_12_22_23_57_59_532 is nearly the date of the start
317     YYYY_MM_DD_HH_MM_SS_mmm
318     year_month_day_hour_minute_seconde_millisecond
319
320    and user1 user2 are the --user1 --user2 values.
321
322  OPTIONS/messages
323
324     --skipmess     reg  : Skips messages matching the regex.
325                           Example: 'm/[\x80-ff]/' # to avoid 8bits messages.
326                           --skipmess is applied before --regexmess
327     --skipmess     reg  : or this one, etc.
328
329     --skipcrossduplicates : Avoid copying messages that are already copied
330                             in another folder,  good from Gmail to X when
331                             X is not also Gmail.
332                             Activated with --gmail1 unless --noskipcrossduplicates
333
334     --debugcrossduplicates : Prints which messages (UIDs) are skipped with
335                              --skipcrossduplicates (and in what other folders
336                              they are).
337
338     --pipemess     cmd  : Apply this cmd command to each message content
339                           before the copy.
340     --pipemess     cmd  : and this one, etc.
341                           With several --pipemess, the output of each cmd
342                           command (STDOUT) is given to the input (STDIN)
343                           of the next command.
344                           For example,
345                           --pipemess cmd1 --pipemess cmd2 --pipemess cmd3
346                           is like a Unix pipe:
347                           "cat message | cmd1 | cmd2 | cmd3"
348
349     --disarmreadreceipts : Disarms read receipts (host2 Exchange issue)
350
351     --regexmess    reg  : Apply the whole regex to each message before transfer.
352                           Example: 's/\000/ /g' # to replace null by space.
353     --regexmess    reg  : and this one, etc.
354
355  OPTIONS/labels
356
357    Gmail present labels as folders in imap. Imapsync can accelerate the
358    sync by syncing X-GM-LABELS, it will avoid to transfer messages when
359    they are already on host2.
360
361     --synclabels        : Syncs also Gmail labels when a message is copied to host2.
362                           Activated by default with --gmail1 --gmail2 unless
363                           --nosynclabels is added.
364
365     --resynclabels      : Resyncs Gmail labels when a message is already on host2.
366                           Activated by default with --gmail1 --gmail2 unless
367                           --noresynclabels is added.
368
369    For Gmail syncs, see also:
370    https://imapsync.lamiral.info/FAQ.d/FAQ.Gmail.txt
371
372  OPTIONS/flags
373
374     If you encounter flag problems see also:
375     https://imapsync.lamiral.info/FAQ.d/FAQ.Flags.txt
376
377     --regexflag    reg  : Apply the whole regex to each flags list.
378                           Example: 's/"Junk"//g' # to remove "Junk" flag.
379     --regexflag    reg  : then this one, etc.
380
381     --resyncflags       : Resync flags for already transferred messages.
382                           On by default.
383     --noresyncflags     : Do not resync flags for already transferred messages.
384                           May be useful when a user has already started to play
385                           with its host2 account.
386
387  OPTIONS/deletions
388
389     --delete1           : Deletes messages on host1 server after a successful
390                           transfer. Option --delete1 has the following behavior:
391                           it marks messages as deleted with the IMAP flag
392                           \Deleted, then messages are really deleted with an
393                           EXPUNGE IMAP command. If expunging after each message
394                           slows down too much the sync then use
395                           --noexpungeaftereach to speed up, expunging will then be
396                           done only twice per folder, one at the beginning and
397                           one at the end of a folder sync.
398
399     --expunge1          : Expunge messages on host1 just before syncing a folder.
400                           Expunge is done per folder.
401                           Expunge aims is to really delete messages marked deleted.
402                           An expunge is also done after each message copied
403                           if option --delete1 is set (unless --noexpungeaftereach).
404
405     --noexpunge1        : Do not expunge messages on host1.
406
407     --delete1emptyfolders : Deletes empty folders on host1, INBOX excepted.
408                             Useful with --delete1 since what remains on host1
409                             is only what failed to be synced.
410
411     --delete2           : Delete messages in host2 that are not in
412                           host1 server. Useful for backup or pre-sync.
413                           --delete2 implies --uidexpunge2
414
415     --delete2duplicates : Delete messages in host2 that are duplicates.
416                           Works only without --useuid since duplicates are
417                           detected with an header part of each message.
418
419     --delete2folders    : Delete folders in host2 that are not in host1 server.
420                           For safety, first try it like this (it is safe):
421                           --delete2folders --dry --justfolders --nofoldersizes
422                           and see what folders will be deleted.
423
424     --delete2foldersonly   reg : Delete only folders matching the regex reg.
425                                  Example: --delete2foldersonly "/^Junk$|^INBOX.Junk$/"
426                                  This option activates --delete2folders
427
428     --delete2foldersbutnot reg : Do not delete folders matching the regex rex.
429                                  Example: --delete2foldersbutnot "/Tasks$|Contacts$|Foo$/"
430                                  This option activates --delete2folders
431
432     --noexpunge2        : Do not expunge messages on host2.
433     --nouidexpunge2     : Do not uidexpunge messages on the host2 account
434                           that are not on the host1 account.
435
436  OPTIONS/dates
437
438     If you encounter problems with dates, see also:
439     https://imapsync.lamiral.info/FAQ.d/FAQ.Dates.txt
440
441     --syncinternaldates : Sets the internal dates on host2 same as host1.
442                           Turned on by default. Internal date is the date
443                           a message arrived on a host (Unix mtime).
444     --idatefromheader   : Sets the internal dates on host2 same as the
445                           ones in "Date:" headers.
446
447  OPTIONS/message selection
448
449     --maxsize      int  : Skip messages larger  (or equal) than  int  bytes
450     --minsize      int  : Skip messages smaller (or equal) than  int  bytes
451     --maxage       int  : Skip messages older than  int days.
452                           final stats (skipped) don't count older messages
453                           see also --minage
454     --minage       int  : Skip messages newer than  int  days.
455                           final stats (skipped) don't count newer messages
456                           You can do (+ zone are the messages selected):
457                           past|----maxage+++++++++++++++>now
458                           past|+++++++++++++++minage---->now
459                           past|----maxage+++++minage---->now (intersection)
460                           past|++++minage-----maxage++++>now (union)
461
462     --search       str  : Selects only messages returned by this IMAP SEARCH
463                           command. Applied on both sides.
464                           For a complete set of what can be search see
465                           https://imapsync.lamiral.info/FAQ.d/FAQ.Messages_Selection.txt
466
467     --search1      str  : Same as --search but for selecting host1 messages only.
468     --search2      str  : Same as --search but for selecting host2 messages only.
469                           So --search CRIT equals --search1 CRIT --search2 CRIT
470
471     --maxlinelength int : skip messages with a line length longer than  int  bytes.
472                           RFC 2822 says it must be no more than 1000 bytes but
473                           real life servers and email clients do more.
474
475
476     --useheader    str  : Use this header to compare messages on both sides.
477                           Ex: Message-ID or Subject or Date.
478     --useheader    str    and this one, etc.
479
480     --usecache          : Use cache to speed up next syncs. Not set by default.
481     --nousecache        : Do not use cache. Caveat: --useuid --nousecache creates
482                           duplicates on multiple runs.
483     --useuid            : Use UIDs instead of headers as a criterion to recognize
484                           messages. Option --usecache is then implied unless
485                           --nousecache is used.
486
487  OPTIONS/miscellaneous
488
489     --syncacls          : Synchronizes acls (Access Control Lists).
490                           Acls in IMAP are not standardized, be careful
491                           since one acl code on one side may signify something
492                           else on the other one.
493     --nosyncacls        : Does not synchronize acls. This is the default.
494
495     --addheader         : When a message has no headers to be identified,
496                           --addheader adds a "Message-Id" header,
497                           like "Message-Id: 12345@imapsync", where 12345
498                           is the imap UID of the message on the host1 folder.
499
500  OPTIONS/debugging
501
502     --debug             : Debug mode.
503     --debugfolders      : Debug mode for the folders part only.
504     --debugcontent      : Debug content of the messages transferred. Huge output.
505     --debugflags        : Debug mode for flags.
506     --debugimap1        : IMAP debug mode for host1. Very verbose.
507     --debugimap2        : IMAP debug mode for host2. Very verbose.
508     --debugimap         : IMAP debug mode for host1 and host2. Twice very verbose.
509     --debugmemory       : Debug mode showing memory consumption after each copy.
510
511     --errorsmax     int : Exit when int number of errors is reached. Default is 50.
512
513     --tests             : Run local non-regression tests. Exit code 0 means all ok.
514     --testslive         : Run a live test with test1.lamiral.info imap server.
515                           Useful to check the basics. Needs internet connection.
516     --testslive6        : Run a live test with ks2ipv6.lamiral.info imap server.
517                           Useful to check the ipv6 connectivity. Needs internet.
518
519  OPTIONS/specific
520
521      --gmail1           : sets --host1 to Gmail and other options. See FAQ.Gmail.txt
522      --gmail2           : sets --host2 to Gmail and other options. See FAQ.Gmail.txt
523
524      --office1          : sets --host1 to Office365 and other options. See FAQ.Exchange.txt
525      --office2          : sets --host2 to Office365 and other options. See FAQ.Exchange.txt
526
527      --exchange1        : sets options for Exchange. See FAQ.Exchange.txt
528      --exchange2        : sets options for Exchange. See FAQ.Exchange.txt
529
530      --domino1          : sets options for Domino. See FAQ.Domino.txt
531      --domino2          : sets options for Domino. See FAQ.Domino.txt
532
533  OPTIONS/behavior
534
535     --maxmessagespersecond int : limits the number of messages transferred per second.
536
537     --maxbytespersecond int : limits the average transfer rate per second.
538     --maxbytesafter     int : starts --maxbytespersecond limitation only after
539                               --maxbytesafter amount of data transferred.
540
541     --maxsleep      int : do not sleep more than int seconds.
542                           On by default, 2 seconds max, like --maxsleep 2
543
544     --abort             : terminates a previous call still running.
545                           It uses the pidfile to know what process to abort.
546
547     --exitwhenover int  : Stop syncing and exits when int total bytes
548                           transferred is reached.
549
550     --version           : Print only software version.
551     --noreleasecheck    : Do not check for any new imapsync release.
552     --releasecheck      : Check for new imapsync release.
553                           it's an http request to
554                           http://imapsync.lamiral.info/prj/imapsync/VERSION
555
556     --noid              : Do not send/receive ID command to imap servers.
557
558     --justconnect       : Just connect to both servers and print useful
559                           information. Need only --host1 and --host2 options.
560                           Obsolete since "imapsync --host1 imaphost" alone
561                           implies --justconnect
562
563     --justlogin         : Just login to both host1 and host2 with users
564                           credentials, then exit.
565
566     --justfolders       : Do only things about folders (ignore messages).
567
568     --help              : print this help.
569
570     Example: to synchronize imap account "test1" on "test1.lamiral.info"
571                         to  imap account "test2" on "test2.lamiral.info"
572                         with test1 password "secret1"
573                         and  test2 password "secret2"
574
575     imapsync \
576        --host1 test1.lamiral.info --user1 test1 --password1 secret1 \
577        --host2 test2.lamiral.info --user2 test2 --password2 secret2
578
579SECURITY
580
581    You can use --passfile1 instead of --password1 to give the password
582    since it is safer. With --password1 option, on Linux, any user on your
583    host can see the password by using the 'ps auxwwww' command. Using a
584    variable (like IMAPSYNC_PASSWORD1) is also dangerous because of the 'ps
585    auxwwwwe' command. So, saving the password in a well protected file (600
586    or rw-------) is the best solution.
587
588    Imapsync activates ssl or tls encryption by default, if possible.
589
590    What detailed behavior is under this "if possible"?
591
592    Imapsync activates ssl if the well known port imaps port (993) is open
593    on the imap servers. If the imaps port is closed then it open a normal
594    (clear) connection on port 143 but it looks for TLS support in the
595    CAPABILITY list of the servers. If TLS is supported then imapsync goes
596    to encryption.
597
598    If the automatic ssl and the tls detections fail then imapsync will not
599    protect against sniffing activities on the network, especially for
600    passwords.
601
602    If you want to force ssl or tls just use --ssl1 --ssl2 or --tls1 --tls2
603
604    See also the document FAQ.Security.txt in the FAQ.d/ directory or at
605    https://imapsync.lamiral.info/FAQ.d/FAQ.Security.txt
606
607EXIT STATUS
608
609    Imapsync will exit with a 0 status (return code) if everything went
610    good. Otherwise, it exits with a non-zero status. That's classical Unix
611    behavior. Here is the list of the exit code values (an integer between 0
612    and 255). The names reflect their meaning:
613
614         EX_OK          => 0  ; #/* successful termination */
615         EX_USAGE       => 64 ; #/* command line usage error */
616         EX_NOINPUT     => 66 ; #/* cannot open input */
617         EX_UNAVAILABLE => 69 ; #/* service unavailable */
618         EX_SOFTWARE    => 70 ; #/* internal software error */
619         EXIT_CATCH_ALL              =>   1 ; # Any other error
620         EXIT_BY_SIGNAL              =>   6 ; # Should be 128+n where n is the sig_num
621         EXIT_PID_FILE_ERROR         =>   8 ;
622         EXIT_CONNECTION_FAILURE     =>  10 ;
623         EXIT_TLS_FAILURE            =>  12 ;
624         EXIT_AUTHENTICATION_FAILURE =>  16 ;
625         EXIT_SUBFOLDER1_NO_EXISTS   =>  21 ;
626         EXIT_WITH_ERRORS            => 111 ;
627         EXIT_WITH_ERRORS_MAX        => 112 ;
628         EXIT_TESTS_FAILED           => 254 ; # Like Test::More API
629
630LICENSE AND COPYRIGHT
631
632    Imapsync is free, open, public but not always gratis software cover by
633    the NOLIMIT Public License, now called NLPL. See the LICENSE file
634    included in the distribution or just read this simple sentence as it IS
635    the licence text:
636
637     "No limits to do anything with this work and this license."
638
639    In case it is not long enough, I repeat:
640
641     "No limits to do anything with this work and this license."
642
643    Look at https://imapsync.lamiral.info/LICENSE
644
645AUTHOR
646
647    Gilles LAMIRAL <gilles@lamiral.info>
648
649    Good feedback is always welcome. Bad feedback is very often welcome.
650
651    Gilles LAMIRAL earns his living by writing, installing, configuring and
652    teaching free, open and often gratis software. Imapsync used to be
653    "always gratis" but now it is only "often gratis" because imapsync is
654    sold by its author, a good way to maintain and support free open public
655    software over decades.
656
657BUGS AND LIMITATIONS
658
659    See https://imapsync.lamiral.info/FAQ.d/FAQ.Reporting_Bugs.txt
660
661IMAP SERVERS supported
662
663    See https://imapsync.lamiral.info/S/imapservers.shtml
664
665HUGE MIGRATION
666
667    If you have many mailboxes to migrate think about a little shell
668    program. Write a file called file.txt (for example) containing users and
669    passwords. The separator used in this example is ';'
670
671    The file.txt file contains:
672
673    user001_1;password001_1;user001_2;password001_2
674    user002_1;password002_1;user002_2;password002_2
675    user003_1;password003_1;user003_2;password003_2
676    user004_1;password004_1;user004_2;password004_2
677    user005_1;password005_1;user005_2;password005_2 ...
678
679    On Unix the shell program can be:
680
681     { while IFS=';' read  u1 p1 u2 p2; do
682            imapsync --host1 imap.side1.org --user1 "$u1" --password1 "$p1" \
683                     --host2 imap.side2.org --user2 "$u2" --password2 "$p2" ...
684     done ; } < file.txt
685
686    On Windows the batch program can be:
687
688      FOR /F "tokens=1,2,3,4 delims=; eol=#" %%G IN (file.txt) DO imapsync ^
689      --host1 imap.side1.org --user1 %%G --password1 %%H ^
690      --host2 imap.side2.org --user2 %%I --password2 %%J ...
691
692    The ... have to be replaced by nothing or any imapsync option. Welcome
693    in shell or batch programming !
694
695    You will find already written scripts at
696    https://imapsync.lamiral.info/examples/
697
698INSTALL
699
700     Imapsync works under any Unix with Perl.
701
702     Imapsync works under most Windows (2000, XP, Vista, Seven, Eight, Ten
703     and all Server releases 2000, 2003, 2008 and R2, 2012 and R2, 2016)
704     as a standalone binary software called imapsync.exe,
705     usually launched from a batch file in order to avoid always typing
706     the options. There is also a 64bit binary called imapsync_64bit.exe
707
708     Imapsync works under OS X as a standalone binary
709     software called imapsync_bin_Darwin
710
711     Purchase latest imapsync at
712     https://imapsync.lamiral.info/
713
714     You'll receive a link to a compressed tarball called imapsync-x.xx.tgz
715     where x.xx is the version number. Untar the tarball where
716     you want (on Unix):
717
718      tar xzvf  imapsync-x.xx.tgz
719
720     Go into the directory imapsync-x.xx and read the INSTALL file.
721     As mentioned at https://imapsync.lamiral.info/#install
722     the INSTALL file can also be found at
723     https://imapsync.lamiral.info/INSTALL.d/INSTALL.ANY.txt
724     It is now split in several files for each system
725     https://imapsync.lamiral.info/INSTALL.d/
726
727CONFIGURATION
728
729    There is no specific configuration file for imapsync, everything is
730    specified by the command line parameters and the default behavior.
731
732HACKING
733
734    Feel free to hack imapsync as the NOLIMIT license permits it.
735
736SIMILAR SOFTWARE
737
738      See also https://imapsync.lamiral.info/S/external.shtml
739      for a better up to date list.
740
741    Last updated and verified on Sun Dec 8, 2019.
742
743     imapsync: https://github.com/imapsync/imapsync (this is an imapsync copy, sometimes delayed, with --noreleasecheck by default since release 1.592, 2014/05/22)
744     imap_tools: https://web.archive.org/web/20161228145952/http://www.athensfbc.com/imap_tools/. The imap_tools code is now at https://github.com/andrewnimmo/rick-sanders-imap-tools
745     imaputils: https://github.com/mtsatsenko/imaputils (very old imap_tools fork)
746     Doveadm-Sync: https://wiki2.dovecot.org/Tools/Doveadm/Sync ( Dovecot sync tool )
747     davmail: http://davmail.sourceforge.net/
748     offlineimap: http://offlineimap.org/
749     mbsync: http://isync.sourceforge.net/
750     mailsync: http://mailsync.sourceforge.net/
751     mailutil: https://www.washington.edu/imap/ part of the UW IMAP toolkit. (well, seems abandoned now)
752     imaprepl: https://bl0rg.net/software/ http://freecode.com/projects/imap-repl/
753     imapcopy (Pascal): http://www.ardiehl.de/imapcopy/
754     imapcopy (Java): https://code.google.com/archive/p/imapcopy/
755     imapsize: http://www.broobles.com/imapsize/
756     migrationtool: http://sourceforge.net/projects/migrationtool/
757     imapmigrate: http://sourceforge.net/projects/cyrus-utils/
758     larch: https://github.com/rgrove/larch (derived from wonko_imapsync, good at Gmail)
759     wonko_imapsync: http://wonko.com/article/554 (superseded by larch)
760     pop2imap: http://www.linux-france.org/prj/pop2imap/ (I wrote that too)
761     exchange-away: http://exchange-away.sourceforge.net/
762     SyncBackPro: http://www.2brightsparks.com/syncback/sbpro.html
763     ImapSyncClient: https://github.com/ridaamirini/ImapSyncClient
764     MailStore: https://www.mailstore.com/en/products/mailstore-home/
765     mnIMAPSync: https://github.com/manusa/mnIMAPSync
766     imap-upload: http://imap-upload.sourceforge.net/ (A tool for uploading a local mbox file to IMAP4 server)
767     imapbackup: https://github.com/rcarmo/imapbackup (A Python script for incremental backups of IMAP mailboxes)
768     BitRecover email-backup 99 USD, 299 USD https://www.bitrecover.com/email-backup/.
769     ImportExportTools: https://addons.thunderbird.net/en-us/thunderbird/addon/importexporttools/ ImportExportTools for Mozilla Thunderbird by Paolo Kaosmos. ImportExportTools does not do IMAP.
770
771HISTORY
772
773    I initially wrote imapsync in July 2001 because an enterprise, called
774    BaSystemes, paid me to install a new imap server without losing huge old
775    mailboxes located in a far away remote imap server, accessible by an
776    often broken low-bandwidth ISDN link.
777
778    I had to verify every mailbox was well transferred, all folders, all
779    messages, without wasting bandwidth or creating duplicates upon resyncs.
780    The imapsync design was made with the beautiful rsync command in mind.
781
782    Imapsync started its life as a patch of the copy_folder.pl script. The
783    script copy_folder.pl comes from the Mail-IMAPClient-2.1.3 perl module
784    tarball source (more precisely in the examples/ directory of the
785    Mail-IMAPClient tarball).
786
787    So many happened since then that I wonder if it remains any lines of the
788    original copy_folder.pl in imapsync source code.
789
790