diff --git a/CREDITS b/CREDITS index 924285d..7d189a3 100644 --- a/CREDITS +++ b/CREDITS @@ -1,7 +1,33 @@ #!/bin/cat +If you want to make a donation to the author, Gilles LAMIRAL, +you can use the imapsync wishlist : +http://www.amazon.com/gp/registry/wishlist/1C9UNDIH3P7R7/ +(Use the lowest postal cost) + I thank very much all of these people. +Daniel Ammann +Made me finally write the --folderrec option. + +Nicola De Marco +Had authenticate problems with PLAIN +and gave me a donation with the imapsync wishlist. + +Arunav Mandal +Success ? +from Domino IMAP4 Server Release 7.0.2 +to Scalix IMAP server 10.0.1.3 + +Eric Yellin +Failure from Imail 7.04 (not sure) + +Barry W. Hickey +Success from Microsoft Exchange 5.5 to Zimbra 4.0.4 + +Damjan Perenic +Success from cyrus to notes. + Tom Allison Had problem with dovecot and dbmail Message-Id Message-ID. So imapsync is diff --git a/ChangeLog b/ChangeLog index e83a562..a62e620 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,17 +1,35 @@ RCS file: RCS/imapsync,v Working file: imapsync -head: 1.190 +head: 1.194 branch: locks: strict - gilles: 1.190 access list: symbolic names: keyword substitution: kv -total revisions: 190; selected revisions: 190 +total revisions: 194; selected revisions: 194 description: ---------------------------- -revision 1.190 locked by: gilles; +revision 1.194 +date: 2006/12/08 04:04:34; author: gilles; state: Exp; lines: +22 -12 +Added --folderrec option +Now --folder --subscribed and --folderrec can be +used simultaneously. +---------------------------- +revision 1.193 +date: 2006/12/08 03:29:14; author: gilles; state: Exp; lines: +8 -8 +Replace PLAIN with LOGIN +---------------------------- +revision 1.192 +date: 2006/12/04 13:57:45; author: gilles; state: Exp; lines: +10 -9 +Added imap server releases +---------------------------- +revision 1.191 +date: 2006/11/11 22:11:25; author: gilles; state: Exp; lines: +7 -7 +imap servers section +DBMail 2.2rc1 +---------------------------- +revision 1.190 date: 2006/11/11 00:13:15; author: gilles; state: Exp; lines: +10 -6 Be case inseitive with header keywords. ---------------------------- diff --git a/FAQ b/FAQ index fe42149..719903d 100644 --- a/FAQ +++ b/FAQ @@ -335,10 +335,15 @@ Q. I need to migrate 1250 mailboxes from one cyrus-IMAP server to another (empty) one. (Box-swap). The passwords are in a MySQL Database. Can you tell me if your script suits my needs? -Partially, mailboxes must exist before running imapsync. +R. Partially, mailboxes must exist before running imapsync. May be, Box-swap is not listed in "Failure stories" nor "Success stories" in the README file. You have to extract user and password in a csv file. See the "HUGE MIGRATION" section in the README file. +====================================================================== +Q. From Cyrus to Notes + +Juhu! --useheader 'Message-ID' --skipsize does wonders! :) + diff --git a/README b/README index b1e6171..920f617 100644 --- a/README +++ b/README @@ -3,7 +3,7 @@ NAME Synchronise mailboxes between two imap servers. Good at IMAP migration. More than 25 different IMAP server softwares supported with success. - $Revision: 1.190 $ + $Revision: 1.194 $ INSTALL imapsync works fine under any Unix OS. @@ -37,6 +37,7 @@ SYNOPSIS [--authmech1 ] [--authmech2 ] [--noauthmd5] [--folder --folder ...] + [--folderrec --folderrec ...] [--include ] [--exclude ] [--prefix2 ] [--prefix1 ] [--regextrans2 --regextrans2 ...] @@ -187,6 +188,7 @@ IMAP SERVERS - DBMail 2.0.7 (GPL). But DBMail 1.2.1 works. Patient and confident testers are welcome. - dkimap4 2.39 + - Imail 7.04 (maybe). Success stories reported with the following imap servers (softwares names are in alphabetic order) : @@ -200,24 +202,24 @@ IMAP SERVERS 2.2.1, 2.2.2-BETA, 2.2.10, 2.2.12, 2.3-alpha (OSI Approved) (http://asg.web.cmu.edu/cyrus/) - David Tobit V8 (proprietary Message system). - - DBMail 1.2.1, 2.0.4, 2.0.9 (GPL) (http://www.dbmail.org/). + - DBMail 1.2.1, 2.0.4, 2.0.9, 2.2rc1 (GPL) (http://www.dbmail.org/). 2.0.7 seems buggy. - - Dovecot 0.99.10.4 0.99.14 0.99.14-8.fc4 1.0-0.beta2.7 (LGPL) + - Dovecot 0.99.10.4, 0.99.14, 0.99.14-8.fc4, 1.0-0.beta2.7 (LGPL) (http://www.dovecot.org/) - - Domino (Notes) 6.5, 5.0.6, 5.0.7 + - Domino (Notes) 6.5, 5.0.6, 5.0.7, 7.0.2, 6.0.2CF1 - Eudora WorldMail v2 - Groupwise IMAP (Novell) 6.x and 7.0. Buggy so see the FAQ. - iPlanet Messaging server 4.15, 5.1, 5.2 - IMail 7.15 (Ipswitch/Win2003), 8.12 - MDaemon 7.0.1, 8.1 - - MS Exchange Server 5.5 + - Microsoft Exchange Server 5.5 - Netscape Mail Server 3.6 (Wintel !) - Netscape Messaging Server 4.15 Patch 7 - OpenWave - Qualcomm Worldmail (NT) - Rockliffe Mailsite 5.3.11 - Samsung Contact IMAP server 8.5.0 - - Scalix v10.1 + - Scalix v10.1, 10.0.1.3 - SunONE Messaging server 5.2, 6.0 (SUN JES - Java Enterprise System) - Surgemail 3.6f5-5 - UW-imap servers (imap-2000b) rijkkramer IMAP4rev1 2000.287 @@ -225,7 +227,7 @@ IMAP SERVERS (http://www.washington.edu/imap/) - UW - QMail v2.1 - Imap part of TCP/IP suite of VMS 7.3.2 - - Zimbra-IMAP 3.0.1 GA 160, 3.1.0 Build 279. + - Zimbra-IMAP 3.0.1 GA 160, 3.1.0 Build 279, 5.5. Please report to the author any success or bad story with imapsync and don't forget to mention the IMAP server software names and version on @@ -293,5 +295,5 @@ AUTHOR teaching free open and gratis softwares. Don't hesitate to pay him for that services. - $Id: imapsync,v 1.190 2006/11/11 00:13:15 gilles Exp gilles $ + $Id: imapsync,v 1.194 2006/12/08 04:04:34 gilles Exp $ diff --git a/TODO b/TODO index 0877433..5bac4fb 100644 --- a/TODO +++ b/TODO @@ -1,6 +1,10 @@ TODO file for imapsync ---------------------- +Try a 50Mo message transfer (slow ?) + +Add a best practice migration tips document, +good options with such imap server. Add "output to reflect everything that imapsync was doing". Not everything but flag synchronization will be nice" @@ -18,8 +22,6 @@ problem is encountered. Post on newsgroup comp.mail.imap when a new release comes. http://groups.google.fr/group/comp.mail.imap -Add my amazon wishlist link. - Read the IMAP RFC http://www.faqs.org/rfcs/rfc3501.html Add debian packaging in the Makefile. @@ -39,6 +41,8 @@ http://asg.web.cmu.edu/cyrus/download/imapd/altnamespace.html Explain expunge behavior. +DONE. Add my amazon wishlist link. + DONE. Remove file rfc2342.txt "IMAP4 Namespace" DONE. Add an --exactsync option to remove target messages @@ -69,6 +73,7 @@ to talk about imapsync DONE. Add a --recurse option when --folder option is used. No I won't since this feature can be done by doing a --include '^INBOX.MyFolder' +Yes done with --folderrec Done. Look at comp.mail.imap http://groups.google.fr/groups?q=imapsync In fact I set up an google alert on imapsync so I read diff --git a/VERSION b/VERSION index 20f5666..325d030 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.190 +1.194 diff --git a/freshmeat_submition.out b/freshmeat_submition.out index ba9a0eb..6ca1dfc 100644 --- a/freshmeat_submition.out +++ b/freshmeat_submition.out @@ -1,9 +1,9 @@ Project: imapsync -Version: 1.188 -Release-Focus: Code cleanup +Version: 1.190 +Release-Focus: Minor bugfixes Hide: Y Home-Page-URL: http://www.linux-france.org/prj/imapsync/ Gzipped-Tar-URL: http://www.linux-france.org/prj/imapsync/dist/ -Updated documentation and tests +Bug fix: be case insensitive with header keywords. diff --git a/imapsync b/imapsync index 10e3576..ec30043 100755 --- a/imapsync +++ b/imapsync @@ -7,7 +7,7 @@ tool. Synchronise mailboxes between two imap servers. Good at IMAP migration. More than 25 different IMAP server softwares supported with success. -$Revision: 1.190 $ +$Revision: 1.194 $ =head1 INSTALL @@ -43,6 +43,7 @@ $Revision: 1.190 $ [--authmech1 ] [--authmech2 ] [--noauthmd5] [--folder --folder ...] + [--folderrec --folderrec ...] [--include ] [--exclude ] [--prefix2 ] [--prefix1 ] [--regextrans2 --regextrans2 ...] @@ -216,6 +217,7 @@ Failure stories reported with the following imap servers : - DBMail 2.0.7 (GPL). But DBMail 1.2.1 works. Patient and confident testers are welcome. - dkimap4 2.39 + - Imail 7.04 (maybe). Success stories reported with the following imap servers (softwares names are in alphabetic order) : @@ -229,24 +231,24 @@ Success stories reported with the following imap servers 2.2.1, 2.2.2-BETA, 2.2.10, 2.2.12, 2.3-alpha (OSI Approved) (http://asg.web.cmu.edu/cyrus/) - David Tobit V8 (proprietary Message system). - - DBMail 1.2.1, 2.0.4, 2.0.9 (GPL) (http://www.dbmail.org/). + - DBMail 1.2.1, 2.0.4, 2.0.9, 2.2rc1 (GPL) (http://www.dbmail.org/). 2.0.7 seems buggy. - - Dovecot 0.99.10.4 0.99.14 0.99.14-8.fc4 1.0-0.beta2.7 (LGPL) + - Dovecot 0.99.10.4, 0.99.14, 0.99.14-8.fc4, 1.0-0.beta2.7 (LGPL) (http://www.dovecot.org/) - - Domino (Notes) 6.5, 5.0.6, 5.0.7 + - Domino (Notes) 6.5, 5.0.6, 5.0.7, 7.0.2, 6.0.2CF1 - Eudora WorldMail v2 - Groupwise IMAP (Novell) 6.x and 7.0. Buggy so see the FAQ. - iPlanet Messaging server 4.15, 5.1, 5.2 - IMail 7.15 (Ipswitch/Win2003), 8.12 - MDaemon 7.0.1, 8.1 - - MS Exchange Server 5.5 + - Microsoft Exchange Server 5.5 - Netscape Mail Server 3.6 (Wintel !) - Netscape Messaging Server 4.15 Patch 7 - OpenWave - Qualcomm Worldmail (NT) - Rockliffe Mailsite 5.3.11 - Samsung Contact IMAP server 8.5.0 - - Scalix v10.1 + - Scalix v10.1, 10.0.1.3 - SunONE Messaging server 5.2, 6.0 (SUN JES - Java Enterprise System) - Surgemail 3.6f5-5 - UW-imap servers (imap-2000b) rijkkramer IMAP4rev1 2000.287 @@ -254,7 +256,7 @@ Success stories reported with the following imap servers (http://www.washington.edu/imap/) - UW - QMail v2.1 - Imap part of TCP/IP suite of VMS 7.3.2 - - Zimbra-IMAP 3.0.1 GA 160, 3.1.0 Build 279. + - Zimbra-IMAP 3.0.1 GA 160, 3.1.0 Build 279, 5.5. Please report to the author any success or bad story with imapsync and don't forget to mention the IMAP server @@ -343,7 +345,7 @@ Gilles LAMIRAL earn his living writing, installing, configuring and teaching free open and gratis softwares. Don't hesitate to pay him for that services. -$Id: imapsync,v 1.190 2006/11/11 00:13:15 gilles Exp gilles $ +$Id: imapsync,v 1.194 2006/12/08 04:04:34 gilles Exp $ =cut @@ -367,7 +369,7 @@ my( $rcs, $debug, $debugimap, $error, $host1, $host2, $port1, $port2, $user1, $user2, $password1, $password2, $passfile1, $passfile2, - @folder, @include, @exclude, + @folder, @include, @exclude, @folderrec, $prefix1, $prefix2, @regextrans2, @regexmess, @regexflag, $sep1, $sep2, @@ -400,7 +402,7 @@ my( use vars qw ($opt_G); # missing code for this will be option. -$rcs = ' $Id: imapsync,v 1.190 2006/11/11 00:13:15 gilles Exp gilles $ '; +$rcs = ' $Id: imapsync,v 1.194 2006/12/08 04:04:34 gilles Exp $ '; $rcs =~ m/,v (\d+\.\d+)/; $VERSION = ($1) ? $1 : "UNKNOWN"; @@ -437,8 +439,8 @@ $error=0; my $banner = join("", '$RCSfile: imapsync,v $ ', - '$Revision: 1.190 $ ', - '$Date: 2006/11/11 00:13:15 $ ', + '$Revision: 1.194 $ ', + '$Date: 2006/12/08 04:04:34 $ ', "\n", "Mail::IMAPClient version used here is ", $VERSION_IMAPClient,"\n" @@ -504,8 +506,8 @@ $user1 || missing_option("--user1"); $user2 || missing_option("--user2"); if(defined($authmd5) and not($authmd5)) { - $authmech1 ||= 'PLAIN'; - $authmech2 ||= 'PLAIN'; + $authmech1 ||= 'LOGIN'; + $authmech2 ||= 'LOGIN'; }else{ $authmech1 ||= $authuser1 ? 'PLAIN' : 'CRAM-MD5'; $authmech2 ||= $authuser2 ? 'PLAIN' : 'CRAM-MD5'; @@ -674,16 +676,23 @@ my (@f_folders, @t_folders, %fs_folders); map { $fs_folders{$_}=1 } $from->subscribed(); -if (scalar(@folder)) { +if (scalar(@folder) or $subscribed or scalar(@folderrec)) { # folders given by option --folder - @f_folders = @folder; -}elsif ($subscribed) { + push(@f_folders, @folder) if scalar(@folder); # option --subscribed - @f_folders = sort keys (%fs_folders); + push(@f_folders, sort keys (%fs_folders)) if ($subscribed); + + if (scalar(@folderrec)) { + foreach my $folderrec (@folderrec) { + push(@f_folders, $from->folders($folderrec)); + } + } + @f_folders = sort @f_folders; }else { - # no option, all folders + # no folder/subscribed/folderrec options => all folders @f_folders = sort $from->folders(); # consider (optional) includes and excludes + # WARNING the following two loops are bad with more than one pass. foreach my $include (@include) { @f_folders = grep /$include/,@f_folders; print "Only including folders matching pattern '$include'\n"; @@ -1261,6 +1270,7 @@ sub get_options "sep1=s" => \$sep1, "sep2=s" => \$sep2, "folder=s" => \@folder, + "folderrec=s" => \@folderrec, "include=s" => \@include, "exclude=s" => \@exclude, "prefix1=s" => \$prefix1, @@ -1412,8 +1422,9 @@ Several options are mandatory. --ssl1 : use an SSL connection on host1. --ssl2 : use an SSL connection on host2. --folder : sync only this folder. ---folder : and this one. --folder : and this one, etc. +--folderrec : sync only this folder recursively. +--folderrec : and this one, etc. --include : only sync folders matching this regular expression (only effective if neither --folder nor --subscribed is specified). diff --git a/patches/imapsync-base64.patch b/patches/imapsync-base64.patch new file mode 100644 index 0000000..e15ac9e --- /dev/null +++ b/patches/imapsync-base64.patch @@ -0,0 +1,12 @@ +diff -u -r imapsync-1.182/imapsync imapsync-1.182-base64-fix/imapsync +--- imapsync-1.182/imapsync 2006-08-01 16:07:42.000000000 -0700 ++++ imapsync-1.182-base64-fix/imapsync 2006-09-27 16:09:59.000000000 -0700 +@@ -635,7 +635,7 @@ + + my $string = sprintf("%s\x00%s\x00%s", $imap->User, + $imap->Authuser, $imap->Password); +- return encode_base64("$string"); ++ return encode_base64("$string", ""); + } + + diff --git a/tests.sh b/tests.sh index a9d2e38..f5623ba 100644 --- a/tests.sh +++ b/tests.sh @@ -1,6 +1,6 @@ #!/bin/sh -# $Id: tests.sh,v 1.55 2006/10/30 01:19:46 gilles Exp gilles $ +# $Id: tests.sh,v 1.56 2006/12/08 04:05:01 gilles Exp $ #### Shell pragmas @@ -117,6 +117,20 @@ ll_folder() { fi } +ll_folderrec() { + if test X`hostname` = X"plume"; then + echo3 Here is plume + ./imapsync \ + --host1 localhost --user1 tata@est.belle \ + --passfile1 /var/tmp/secret.tata \ + --host2 localhost --user2 titi@est.belle \ + --passfile2 /var/tmp/secret.titi \ + --folderrec INBOX.yop + else + : + fi +} + ll_buffersize() { @@ -819,7 +833,8 @@ test $# -eq 0 && run_tests \ ll_authmech_LOGIN \ ll_authmech_CRAMMD5 \ ll_authuser \ - ll_delete2 + ll_delete2 \ + ll_folderrec