From f79724c16625c642f3c1786c49684f33a99ed66a Mon Sep 17 00:00:00 2001 From: Nick Bebout Date: Sat, 12 Mar 2011 02:44:26 +0000 Subject: [PATCH] 1.175 --- CREDITS | 5 +++++ ChangeLog | 18 ++++++++++++++++-- FAQ | 9 +++++++++ INSTALL | 14 +++++++++++++- README | 10 +++++++--- RECORD | 25 ++++++++++++++++++++----- VERSION | 2 +- imapsync | 43 +++++++++++++++++++++++++++++++++---------- tests.sh | 21 ++++++++++++++++++++- 9 files changed, 124 insertions(+), 23 deletions(-) diff --git a/CREDITS b/CREDITS index fd7629a..c21a86d 100644 --- a/CREDITS +++ b/CREDITS @@ -2,6 +2,11 @@ I thank very much all of these people. +Stephen Weir +Made a successful migration from +"Scalix" to "Eudora WorldMail v2" +Gave the good option for success (see FAQ) + Kjetil Torgrim Homme Gave a jumbo patch adding --authuser diff --git a/ChangeLog b/ChangeLog index 0f8a168..5781e8d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,15 +1,29 @@ RCS file: RCS/imapsync,v Working file: imapsync -head: 1.172 +head: 1.175 branch: locks: strict access list: symbolic names: keyword substitution: kv -total revisions: 172; selected revisions: 172 +total revisions: 175; selected revisions: 175 description: ---------------------------- +revision 1.175 +date: 2006/06/08 00:52:00; author: gilles; state: Exp; lines: +28 -9 +Added --regexflag option to remove "bad" flags when needed. +---------------------------- +revision 1.174 +date: 2006/06/07 22:17:37; author: gilles; state: Exp; lines: +6 -6 +Scalix release +---------------------------- +revision 1.173 +date: 2006/05/31 11:48:24; author: gilles; state: Exp; lines: +10 -6 +Updated "IMAP SERVERS" success list: +- Added Scalix +- Added Eudora WorldMail v2 +---------------------------- revision 1.172 date: 2006/05/09 23:06:29; author: gilles; state: Exp; lines: +10 -5 Added split value 1000 by default diff --git a/FAQ b/FAQ index b39e186..a6d6e2b 100644 --- a/FAQ +++ b/FAQ @@ -30,6 +30,15 @@ Solutions: a) Don't use buggy Eudora. b) Use the --syncinternaldates option and keep using Eudora :-) + +======================================================================= +Q. imapsync failed with a "word too long" error from the imap server, + What can I do ? + +R. Use imapsync release 1.172 or at least 1.166 with options + --split1 500 --split2 500 + or a old old imapsync (before 1.94) + ======================================================================= Q. Does imapsync support IMAP over TLS (IMAPS)? diff --git a/INSTALL b/INSTALL index 7ff9463..6634321 100644 --- a/INSTALL +++ b/INSTALL @@ -1,4 +1,4 @@ -# $Id: INSTALL,v 1.9 2005/11/16 01:14:18 gilles Exp gilles $ +# $Id: INSTALL,v 1.10 2006/05/28 15:18:33 gilles Exp gilles $ # # INSTALL file for imapsync # imapsync : IMAP sync or copy tool. @@ -18,6 +18,15 @@ You need : Get Perl here: http://www.perl.org/ +- Some perl modules. To verify you have + all modules in one command, just run: + + perl -c imapsync + + The good answer is "imapsync syntax OK". + +Here is some individual module help: + - Perl Mail::IMAPClient module try : perl -mMail::IMAPClient -e '' @@ -39,6 +48,9 @@ You need : - Term::ReadKey +- IO:Socket:SSL.pm + perl -mIO::Socket::SSL -e '' + - (Option) Perl Digest::HMAC_MD5 module Good for non plain text password over network. diff --git a/README b/README index a600084..61761a2 100644 --- a/README +++ b/README @@ -2,7 +2,7 @@ NAME imapsync - IMAP synchronization, copy or migration tool. Synchronize mailboxes between two imap servers. Good at IMAP migration. - $Revision: 1.172 $ + $Revision: 1.175 $ INSTALL imapsync works fine under any Unix OS. @@ -199,8 +199,10 @@ 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/) - DBMail 1.2.1 (GPL) (http://www.dbmail.org/). 2.0.7 seems buggy. - - Dovecot 0.99.10.4 0.99.14 (LGPL) (http://www.dovecot.org/) + - Dovecot 0.99.10.4 0.99.14 0.99.14-8.fc4 (LGPL) + (http://www.dovecot.org/) - Domino (Notes) 6.5, 5.0.6, 5.0.7 + - Eudora WorldMail v2 - Groupwise IMAP (Novell). Buggy so see the FAQ. - iPlanet Messaging server 4.15, 5.1 - IMail 7.15 (Ipswitch/Win2003), 8.12 @@ -211,11 +213,13 @@ IMAP SERVERS - OpenWave - Qualcomm Worldmail (NT) - Samsung Contact IMAP server 8.5.0 + - Scalix v10.1 - SunONE Messaging server 5.2, 6.0 (SUN JES - Java Enterprise System) - UW-imap servers (imap-2000b) rijkkramer IMAP4rev1 2000.287 (RedHat uses UW like 2003.338rh) (OSI Approved) (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. Please report to the author any success or bad story with imapsync and @@ -284,5 +288,5 @@ AUTHOR teaching free open and gratis softwares. Don't hesitate to pay him for that services. - $Id: imapsync,v 1.172 2006/05/09 23:06:29 gilles Exp $ + $Id: imapsync,v 1.175 2006/06/08 00:52:00 gilles Exp $ diff --git a/RECORD b/RECORD index 25aa6dd..aa28675 100644 --- a/RECORD +++ b/RECORD @@ -1,9 +1,24 @@ ++------------------+ +| imapsync records | ++------------------+ + +You can add your own record if you want. +Here is a template. +------------------------------------------------------------------------------- +Your Name/Compagny : +Time to migrate : +Number of mailboxes : +Total size : +Comment : ------------------------------------------------------------------------------- -Olivier Morel: -Nous avons terminé notre migration et récupéré l'ensemble des boites aux lettres grace à votre outil, tout s'est déroulé à merveille (18 heures de traitement) -- 2200 Boites aux lettres -- 18 Go -- récupération via .bat +Your Name/Compagny : Olivier Morel +Time to migrate : 18 hours +Number of mailboxes : 2200 +Total size : 18 Go +Comment : Nous avons terminé notre migration et récupéré l'ensemble + des boites aux lettres grace à votre outil, tout s'est + déroulé à merveille. + diff --git a/VERSION b/VERSION index d123d31..896daa7 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.172 +1.175 diff --git a/imapsync b/imapsync index 981d306..3b965f7 100755 --- a/imapsync +++ b/imapsync @@ -6,7 +6,7 @@ imapsync - IMAP synchronization, copy or migration tool. Synchronize mailboxes between two imap servers. Good at IMAP migration. -$Revision: 1.172 $ +$Revision: 1.175 $ =head1 INSTALL @@ -228,8 +228,10 @@ 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/) - DBMail 1.2.1 (GPL) (http://www.dbmail.org/). 2.0.7 seems buggy. - - Dovecot 0.99.10.4 0.99.14 (LGPL) (http://www.dovecot.org/) + - Dovecot 0.99.10.4 0.99.14 0.99.14-8.fc4 (LGPL) + (http://www.dovecot.org/) - Domino (Notes) 6.5, 5.0.6, 5.0.7 + - Eudora WorldMail v2 - Groupwise IMAP (Novell). Buggy so see the FAQ. - iPlanet Messaging server 4.15, 5.1 - IMail 7.15 (Ipswitch/Win2003), 8.12 @@ -240,11 +242,13 @@ Success stories reported with the following imap servers - OpenWave - Qualcomm Worldmail (NT) - Samsung Contact IMAP server 8.5.0 + - Scalix v10.1 - SunONE Messaging server 5.2, 6.0 (SUN JES - Java Enterprise System) - UW-imap servers (imap-2000b) rijkkramer IMAP4rev1 2000.287 (RedHat uses UW like 2003.338rh) (OSI Approved) (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. Please report to the author any success or bad story with @@ -334,7 +338,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.172 2006/05/09 23:06:29 gilles Exp $ +$Id: imapsync,v 1.175 2006/06/08 00:52:00 gilles Exp $ =cut @@ -360,7 +364,7 @@ my( $user1, $user2, $password1, $password2, $passfile1, $passfile2, @folder, @include, @exclude, $prefix1, $prefix2, - @regextrans2, @regexmess, + @regextrans2, @regexmess, @regexflag, $sep1, $sep2, $syncinternaldates, $syncacls, $fastio1, $fastio2, @@ -391,7 +395,7 @@ my( use vars qw ($opt_G); # missing code for this will be option. -$rcs = ' $Id: imapsync,v 1.172 2006/05/09 23:06:29 gilles Exp $ '; +$rcs = ' $Id: imapsync,v 1.175 2006/06/08 00:52:00 gilles Exp $ '; $rcs =~ m/,v (\d+\.\d+)/; $VERSION = ($1) ? $1 : "UNKNOWN"; @@ -428,8 +432,8 @@ $error=0; my $banner = join("", '$RCSfile: imapsync,v $ ', - '$Revision: 1.172 $ ', - '$Date: 2006/05/09 23:06:29 $ ', + '$Revision: 1.175 $ ', + '$Date: 2006/06/08 00:52:00 $ ', "\n", "Mail::IMAPClient version used here is ", $VERSION_IMAPClient,"\n" @@ -863,6 +867,15 @@ sub to_folder_name { return($t_fold); } +sub flags_regex { + my ($flags_f) = @_; + foreach my $regexflag (@regexflag) { + $debug and print "eval \$flags_f =~ $regexflag\n"; + eval("\$flags_f =~ $regexflag"); + } + return($flags_f); +} + sub acls_sync { my($f_fold, $t_fold) = @_; if ($syncacls) { @@ -1036,6 +1049,7 @@ FOLDER: foreach my $f_fold (@f_folders) { my $flags_f = $f_hash{$m_id}{'F'} || ""; # RFC 2060 : This flag can not be altered by the client $flags_f =~ s@\\Recent@@g; + $flags_f = flags_regex($flags_f) if @regexflag; my $new_id; print "flags from : [$flags_f][$d]\n"; @@ -1075,16 +1089,21 @@ FOLDER: foreach my $f_fold (@f_folders) { @flags_f = @{$flags_f_rv} if ref($flags_f_rv); # No flag \Recent here, no ? + my $flags_f = join(" ", @flags_f); + $flags_f = flags_regex($flags_f) if @regexflag; + + # This add or change flags but no flag are removed with this $to->store($t_msg, - "+FLAGS (" . join(" ", @flags_f) . ")" + "+FLAGS (" . $flags_f . ")" ) unless ($dry) ; my $flags_t_rv = $to->flags($t_msg); @flags_t = @{$flags_t_rv} if ref($flags_t_rv); + my $flags_t = join(" ", @flags_t); $debug and print - "flags from : @flags_f\n", - "flags to : @flags_t\n"; + "flags from : $flags_f\n", + "flags to : $flags_t\n"; $debug and do { @@ -1217,6 +1236,7 @@ sub get_options "prefix2=s" => \$prefix2, "regextrans2=s" => \@regextrans2, "regexmess=s" => \@regexmess, + "regexflag=s" => \@regexflag, "delete!" => \$delete, "delete2!" => \$delete2, "syncinternaldates!" => \$syncinternaldates, @@ -1387,6 +1407,9 @@ Several options are mandatory. Exemple : 's/\\000/ /g' # to replace null by space. --regexmess : and this one. --regexmess : and this one, etc. +--regexflag : Apply the whole regex to each flags list. + Exemple : 's/\"Junk"//g' # to remove "Junk" flag. +--regexflag : and this one, etc. --sep1 : separator in case namespace is not supported. --sep2 : idem. --delete : delete messages on source imap server after diff --git a/tests.sh b/tests.sh index 618e0b2..37e6976 100644 --- a/tests.sh +++ b/tests.sh @@ -1,6 +1,6 @@ #!/bin/sh -# $Id: tests.sh,v 1.52 2006/04/02 03:32:55 gilles Exp $ +# $Id: tests.sh,v 1.53 2006/06/08 00:53:21 gilles Exp $ #### Shell pragmas @@ -685,6 +685,25 @@ flags() fi } +regex_flag() +{ + if test X`hostname` = X"plume"; then + echo3 Here is plume + + ./imapsync \ + --host2 plume --user2 tata@est.belle \ + --passfile2 /var/tmp/secret.tata \ + --host1 loul --user1 tata \ + --passfile1 /var/tmp/secret.tata \ + --folder INBOX.yop.yap \ + --dry --debug --regexflag 's/\\Answered//g' + + echo 'rm /home/vmail/tata/.yop.yap/cur/*' + else + : + fi +} + lp_ssl() { if test X`hostname` = X"plume"; then