1IMAPSYNC(1)           User Contributed Perl Documentation          IMAPSYNC(1)
2
3
4

NAME

6       imapsync - Email IMAP tool for syncing, copying, migrating and
7       archiving email mailboxes between two imap servers, one way, and
8       without duplicates.
9

VERSION

11       This documentation refers to Imapsync $Revision: 1.977 $
12

USAGE

14        To synchronize the source imap account
15          "test1" on server "test1.lamiral.info" with password "secret1"
16        to the destination imap account
17          "test2" on server "test2.lamiral.info" with password "secret2"
18        do:
19
20         imapsync \
21          --host1 test1.lamiral.info --user1 test1 --password1 secret1 \
22          --host2 test2.lamiral.info --user2 test2 --password2 secret2
23

DESCRIPTION

25       We sometimes need to transfer mailboxes from one imap server to one
26       another.
27
28       Imapsync command is a tool allowing incremental and recursive imap
29       transfers from one mailbox to another.  If you don't understand the
30       previous sentence, it's normal, it's pedantic computer oriented jargon.
31
32       All folders are transferred, recursively, meaning the whole folder
33       hierarchy is taken, all messages in them, and all messages flags (\Seen
34       \Answered \Flagged etc.)  are synced too.
35
36       Imapsync reduces the amount of data transferred by not transferring a
37       given message if it already resides on the destination side.  Messages
38       that are on the destination side but not on the source side stay as
39       they are (see the --delete2 option to have a strict sync).
40
41       How imapsync knows a message is already on both sides?  Same specific
42       headers and the transfer is done only once.  By default, the
43       identification headers are "Message-Id:" and "Received:" lines but this
44       choice can be changed with the --useheader option.
45
46       All flags are preserved, unread messages will stay unread, read ones
47       will stay read, deleted will stay deleted.
48
49       You can abort the transfer at any time and restart it later, imapsync
50       works well with bad connections and interruptions, by design. On a
51       terminal hit Ctr-c twice within two seconds in order to abort the
52       program. Hit Ctr-c just once makes imapsync reconnect to both imap
53       servers.
54
55       A classical scenario is synchronizing a mailbox B from another mailbox
56       A where you just want to keep a strict copy of A in B. Strict meaning
57       all messages in A will be in B but no more.
58
59       For this, option --delete2 has to be used, it deletes messages in host2
60       folder B that are not in host1 folder A. If you also need to destroy
61       host2 folders that are not in host1 then use --delete2folders. See also
62       --delete2foldersonly and --delete2foldersbutnot to set up exceptions on
63       folders to destroy. INBOX will never be destroy, it's a mandatory
64       folder in IMAP.
65
66       A different scenario is to delete the messages from the source mailbox
67       after a successful transfer, it can be a good feature when migrating
68       mailboxes since messages will be only on one side. The source account
69       will only have messages that are not on the destination yet, ie,
70       messages that arrived after a sync or that failed to be copied.
71
72       In that case, use the --delete1 option. Option --delete1 implies also
73       option --expunge1 so all messages marked deleted on host1 will be
74       really deleted. In IMAP protocol deleting a message does not really
75       delete it, it marks it with the flag \Deleted, allowing an undelete.
76       Expunging a folder removes, definitively, all the messages marked as
77       \Deleted in this folder.
78
79       You can also decide to remove empty folders once all of their messages
80       have been transferred. Add --delete1emptyfolders to obtain this
81       behavior.
82
83       Imapsync is not adequate for maintaining two active imap accounts in
84       synchronization when the user plays independently on both sides.  Use
85       offlineimap (written by John Goerzen) or mbsync (written by Michael R.
86       Elkins) for a 2 ways synchronization.
87

OPTIONS

