1IMAPSYNC(1) User Contributed Perl Documentation IMAPSYNC(1)
2
3
4
6 imapsync - IMAP synchronisation, sync, copy or migration tool.
7 Synchronise mailboxes between two imap servers. Good at IMAP
8 migration. More than 36 different IMAP server softwares supported with
9 success.
10
11 $Revision: 1.456 $
12
14 To synchronise imap account "foo" on "imap.truc.org"
15 to imap account "bar" on "imap.trac.org"
16 with foo password "secret1"
17 and bar password "secret2":
18
19 imapsync \
20 --host1 imap.truc.org --user1 foo --password1 secret1 \
21 --host2 imap.trac.org --user2 bar --password2 secret2
22
24 imapsync works fine under any Unix OS with perl.
25 imapsync works fine under Windows (2000, XP)
26 with Strawberry Perl 5.10 or 5.12
27 or as a standalone binary software imapsync.exe
28
29 imapsync is already available directly on the following distributions
30 (at least): FreeBSD, Debian, Ubuntu, Gentoo, Fedora, NetBSD, Darwin,
31 Mandriva and OpenBSD.
32
33 Get imapsync at
34 http://www.linux-france.org/prj/imapsync/
35
36 You'll receive a link to a compressed tarball called imapsync-x.xx.tgz
37 where x.xx is the version number. Untar the tarball where
38 you want (on Unix):
39
40 tar xzvf imapsync-x.xx.tgz
41
42 Go into the directory imapsync-x.xx and read the INSTALL file.
43 The INSTALL file is also at
44 http://www.linux-france.org/prj/imapsync/INSTALL
45
46 The freshmeat record is at http://freshmeat.net/projects/imapsync/
47
49 imapsync [options]
50
51 To get a description of each option just run imapsync like this:
52
53 imapsync --help
54 imapsync
55
56 The option list:
57
58 imapsync [--host1 server1] [--port1 <num>]
59 [--user1 <string>] [--passfile1 <string>]
60 [--host2 server2] [--port2 <num>]
61 [--user2 <string>] [--passfile2 <string>]
62 [--ssl1] [--ssl2]
63 [--tls1] [--tls2]
64 [--authmech1 <string>] [--authmech2 <string>]
65 [--proxyauth1] [--proxyauth2]
66 [--domain1] [--domain2]
67 [--authmd51] [--authmd52]
68 [--folder <string> --folder <string> ...]
69 [--folderrec <string> --folderrec <string> ...]
70 [--include <regex>] [--exclude <regex>]
71 [--prefix2 <string>] [--prefix1 <string>]
72 [--regextrans2 <regex> --regextrans2 <regex> ...]
73 [--sep1 <char>]
74 [--sep2 <char>]
75 [--justfolders] [--justfoldersizes] [--justconnect] [--justbanner]
76 [--syncinternaldates]
77 [--idatefromheader]
78 [--syncacls]
79 [--regexmess <regex>] [--regexmess <regex>]
80 [--maxsize <int>]
81 [--minsize <int>]
82 [--maxage <int>]
83 [--minage <int>]
84 [--skipheader <regex>]
85 [--useheader <string>] [--useheader <string>]
86 [--nouid1] [--nouid2]
87 [--usecache]
88 [--skipsize] [--allowsizemismatch]
89 [--delete] [--delete2]
90 [--expunge] [--expunge1] [--expunge2] [--uidexpunge2]
91 [--delete2folders] [--delete2foldersonly] [--delete2foldersbutnot]
92 [--subscribed] [--subscribe] [--subscribe_all]
93 [--nofoldersizes]
94 [--dry]
95 [--debug] [--debugimap][--debugimap1][--debugimap2]
96 [--timeout <int>] [--fast]
97 [--split1] [--split2]
98 [--reconnectretry1 <int>] [--reconnectretry2 <int>]
99 [--noreleasecheck]
100 [--pidfile <filepath>]
101 [--tmpdir <dirpath>]
102 [--version] [--help]
103 [--tests] [--tests_debug]
104
106 The command imapsync is a tool allowing incremental and recursive imap
107 transfer from one mailbox to another.
108
109 By default all folders are transferred, recursively.
110
111 We sometimes need to transfer mailboxes from one imap server to
112 another. This is called migration.
113
114 imapsync is a good tool because it reduces the amount of data
115 transferred by not transferring a given message if it is already on
116 both sides. Same headers and the transfer is done only once. All flags
117 are preserved, unread will stay unread, read will stay read, deleted
118 will stay deleted. You can stop the transfer at any time and restart it
119 later, imapsync works well with bad connections. imapsync is CPU hungry
120 so nice and renice commands can be a good help. imapsync can be memory
121 hungry too, especially with large messages.
122
123 You can decide to delete the messages from the source mailbox after a
124 successful transfer (it is a good feature when migrating). In that
125 case, use the --delete option. Option --delete implies also option
126 --expunge so all messages marked deleted on host1 will be really
127 deleted. (you can use --noexpunge to avoid this but I don't see any
128 real world scenario for the combinaison --delete --noexpunge).
129
130 You can also just synchronize a mailbox A from another mailbox B in
131 case you just want to keep a "live" copy of B in A (--delete2 may help)
132
134 To get a description of each option just invoke:
135
136 imapsync --help
137
139 I wrote imapsync because an enterprise (basystemes) paid me to install
140 a new imap server without losing huge old mailboxes located on a far
141 away remote imap server accessible by a low bandwidth link. The tool
142 imapcp (written in python) could not help me because I had to verify
143 every mailbox was well transferred and delete it after a good transfer.
144 imapsync started life as a copy_folder.pl patch. The tool
145 copy_folder.pl comes from the Mail-IMAPClient-2.1.3 perl module tarball
146 source (in the examples/ directory of the tarball).
147
149 While working on imapsync parameters please run imapsync in dry mode
150 (no modification induced) with the --dry option. Nothing bad can be
151 done this way.
152
153 To synchronize the imap account "buddy" (with password "secret1") on
154 host "imap.src.fr" to the imap account "max" (with password "secret2")
155 on host "imap.dest.fr":
156
157 imapsync --host1 imap.src.fr --user1 buddy --password1 secret1 \
158 --host2 imap.dest.fr --user2 max --password2 secret2
159
160 Then you will have max's mailbox updated from buddy's mailbox.
161
163 You can use --passfile1 instead of --password1 to give the password
164 since it is safer. With --password1 option any user on your host can
165 see the password by using the 'ps auxwwww' command. Using a variable
166 (like $PASSWORD1) is also dangerous because of the 'ps auxwwwwe'
167 command. So, saving the password in a well protected file (600 or
168 rw-------) is the best solution.
169
170 imasync is not totally protected against sniffers on the network since
171 passwords may be transferred in plain text if CRAM-MD5 is not supported
172 by your imap servers. Use --ssl1 (or --tls1) and --ssl2 (or --tls2) to
173 enable encryption on host1 and host2.
174
175 You may authenticate as one user (typically an admin user), but be
176 authorized as someone else, which means you don't need to know every
177 user's personal password. Specify --authuser1 "adminuser" to enable
178 this on host1. In this case, --authmech1 PLAIN will be used by default
179 since it is the only way to go for now. So don't use --authmech1
180 SOMETHING with --authuser1 "adminuser", it will not work. Same
181 behavior with the --authuser2 option.
182
183 When working on Sun/iPlanet/Netscape IMAP servers you must use
184 --proxyauth1 to enable administrative user to masquerade as another
185 user. Can also be used on destination server with --proxyauth2
186
188 imapsync will exit with a 0 status (return code) if everything went
189 good. Otherwise, it exits with a non-zero status.
190
191 So if you have an unreliable internet connection, you can use this loop
192 in a Bourne shell:
193
194 while ! imapsync ...; do
195 echo imapsync not complete
196 done
197
199 imapsync is free, open source but not always gratis software cover by
200 the Do What The Fuck You Want To Public License (WTFPL). See COPYING
201 file included in the distribution or the web site
202 http://sam.zoy.org/wtfpl/COPYING
203
205 The public mailing-list may be the best way to get support.
206
207 To write on the mailing-list, the address is:
208 <imapsync@linux-france.org>
209
210 To subscribe, send any message (even empty) to:
211 <imapsync-subscribe@listes.linux-france.org> then just reply to the
212 confirmation message.
213
214 To unsubscribe, send a message to:
215 <imapsync-unsubscribe@listes.linux-france.org>
216
217 To contact the person in charge for the list:
218 <imapsync-request@listes.linux-france.org>
219
220 The list archives may be available at:
221 http://www.linux-france.org/prj/imapsync_list/ So consider that the
222 list is public, anyone can see your post. Use a pseudonym or do not
223 post to this list if you want to stay private.
224
225 Thank you for your participation.
226
228 Gilles LAMIRAL <lamiral@linux-france.org>
229
230 Feedback good or bad is always welcome.
231
232 The newsgroup comp.mail.imap may be a good place to talk about
233 imapsync. I read it when imapsync is concerned. A better place is the
234 public imapsync mailing-list (see below).
235
236 Gilles LAMIRAL earns his living writing, installing, configuring and
237 teaching free, open and often gratis softwares. Do not hesitate to pay
238 him for that services.
239
241 Help us to help you: follow the following guidelines.
242
243 Report any bugs or feature requests to the public mailing-list or to
244 the author.
245
246 Before reporting bugs, read the FAQ, the README and the TODO files.
247 http://www.linux-france.org/prj/imapsync/
248
249 Upgrade to last imapsync release, maybe the bug is already fixed.
250
251 Upgrade to last Mail-IMAPClient Perl module.
252 http://search.cpan.org/dist/Mail-IMAPClient/ maybe the bug is already
253 fixed.
254
255 Make a good title with word "imapsync" in it (my spam filter won't
256 filter it), Don't write an email title with just "imapsync" or
257 "problem", a good title is made of keywords summary, not too long (one
258 visible line).
259
260 Don't write imapsync in uppercase in the email title, we'll know you
261 run Windows and you haven't read this README yet.
262
263 Help us to help you: in your report, please include:
264
265 - imapsync version.
266
267 - output given with --debug --debugimap near the failure point.
268 Isolate a message or two in a folder 'BUG' and use
269
270 imapsync ... --folder 'BUG' --debug --debugimap
271
272 - imap server software on both side and their version number.
273
274 - imapsync with all the options you use, the full command line
275 you use (except the passwords of course).
276
277 - IMAPClient.pm version.
278
279 - the run context. Do you run imapsync.exe, a unix binary or the perl script imapsync.
280
281 - operating system running imapsync.
282
283 - virtual software context (vmware, xen etc.)
284
285 - operating systems on both sides and the third side in case
286 you run imapsync on a foreign host from the both.
287
288 Most of those values can be found as a copy/paste at the begining of
289 the output.
290
291 One time in your life, read the paper "How To Ask Questions The Smart
292 Way" http://www.catb.org/~esr/faqs/smart-questions.html and then forget
293 it.
294
296 Failure stories reported with the following 3 imap servers:
297
298 - MailEnable 1.54 (Proprietary) but MailEnable 4.23 is supported.
299 - DBMail 0.9, 2.0.7 (GPL). But DBMail 1.2.1 is supported.
300 Patient and confident testers are welcome.
301 - Imail 7.04 (maybe).
302 - (2011) MDaemon 12.0.3 as host2 but MDaemon is supported as host1.
303 MDaemon is simply buggy with the APPEND IMAP command with
304 any IMAP email client.
305
306 Success stories reported with the following 44 imap servers (software
307 names are in alphabetic order):
308
309 - 1und1 H mimap1 84498 [host1]
310 - a1.net imap.a1.net IMAP4 Ready WARSBL614 00029c23 [host1]
311 - Archiveopteryx 2.03, 2.04, 2.09, 2.10 [host2], 3.0.0 [host2]
312 (OSL 3.0) http://www.archiveopteryx.org/
313 - BincImap 1.2.3 (GPL) (http://www.bincimap.org/)
314 - CommuniGatePro server (Redhat 8.0) (Solaris), CommuniGate Pro 5.2.17[host2] (CentOS 5.4)
315 - Courier IMAP 1.5.1, 2.2.0, 2.1.1, 2.2.1, 3.0.8, 3.0.3, 4.1.1 (GPL)
316 (http://www.courier-mta.org/)
317 - Critical Path (7.0.020)
318 - Cyrus IMAP 1.5, 1.6, 2.1, 2.1.15, 2.1.16, 2.1.18
319 2.2.1, 2.2.2-BETA, 2.2.10, 2.2.12,
320 v2.2.3-Invoca-RPM-2.2.3-8,
321 2.3-alpha (OSI Approved),
322 v2.2.12-Invoca-RPM-2.2.12-3.RHEL4.1,
323 2.2.13,
324 v2.3.1-Invoca-RPM-2.3.1-2.7.fc5,
325 v2.3.7,
326 (http://asg.web.cmu.edu/cyrus/)
327 - David Tobit V8 (proprietary Message system).
328 - DBMail 1.2.1, 2.0.4, 2.0.9, 2.2rc1 (GPL) (http://www.dbmail.org/).
329 2.0.7 seems buggy.
330 - Deerfield VisNetic MailServer 5.8.6 [host1]
331 - dkimap4 [host1]
332 - Domino (Notes) 4.61[host1], 6.5[host1], 5.0.6, 5.0.7, 7.0.2, 6.0.2CF1,
333 7.0.1[host1], 8.0.1[host1], 8.5.2[host2]
334 - Dovecot 0.99.10.4, 0.99.14, 0.99.14-8.fc4, 1.0-0.beta2.7,
335 1.0.0 [dest/source] (LGPL) (http://www.dovecot.org/)
336 - Eudora WorldMail v2
337 - Gimap (Gmail imap)
338 - GMX IMAP4 StreamProxy.
339 - Groupwise IMAP (Novell) 6.x and 7.0. Buggy so see the FAQ.
340 - hMailServer 5.3.3 [host2], 4.4.1 [host1] (see FAQ)
341 - iPlanet Messaging server 4.15, 5.1, 5.2
342 - IMail 7.15 (Ipswitch/Win2003), 8.12, 11.03 [host1]
343 - Kerio 7.2.0P1 [host1]
344 - MailEnable 4.23 [host1] [host2]
345 - MDaemon 7.0.1, 8.0.2, 8.1, 9.5.4 (Windows server 2003 R2 platform), 12 [host2],
346 12.0.3 [host1]
347 - Mercury 4.1 (Windows server 2000 platform)
348 - Microsoft Exchange Server 5.5, 6.0.6249.0[host1], 6.0.6487.0[host1],
349 6.5.7638.1 [host2], 6.5 [host1], Exchange 2007 SP1 (with Update Rollup 2),
350 Exchange2007-EP-SP2,
351 Exchange 2010 RTM (Release to Manufacturing) [host2],
352 Exchange 2010 SP1 RU2[host2],
353 - Mirapoint
354 - Netscape Mail Server 3.6 (Wintel !)
355 - Netscape Messaging Server 4.15 Patch 7
356 - OpenMail IMAP server B.07.00.k0 (Samsung Contact ?)
357 - OpenWave
358 - Oracle Beehive [host1]
359 - Qualcomm Worldmail (NT)
360 - Rockliffe Mailsite 5.3.11, 4.5.6
361 - Samsung Contact IMAP server 8.5.0
362 - Scalix v10.1, 10.0.1.3, 11.0.0.431
363 - SmarterMail, Smarter Mail 5.0 Enterprise, Smarter Mail 5.5 [host1].
364 - SunONE Messaging server 5.2, 6.0 (SUN JES - Java Enterprise System)
365 - Sun Java(tm) System Messaging Server 6.2-2.05, 6.2-7.05, 6.3
366 - Surgemail 3.6f5-5
367 - UW-imap servers (imap-2000b) rijkkramer IMAP4rev1 2000.287
368 (RedHat uses UW like 2003.338rh), v12.264 Solaris 5.7 (OSI Approved)
369 (http://www.washington.edu/imap/)
370 - UW - QMail v2.1
371 - VMS, Imap part of TCP/IP suite of VMS 7.3.2
372 - Zimbra-IMAP 3.0.1 GA 160, 3.1.0 Build 279, 4.0.5, 4.5.2, 4.5.6,
373 Zimbra 5.0.24_GA_3356.RHEL4 [host1], 5.5, 6.x
374
375 Please report to the author any success or bad story with imapsync and
376 do not forget to mention the IMAP server software names and version on
377 both sides. This will help future users. To help the author maintaining
378 this section report the two lines at the begining of the output if they
379 are useful to know the softwares. Example:
380
381 Host1 software:* OK louloutte Cyrus IMAP4 v1.5.19 server ready
382 Host2 software:* OK Courier-IMAP ready
383
384 You can use option --justconnect to get those lines. Example:
385
386 imapsync --host1 imap.troc.org --host2 imap.trac.org --justconnect
387
389 Pay special attention to options --subscribed --subscribe --delete
390 --delete2 --delete2folders --expunge --expunge1 --expunge2
391 --uidexpunge2 --maxage --minage --maxsize --useheader --fast --useuid
392 --usecache
393
394 If you have many mailboxes to migrate think about a little shell
395 program. Write a file called file.csv (for example) containing users
396 and passwords. The separator used in this example is ';'
397
398 The file.csv file contains:
399
400 user001_1;password001_1;user001_2;password001_2
401 user002_1;password002_1;user002_2;password002_2
402 user003_1;password003_1;user003_2;password003_2
403 user004_1;password004_1;user004_2;password004_2
404 user005_1;password005_1;user005_2;password005_2 ...
405
406 On Unix the shell program can be:
407
408 { while IFS=';' read u1 p1 u2 p2; do
409 imapsync --host1 imap.side1.org --user1 "$u1" --password1 "$p1" \
410 --host2 imap.side2.org --user2 "$u2" --password2 "$p2" ...
411 done ; } < file.csv
412
413 On Windows the batch program can be:
414
415 FOR /F "tokens=1,2,3,4 delims=; eol=#" %%G IN (file.csv) DO imapsync ^
416 --host1 imap.side1.org --user1 %%G --password1 %%H ^
417 --host2 imap.side2.org --user2 %%I --password2 %%J ...
418
419 The ... have to be replaced by nothing or any imapsync option.
420
421 Welcome in shell programming !
422
424 Feel free to hack imapsync as the WTFPL Licence permits it.
425
427 Entries for imapsync:
428 http://www.imap.org/products/showall.php
429
431 imap_tools : http://www.athensfbc.com/imap_tools
432 offlineimap : http://software.complete.org/offlineimap
433 mailsync : http://mailsync.sourceforge.net/
434 imapxfer : http://www.washington.edu/imap/
435 part of the imap-utils from UW.
436 mailutil : replace imapxfer in
437 part of the imap-utils from UW.
438 http://www.gsp.com/cgi-bin/man.cgi?topic=mailutil
439 imaprepl : http://www.bl0rg.net/software/
440 http://freshmeat.net/projects/imap-repl/
441 imap_migrate : http://freshmeat.net/projects/imapmigration/
442 imapcopy : http://home.arcor.de/armin.diehl/imapcopy/imapcopy.html
443 migrationtool : http://sourceforge.net/projects/migrationtool/
444 imapmigrate : http://sourceforge.net/projects/cyrus-utils/
445 wonko_imapsync: http://wonko.com/article/554
446 see also tools/wonko_ruby_imapsync
447 isync : http://isync.sourceforge.net/
448 pop2imap : http://www.linux-france.org/prj/pop2imap/
449
450 Feedback (good or bad) will often be welcome.
451
452 $Id: imapsync,v 1.456 2011/08/24 04:21:30 gilles Exp gilles $
453
454
455
456perl v5.12.3 2011-08-24 IMAPSYNC(1)