89        usage: imapsync [options]
90
91       The standard options are the six values forming the credentials.  Three
92       values on each side are needed in order to log in into the IMAP
93       servers. These six values are a host, a username, and a password, two
94       times.
95
96       Conventions used in the following descriptions of the options:
97
98        str means string
99        int means integer
100        reg means regular expression
101        cmd means command
102
103        --dry               : Makes imapsync doing nothing for real, just print what
104                              would be done without --dry.
105
106   OPTIONS/credentials
107        --host1        str  : Source or "from" imap server.
108        --port1        int  : Port to connect on host1.
109                              Optional since default ports are the
110                              well known ports imap/143 or imaps/993.
111        --user1        str  : User to login on host1.
112        --password1    str  : Password for the user1.
113
114        --host2        str  : "destination" imap server.
115        --port2        int  : Port to connect on host2. Optional
116        --user2        str  : User to login on host2.
117        --password2    str  : Password for the user2.
118
119        --showpasswords     : Shows passwords on output instead of "MASKED".
120                              Useful to restart a complete run by just reading
121                              the command line used in the log,
122                              or to debug passwords.
123                              It's not a secure practice at all.
124
125        --passfile1    str  : Password file for the user1. It must contain the
126                              password on the first line. This option avoids showing
127                              the password on the command line like --password1 does.
128        --passfile2    str  : Password file for the user2.
129
130       You can also pass the passwords in the environment variables
131       IMAPSYNC_PASSWORD1 and IMAPSYNC_PASSWORD2
132
133   OPTIONS/encryption
134        --nossl1            : Do not use a SSL connection on host1.
135        --ssl1              : Use a SSL connection on host1. On by default if possible.
136
137        --nossl2            : Do not use a SSL connection on host2.
138        --ssl2              : Use a SSL connection on host2. On by default if possible.
139
140        --notls1            : Do not use a TLS connection on host1.
141        --tls1              : Use a TLS connection on host1. On by default if possible.
142
143        --notls2            : Do not use a TLS connection on host2.
144        --tls2              : Use a TLS connection on host2. On by default if possible.
145
146        --debugssl     int  : SSL debug mode from 0 to 4.
147
148        --sslargs1     str  : Pass any ssl parameter for host1 ssl or tls connection. Example:
149                              --sslargs1 SSL_verify_mode=1 --sslargs1 SSL_version=SSLv3
150                              See all possibilities in the new() method of IO::Socket::SSL
151                              http://search.cpan.org/perldoc?IO::Socket::SSL#Description_Of_Methods
152        --sslargs2     str  : Pass any ssl parameter for host2 ssl or tls connection.
153                              See --sslargs1
154
155        --timeout1     int  : Connection timeout in seconds for host1.
156                              Default is 120 and 0 means no timeout at all.
157        --timeout2     int  : Connection timeout in seconds for host2.
158                              Default is 120 and 0 means no timeout at all.
159
160   OPTIONS/authentication
161        --authmech1    str  : Auth mechanism to use with host1:
162                              PLAIN, LOGIN, CRAM-MD5 etc. Use UPPERCASE.
163        --authmech2    str  : Auth mechanism to use with host2. See --authmech1
164
165        --authuser1    str  : User to auth with on host1 (admin user).
166                              Avoid using --authmech1 SOMETHING with --authuser1.
167        --authuser2    str  : User to auth with on host2 (admin user).
168        --proxyauth1        : Use proxyauth on host1. Requires --authuser1.
169                              Required by Sun/iPlanet/Netscape IMAP servers to
170                              be able to use an administrative user.
171        --proxyauth2        : Use proxyauth on host2. Requires --authuser2.
172
173        --authmd51          : Use MD5 authentication for host1.
174        --authmd52          : Use MD5 authentication for host2.
175        --domain1      str  : Domain on host1 (NTLM authentication).
176        --domain2      str  : Domain on host2 (NTLM authentication).
177
178   OPTIONS/folders
179        --folder       str  : Sync this folder.
180        --folder       str  : and this one, etc.
181        --folderrec    str  : Sync this folder recursively.
182        --folderrec    str  : and this one, etc.
183
184        --folderfirst  str  : Sync this folder first. Ex. --folderfirst "INBOX"
185        --folderfirst  str  : then this one, etc.
186        --folderlast   str  : Sync this folder last. --folderlast "[Gmail]/All Mail"
187        --folderlast   str  : then this one, etc.
188
189        --nomixfolders      : Do not merge folders when host1 is case-sensitive
190                              while host2 is not (like Exchange). Only the first
191                              similar folder is synced (example: with folders
192                              "Sent", "SENT" and "sent"
193                              on host1 only "Sent" will be synced to host2).
194
195        --skipemptyfolders  : Empty host1 folders are not created on host2.
196
197        --include      reg  : Sync folders matching this regular expression
198        --include      reg  : or this one, etc.
199                              If both --include --exclude options are used, then
200                              include is done before.
201        --exclude      reg  : Skips folders matching this regular expression
202                              Several folders to avoid:
203                               --exclude 'fold1|fold2|f3' skips fold1, fold2 and f3.
204        --exclude      reg  : or this one, etc.
205
206        --automap           : guesses folders mapping, for folders well known as
207                              "Sent", "Junk", "Drafts", "All", "Archive", "Flagged".
208
209        --f1f2    str1=str2 : Force folder str1 to be synced to str2,
210                              --f1f2 overrides --automap and --regextrans2.
211
212        --subfolder2   str  : Syncs the whole host1 folders hierarchy under the
213                              host2 folder named str.
214                              It does it internally by adding three
215                              --regextrans2 options before all others.
216                              Add --debug to see what's really going on.
217
218        --subfolder1   str  : Syncs the host1 folders hierarchy which is under folder
219                              str to the root hierarchy of host2.
220                              It's the couterpart of a sync done by --subfolder2
221                              when doing it in the reverse order.
222                              Backup/Restore scenario:
223                              Use --subfolder2 str for a backup to the folder str
224                              on host2. Then use --subfolder1 str for restoring
225                              from the folder str, after inverting
226                              host1/host2 user1/user2 values.
227
228
229        --subscribed        : Transfers subscribed folders.
230        --subscribe         : Subscribe to the folders transferred on the
231                              host2 that are subscribed on host1. On by default.
232        --subscribeall      : Subscribe to the folders transferred on the
233                              host2 even if they are not subscribed on host1.
234
235        --prefix1      str  : Remove prefix str to all destination folders,
236                              usually "INBOX." or "INBOX/" or an empty string "".
237                              imapsync guesses the prefix if host1 imap server
238                              does not have NAMESPACE capability. So this option
239                              should not be used most of the time.
240        --prefix2      str  : Add prefix to all host2 folders. See --prefix1
241
242        --sep1         str  : Host1 separator. This option should not be used
243                              most of the time.
244                              Imapsync gets the separator from the server itself,
245                              by using NAMESPACE, or it tries to guess it
246                              from the folders listing (it counts
247                              characters / . \\ \ in folder names and choose the
248                              more frequent, or finally / if nothing is found.
249        --sep2         str  : Host2 separator. See --sep1
250
251        --regextrans2  reg  : Apply the whole regex to each destination folders.
252        --regextrans2  reg  : and this one. etc.
253                              When you play with the --regextrans2 option, first
254                              add also the safe options --dry --justfolders
255                              Then, when happy, remove --dry for a run, then
256                              remove --justfolders for the next ones.
257                              Have in mind that --regextrans2 is applied after
258                              the automatic prefix and separator inversion.
259                              For examples see:
260                              https://imapsync.lamiral.info/FAQ.d/FAQ.Folders_Mapping.txt
261
262   OPTIONS/folders sizes
263        --nofoldersizes     : Do not calculate the size of each folder at the
264                              beginning of the sync. Default is to calculate them.
265        --nofoldersizesatend: Do not calculate the size of each folder at the
266                              end of the sync. Default is to calculate them.
267        --justfoldersizes   : Exit after having printed the initial folder sizes.
268
269   OPTIONS/tmp
270        --tmpdir       str  : Where to store temporary files and subdirectories.
271                              Will be created if it doesn't exist.
272                              Default is system specific, Unix is /tmp but
273                              /tmp is often too small and deleted at reboot.
274                              --tmpdir /var/tmp should be better.
275        --pidfile      str  : The file where imapsync pid is written,
276                              it can be dirname/filename.
277                              Default name is imapsync.pid in tmpdir.
278        --pidfilelocking    : Abort if pidfile already exists. Useful to avoid
279                              concurrent transfers on the same mailbox.
280
281   OPTIONS/log
282        --nolog             : Turn off logging on file
283        --logfile      str  : Change the default log filename (can be dirname/filename).
284        --logdir       str  : Change the default log directory. Default is LOG_imapsync/
285
286       The default logfile name is for example
287
288        LOG_imapsync/2019_12_22_23_57_59_532_user1_user2.txt
289
290       where:
291
292        2019_12_22_23_57_59_532 is nearly the date of the start
293        YYYY_MM_DD_HH_MM_SS_mmm
294        year_month_day_hour_minute_seconde_millisecond
295
296       and user1 user2 are the --user1 --user2 values.
297
298   OPTIONS/messages
299        --skipmess     reg  : Skips messages matching the regex.
300                              Example: 'm/[\x80-ff]/' # to avoid 8bits messages.
301                              --skipmess is applied before --regexmess
302        --skipmess     reg  : or this one, etc.
303
304        --skipcrossduplicates : Avoid copying messages that are already copied
305                                in another folder,  good from Gmail to X when
306                                X is not also Gmail.
307                                Activated with --gmail1 unless --noskipcrossduplicates
308
309        --debugcrossduplicates : Prints which messages (UIDs) are skipped with
310                                 --skipcrossduplicates (and in what other folders
311                                 they are).
312
313        --pipemess     cmd  : Apply this cmd command to each message content
314                              before the copy.
315        --pipemess     cmd  : and this one, etc.
316                              With several --pipemess, the output of each cmd
317                              command (STDOUT) is given to the input (STDIN)
318                              of the next command.
319                              For example,
320                              --pipemess cmd1 --pipemess cmd2 --pipemess cmd3
321                              is like a Unix pipe:
322                              "cat message | cmd1 | cmd2 | cmd3"
323
324        --disarmreadreceipts : Disarms read receipts (host2 Exchange issue)
325
326        --regexmess    reg  : Apply the whole regex to each message before transfer.
327                              Example: 's/\000/ /g' # to replace null by space.
328        --regexmess    reg  : and this one, etc.
329
330   OPTIONS/labels
331       Gmail present labels as folders in imap. Imapsync can accelerate the
332       sync by syncing X-GM-LABELS, it will avoid to transfer messages when
333       they are already on host2.
334
335        --synclabels        : Syncs also Gmail labels when a message is copied to host2.
336                              Activated by default with --gmail1 --gmail2 unless
337                              --nosynclabels is added.
338
339        --resynclabels      : Resyncs Gmail labels when a message is already on host2.
340                              Activated by default with --gmail1 --gmail2 unless
341                              --noresynclabels is added.
342
343       For Gmail syncs, see also:
344       https://imapsync.lamiral.info/FAQ.d/FAQ.Gmail.txt
345
346   OPTIONS/flags
347        If you encounter flag problems see also:
348        https://imapsync.lamiral.info/FAQ.d/FAQ.Flags.txt
349
350        --regexflag    reg  : Apply the whole regex to each flags list.
351                              Example: 's/"Junk"//g' # to remove "Junk" flag.
352        --regexflag    reg  : then this one, etc.
353
354        --resyncflags       : Resync flags for already transferred messages.
355                              On by default.
356        --noresyncflags     : Do not resync flags for already transferred messages.
357                              May be useful when a user has already started to play
358                              with its host2 account.
359
360   OPTIONS/deletions
361        --delete1           : Deletes messages on host1 server after a successful
362                              transfer. Option --delete1 has the following behavior:
363                              it marks messages as deleted with the IMAP flag
364                              \Deleted, then messages are really deleted with an
365                              EXPUNGE IMAP command. If expunging after each message
366                              slows down too much the sync then use
367                              --noexpungeaftereach to speed up, expunging will then be
368                              done only twice per folder, one at the beginning and
369                              one at the end of a folder sync.
370
371        --expunge1          : Expunge messages on host1 just before syncing a folder.
372                              Expunge is done per folder.
373                              Expunge aims is to really delete messages marked deleted.
374                              An expunge is also done after each message copied
375                              if option --delete1 is set (unless --noexpungeaftereach).
376
377        --noexpunge1        : Do not expunge messages on host1.
378
379        --delete1emptyfolders : Deletes empty folders on host1, INBOX excepted.
380                                Useful with --delete1 since what remains on host1
381                                is only what failed to be synced.
382
383        --delete2           : Delete messages in host2 that are not in
384                              host1 server. Useful for backup or pre-sync.
385                              --delete2 implies --uidexpunge2
386
387        --delete2duplicates : Delete messages in host2 that are duplicates.
388                              Works only without --useuid since duplicates are
389                              detected with an header part of each message.
390
391        --delete2folders    : Delete folders in host2 that are not in host1 server.
392                              For safety, first try it like this (it is safe):
393                              --delete2folders --dry --justfolders --nofoldersizes
394                              and see what folders will be deleted.
395
396        --delete2foldersonly   reg : Delete only folders matching the regex reg.
397                                     Example: --delete2foldersonly "/^Junk$|^INBOX.Junk$/"
398                                     This option activates --delete2folders
399
400        --delete2foldersbutnot reg : Do not delete folders matching the regex rex.
401                                     Example: --delete2foldersbutnot "/Tasks$|Contacts$|Foo$/"
402                                     This option activates --delete2folders
403
404        --noexpunge2        : Do not expunge messages on host2.
405        --nouidexpunge2     : Do not uidexpunge messages on the host2 account
406                              that are not on the host1 account.
407
408   OPTIONS/dates
409        If you encounter problems with dates, see also:
410        https://imapsync.lamiral.info/FAQ.d/FAQ.Dates.txt
411
412        --syncinternaldates : Sets the internal dates on host2 same as host1.
413                              Turned on by default. Internal date is the date
414                              a message arrived on a host (Unix mtime).
415        --idatefromheader   : Sets the internal dates on host2 same as the
416                              ones in "Date:" headers.
417
418   OPTIONS/message selection
419        --maxsize      int  : Skip messages larger  (or equal) than  int  bytes
420        --minsize      int  : Skip messages smaller (or equal) than  int  bytes
421        --maxage       int  : Skip messages older than  int days.
422                              final stats (skipped) don't count older messages
423                              see also --minage
424        --minage       int  : Skip messages newer than  int  days.
425                              final stats (skipped) don't count newer messages
426                              You can do (+ zone are the messages selected):
427                              past|----maxage+++++++++++++++>now
428                              past|+++++++++++++++minage---->now
429                              past|----maxage+++++minage---->now (intersection)
430                              past|++++minage-----maxage++++>now (union)
431
432        --search       str  : Selects only messages returned by this IMAP SEARCH
433                              command. Applied on both sides.
434                              For a complete set of what can be search see
435                              https://imapsync.lamiral.info/FAQ.d/FAQ.Messages_Selection.txt
436
437        --search1      str  : Same as --search but for selecting host1 messages only.
438        --search2      str  : Same as --search but for selecting host2 messages only.
439                              So --search CRIT equals --search1 CRIT --search2 CRIT
440
441        --maxlinelength int : skip messages with a line length longer than  int  bytes.
442                              RFC 2822 says it must be no more than 1000 bytes but
443                              real life servers and email clients do more.
444
445
446        --useheader    str  : Use this header to compare messages on both sides.
447                              Ex: Message-ID or Subject or Date.
448        --useheader    str    and this one, etc.
449
450        --usecache          : Use cache to speed up next syncs. Not set by default.
451        --nousecache        : Do not use cache. Caveat: --useuid --nousecache creates
452                              duplicates on multiple runs.
453        --useuid            : Use UIDs instead of headers as a criterion to recognize
454                              messages. Option --usecache is then implied unless
455                              --nousecache is used.
456
457   OPTIONS/miscellaneous
458        --syncacls          : Synchronizes acls (Access Control Lists).
459                              Acls in IMAP are not standardized, be careful
460                              since one acl code on one side may signify something
461                              else on the other one.
462        --nosyncacls        : Does not synchronize acls. This is the default.
463
464        --addheader         : When a message has no headers to be identified,
465                              --addheader adds a "Message-Id" header,
466                              like "Message-Id: 12345@imapsync", where 12345
467                              is the imap UID of the message on the host1 folder.
468
469   OPTIONS/debugging
470        --debug             : Debug mode.
471        --debugfolders      : Debug mode for the folders part only.
472        --debugcontent      : Debug content of the messages transferred. Huge output.
473        --debugflags        : Debug mode for flags.
474        --debugimap1        : IMAP debug mode for host1. Very verbose.
475        --debugimap2        : IMAP debug mode for host2. Very verbose.
476        --debugimap         : IMAP debug mode for host1 and host2. Twice very verbose.
477        --debugmemory       : Debug mode showing memory consumption after each copy.
478
479        --errorsmax     int : Exit when int number of errors is reached. Default is 50.
480
481        --tests             : Run local non-regression tests. Exit code 0 means all ok.
482        --testslive         : Run a live test with test1.lamiral.info imap server.
483                              Useful to check the basics. Needs internet connection.
484        --testslive6        : Run a live test with ks2ipv6.lamiral.info imap server.
485                              Useful to check the ipv6 connectivity. Needs internet.
486
487   OPTIONS/specific
488         --gmail1           : sets --host1 to Gmail and other options. See FAQ.Gmail.txt
489         --gmail2           : sets --host2 to Gmail and other options. See FAQ.Gmail.txt
490
491         --office1          : sets --host1 to Office365 and other options. See FAQ.Exchange.txt
492         --office2          : sets --host2 to Office365 and other options. See FAQ.Exchange.txt
493
494         --exchange1        : sets options for Exchange. See FAQ.Exchange.txt
495         --exchange2        : sets options for Exchange. See FAQ.Exchange.txt
496
497         --domino1          : sets options for Domino. See FAQ.Domino.txt
498         --domino2          : sets options for Domino. See FAQ.Domino.txt
499
500   OPTIONS/behavior
501        --maxmessagespersecond int : limits the number of messages transferred per second.
502
503        --maxbytespersecond int : limits the average transfer rate per second.
504        --maxbytesafter     int : starts --maxbytespersecond limitation only after
505                                  --maxbytesafter amount of data transferred.
506
507        --maxsleep      int : do not sleep more than int seconds.
508                              On by default, 2 seconds max, like --maxsleep 2
509
510        --abort             : terminates a previous call still running.
511                              It uses the pidfile to know what process to abort.
512
513        --exitwhenover int  : Stop syncing and exits when int total bytes
514                              transferred is reached.
515
516        --version           : Print only software version.
517        --noreleasecheck    : Do not check for any new imapsync release.
518        --releasecheck      : Check for new imapsync release.
519                              it's an http request to
520                              http://imapsync.lamiral.info/prj/imapsync/VERSION
521
522        --noid              : Do not send/receive ID command to imap servers.
523
524        --justconnect       : Just connect to both servers and print useful
525                              information. Need only --host1 and --host2 options.
526                              Obsolete since "imapsync --host1 imaphost" alone
527                              implies --justconnect
528
529        --justlogin         : Just login to both host1 and host2 with users
530                              credentials, then exit.
531
532        --justfolders       : Do only things about folders (ignore messages).
533
534        --help              : print this help.
535
536        Example: to synchronize imap account "test1" on "test1.lamiral.info"
537                            to  imap account "test2" on "test2.lamiral.info"
538                            with test1 password "secret1"
539                            and  test2 password "secret2"
540
541        imapsync \
542           --host1 test1.lamiral.info --user1 test1 --password1 secret1 \
543           --host2 test2.lamiral.info --user2 test2 --password2 secret2
544

SECURITY

546       You can use --passfile1  instead of --password1 to give the password
547       since it is safer. With --password1 option, on Linux, any user on your
548       host can see the password by using the 'ps auxwwww' command. Using a
549       variable (like IMAPSYNC_PASSWORD1) is also dangerous because of the 'ps
550       auxwwwwe' command. So, saving the password in a well protected file
551       (600 or rw-------) is the best solution.
552
553       Imapsync activates ssl or tls encryption by default, if possible.
554
555       What detailed behavior is under this "if possible"?
556
557       Imapsync activates ssl if the well known port imaps port (993) is open
558       on the imap servers. If the imaps port is closed then it open a normal
559       (clear) connection on port 143 but it looks for TLS support in the
560       CAPABILITY list of the servers. If TLS is supported then imapsync goes
561       to encryption.
562
563       If the automatic ssl and the tls detections fail then imapsync will not
564       protect against sniffing activities on the network, especially for
565       passwords.
566
567       If you want to force ssl or tls just use --ssl1 --ssl2 or --tls1 --tls2
568
569       See also the document FAQ.Security.txt in the FAQ.d/ directory or at
570       https://imapsync.lamiral.info/FAQ.d/FAQ.Security.txt
571

EXIT STATUS

573       Imapsync will exit with a 0 status (return code) if everything went
574       good.  Otherwise, it exits with a non-zero status. That's classical
575       Unix behavior.  Here is the list of the exit code values (an integer
576       between 0 and 255).  The names reflect their meaning:
577
578            EX_OK          => 0  ; #/* successful termination */
579            EX_USAGE       => 64 ; #/* command line usage error */
580            EX_NOINPUT     => 66 ; #/* cannot open input */
581            EX_UNAVAILABLE => 69 ; #/* service unavailable */
582            EX_SOFTWARE    => 70 ; #/* internal software error */
583            EXIT_CATCH_ALL              =>   1 ; # Any other error
584            EXIT_BY_SIGNAL              =>   6 ; # Should be 128+n where n is the sig_num
585            EXIT_PID_FILE_ERROR         =>   8 ;
586            EXIT_CONNECTION_FAILURE     =>  10 ;
587            EXIT_TLS_FAILURE            =>  12 ;
588            EXIT_AUTHENTICATION_FAILURE =>  16 ;
589            EXIT_SUBFOLDER1_NO_EXISTS   =>  21 ;
590            EXIT_WITH_ERRORS            => 111 ;
591            EXIT_WITH_ERRORS_MAX        => 112 ;
592            EXIT_TESTS_FAILED           => 254 ; # Like Test::More API
593
595       Imapsync is free, open, public but not always gratis software cover by
596       the NOLIMIT Public License, now called NLPL.  See the LICENSE file
597       included in the distribution or just read this simple sentence as it IS
598       the licence text:
599
600        "No limits to do anything with this work and this license."
601
602       In case it is not long enough, I repeat:
603
604        "No limits to do anything with this work and this license."
605
606       Look at https://imapsync.lamiral.info/LICENSE
607

AUTHOR

609       Gilles LAMIRAL <gilles@lamiral.info>
610
611       Good feedback is always welcome.  Bad feedback is very often welcome.
612
613       Gilles LAMIRAL earns his living by writing, installing, configuring and
614       teaching free, open and often gratis software. Imapsync used to be
615       "always gratis" but now it is only "often gratis" because imapsync is
616       sold by its author, a good way to maintain and support free open public
617       software over decades.
618

BUGS AND LIMITATIONS

620       See https://imapsync.lamiral.info/FAQ.d/FAQ.Reporting_Bugs.txt
621

IMAP SERVERS supported

623       See https://imapsync.lamiral.info/S/imapservers.shtml
624

HUGE MIGRATION

626       If you have many mailboxes to migrate think about a little shell
627       program. Write a file called file.txt (for example) containing users
628       and passwords.  The separator used in this example is ';'
629
630       The file.txt file contains:
631
632       user001_1;password001_1;user001_2;password001_2
633       user002_1;password002_1;user002_2;password002_2
634       user003_1;password003_1;user003_2;password003_2
635       user004_1;password004_1;user004_2;password004_2
636       user005_1;password005_1;user005_2;password005_2 ...
637
638       On Unix the shell program can be:
639
640        { while IFS=';' read  u1 p1 u2 p2; do
641               imapsync --host1 imap.side1.org --user1 "$u1" --password1 "$p1" \
642                        --host2 imap.side2.org --user2 "$u2" --password2 "$p2" ...
643        done ; } < file.txt
644
645       On Windows the batch program can be:
646
647         FOR /F "tokens=1,2,3,4 delims=; eol=#" %%G IN (file.txt) DO imapsync ^
648         --host1 imap.side1.org --user1 %%G --password1 %%H ^
649         --host2 imap.side2.org --user2 %%I --password2 %%J ...
650
651       The ... have to be replaced by nothing or any imapsync option.  Welcome
652       in shell or batch programming !
653
654       You will find already written scripts at
655       https://imapsync.lamiral.info/examples/
656

INSTALL

658        Imapsync works under any Unix with Perl.
659
660        Imapsync works under most Windows (2000, XP, Vista, Seven, Eight, Ten
661        and all Server releases 2000, 2003, 2008 and R2, 2012 and R2, 2016)
662        as a standalone binary software called imapsync.exe,
663        usually launched from a batch file in order to avoid always typing
664        the options. There is also a 64bit binary called imapsync_64bit.exe
665
666        Imapsync works under OS X as a standalone binary
667        software called imapsync_bin_Darwin
668
669        Purchase latest imapsync at
670        https://imapsync.lamiral.info/
671
672        You'll receive a link to a compressed tarball called imapsync-x.xx.tgz
673        where x.xx is the version number. Untar the tarball where
674        you want (on Unix):
675
676         tar xzvf  imapsync-x.xx.tgz
677
678        Go into the directory imapsync-x.xx and read the INSTALL file.
679        As mentioned at https://imapsync.lamiral.info/#install
680        the INSTALL file can also be found at
681        https://imapsync.lamiral.info/INSTALL.d/INSTALL.ANY.txt
682        It is now split in several files for each system
683        https://imapsync.lamiral.info/INSTALL.d/
684

CONFIGURATION

686       There is no specific configuration file for imapsync, everything is
687       specified by the command line parameters and the default behavior.
688

HACKING

690       Feel free to hack imapsync as the NOLIMIT license permits it.
691

SIMILAR SOFTWARE

693         See also https://imapsync.lamiral.info/S/external.shtml
694         for a better up to date list.
695
696       Last updated and verified on Sun Dec 8, 2019.
697
698        imapsync: https://github.com/imapsync/imapsync (this is an imapsync copy, sometimes delayed, with --noreleasecheck by default since release 1.592, 2014/05/22)
699        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
700        imaputils: https://github.com/mtsatsenko/imaputils (very old imap_tools fork)
701        Doveadm-Sync: https://wiki2.dovecot.org/Tools/Doveadm/Sync ( Dovecot sync tool )
702        davmail: http://davmail.sourceforge.net/
703        offlineimap: http://offlineimap.org/
704        mbsync: http://isync.sourceforge.net/
705        mailsync: http://mailsync.sourceforge.net/
706        mailutil: https://www.washington.edu/imap/ part of the UW IMAP toolkit. (well, seems abandoned now)
707        imaprepl: https://bl0rg.net/software/ http://freecode.com/projects/imap-repl/
708        imapcopy (Pascal): http://www.ardiehl.de/imapcopy/
709        imapcopy (Java): https://code.google.com/archive/p/imapcopy/
710        imapsize: http://www.broobles.com/imapsize/
711        migrationtool: http://sourceforge.net/projects/migrationtool/
712        imapmigrate: http://sourceforge.net/projects/cyrus-utils/
713        larch: https://github.com/rgrove/larch (derived from wonko_imapsync, good at Gmail)
714        wonko_imapsync: http://wonko.com/article/554 (superseded by larch)
715        pop2imap: http://www.linux-france.org/prj/pop2imap/ (I wrote that too)
716        exchange-away: http://exchange-away.sourceforge.net/
717        SyncBackPro: http://www.2brightsparks.com/syncback/sbpro.html
718        ImapSyncClient: https://github.com/ridaamirini/ImapSyncClient
719        MailStore: https://www.mailstore.com/en/products/mailstore-home/
720        mnIMAPSync: https://github.com/manusa/mnIMAPSync
721        imap-upload: http://imap-upload.sourceforge.net/ (A tool for uploading a local mbox file to IMAP4 server)
722        imapbackup: https://github.com/rcarmo/imapbackup (A Python script for incremental backups of IMAP mailboxes)
723        BitRecover email-backup 99 USD, 299 USD https://www.bitrecover.com/email-backup/.
724        ImportExportTools: https://addons.thunderbird.net/en-us/thunderbird/addon/importexporttools/ ImportExportTools for Mozilla Thunderbird by Paolo Kaosmos. ImportExportTools does not do IMAP.
725

HISTORY

727       I initially wrote imapsync in July 2001 because an enterprise, called
728       BaSystemes, paid me to install a new imap server without losing huge
729       old mailboxes located in a far away remote imap server, accessible by
730       an often broken low-bandwidth ISDN link.
731
732       I had to verify every mailbox was well transferred, all folders, all
733       messages, without wasting bandwidth or creating duplicates upon
734       resyncs. The imapsync design was made with the beautiful rsync command
735       in mind.
736
737       Imapsync started its life as a patch of the copy_folder.pl script. The
738       script copy_folder.pl comes from the Mail-IMAPClient-2.1.3 perl module
739       tarball source (more precisely in the examples/ directory of the Mail-
740       IMAPClient tarball).
741
742       So many happened since then that I wonder if it remains any lines of
743       the original copy_folder.pl in imapsync source code.
744
745
746
747perl v5.22.1                      2019-12-23                       IMAPSYNC(1)
Impressum