diff --git a/CREDITS b/CREDITS index caa75b6..016ab50 100644 --- a/CREDITS +++ b/CREDITS @@ -1,5 +1,11 @@ #!/bin/cat +Christoph Nagelreiter +Christoph ran imapsync to migrate from +Microsoft MCIS to Cyrus IMAP. +16000 mailboxes, 15 GB. +Will he succeed ? + Ivan Zilic Schmidt Made me start the FAQ. Suggested the --regextrans2 option. diff --git a/ChangeLog b/ChangeLog index 7784afb..6227712 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,15 +1,28 @@ RCS file: RCS/imapsync,v Working file: imapsync -head: 1.91 +head: 1.94 branch: locks: strict + gilles: 1.94 access list: symbolic names: keyword substitution: kv -total revisions: 91; selected revisions: 91 +total revisions: 94; selected revisions: 94 description: ---------------------------- +revision 1.94 locked by: gilles; +date: 2004/06/15 03:42:56; author: gilles; state: Exp; lines: +13 -6 +Added time stat +---------------------------- +revision 1.93 +date: 2004/06/14 23:13:55; author: gilles; state: Exp; lines: +18 -11 +Added stats about messages transfered and messages skipped +---------------------------- +revision 1.92 +date: 2004/05/29 02:23:14; author: gilles; state: Exp; lines: +17 -13 +Updated usage() +---------------------------- revision 1.91 date: 2004/04/07 18:51:24; author: gilles; state: Exp; lines: +7 -6 - Expunging the destination server is commented. diff --git a/README b/README index 32798ac..4f885d7 100644 --- a/README +++ b/README @@ -2,14 +2,14 @@ NAME imapsync - IMAP sync or copy tool. Synchronize mailboxes between two imap servers. - $Revision: 1.91 $ + $Revision: 1.94 $ INSTALL imapsync works fine under any Unix OS. imapsync works fine under Windows 2000 (at least) and ActiveState's 5.8 Perl Get imapsync at - http://www.linux-france.org/prj/imapsync/dist/ + http://www.linux-france.org/prj/imapsync/dist/ You'll find a compressed tarball called imapsync-x.xx.tgz where x.xx is the version number. Untar the tarball where @@ -229,5 +229,5 @@ AUTHOR teaching free open and gratis softwares. Don't hesitate to pay him for that services. - $Id: imapsync,v 1.91 2004/04/07 18:51:24 gilles Exp $ + $Id: imapsync,v 1.94 2004/06/15 03:42:56 gilles Exp gilles $ diff --git a/VERSION b/VERSION index 0573181..c25d22e 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.91 +1.94 diff --git a/imapsync b/imapsync index f9656f8..25df767 100755 --- a/imapsync +++ b/imapsync @@ -2,9 +2,10 @@ =head1 NAME -imapsync - IMAP sync or copy tool. Synchronize mailboxes between two imap servers. +imapsync - IMAP sync or copy tool. Synchronize mailboxes +between two imap servers. -$Revision: 1.91 $ +$Revision: 1.94 $ =head1 INSTALL @@ -12,7 +13,7 @@ $Revision: 1.91 $ imapsync works fine under Windows 2000 (at least) and ActiveState's 5.8 Perl Get imapsync at - http://www.linux-france.org/prj/imapsync/dist/ + http://www.linux-france.org/prj/imapsync/dist/ You'll find a compressed tarball called imapsync-x.xx.tgz where x.xx is the version number. Untar the tarball where @@ -144,8 +145,9 @@ Gilles LAMIRAL lamiral@linux-france.org =head1 LICENSE -imapsync is free, gratis and open source software cover by the GNU General -Public License. See the GPL file included in the distribution or the web site +imapsync is free, gratis and open source software cover by +the GNU General Public License. See the GPL file included in +the distribution or the web site http://www.gnu.org/licenses/licenses.html =head1 BUGS @@ -166,10 +168,10 @@ this problem is by using options --skipheader and imapsync ... --skipheader '^X-.*' --skipsize -Flags : with some IMAP servers the flags are not very well copied the -first time. Run imapsync twice if you want the flags set correctly. -(fixed since 1.28 release but wait for a time before removing those -lines) +Flags : with some IMAP servers the flags are not very well +copied the first time. Run imapsync twice if you want the +flags set correctly. (fixed since 1.28 release but wait for +a time before removing those lines) Report any bugs to the author: lamiral@linux-france.org @@ -269,7 +271,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.91 2004/04/07 18:51:24 gilles Exp $ +$Id: imapsync,v 1.94 2004/06/15 03:42:56 gilles Exp gilles $ =cut @@ -301,13 +303,16 @@ my( $mess_size_total_trans, $mess_size_total_skipped, $mess_size_total_error, + $mess_trans, $mess_skipped, $timeout, # whr (ESS/PRW) + $timestart, $timeend, $timediff, + ); use vars qw ($opt_G); # missing code for this will be option. -$rcs = ' $Id: imapsync,v 1.91 2004/04/07 18:51:24 gilles Exp $ '; +$rcs = ' $Id: imapsync,v 1.94 2004/06/15 03:42:56 gilles Exp gilles $ '; $rcs =~ m/,v (\d+\.\d+)/; $VERSION = ($1) ? $1 : "UNKNOWN"; @@ -319,6 +324,7 @@ $md5_supported = md5_supported(); $mess_size_total_trans = 0; $mess_size_total_skipped = 0; $mess_size_total_error = 0; +$mess_trans = $mess_skipped = 0; sub md5_supported { @@ -343,8 +349,8 @@ $error=0; my $banner = join("", '$RCSfile: imapsync,v $ ', - '$Revision: 1.91 $ ', - '$Date: 2004/04/07 18:51:24 $ ', + '$Revision: 1.94 $ ', + '$Date: 2004/06/15 03:42:56 $ ', "\n", "Mail::IMAPClient version used here is ", $VERSION_IMAPClient, " auth md5 : $md5_supported", @@ -392,7 +398,7 @@ unless ($md5_supported) { print "Auth $authmech supported by IMAPClient $VERSION_IMAPClient\n"; } - +$timestart = time(); $debugimap and print "From connection\n"; $from = login_imap($host1, $port1, $user1, $password1, $debugimap, $timeout); @@ -673,12 +679,14 @@ FOLDER: foreach my $f_fold (@f_folders) { # UIDPLUS capability else just a ref print "Copied msg id [$f_msg] to folder $t_fold msg id [$new_id]\n"; $mess_size_total_trans += $f_size; + $mess_trans += 1; } } next MESS; }else{ $debug and print "Message id [$m_id] found in t:$t_fold\n"; $mess_size_total_skipped += $f_size; + $mess_skipped += 1; } #$debug and print "MESSAGE $m_id\n"; @@ -730,12 +738,19 @@ FOLDER: foreach my $f_fold (@f_folders) { } } +$timeend = time(); + +$timediff = $timeend - $timestart; + stats(); exit(1) if($error); sub stats { print "++++ Statistics ++++\n"; + print "Time : $timediff sec\n"; + print "Messages transfered : $mess_trans\n"; + print "Messages skipped : $mess_skipped\n"; print "Total bytes transfered : $mess_size_total_trans\n"; print "Total bytes skipped : $mess_size_total_skipped\n"; print "Total bytes error : $mess_size_total_error\n"; @@ -879,15 +894,18 @@ Several options are mandatory. --regextrans2 : Apply the whole regex to each destination folders. --sep1 : separator in case namespace is not supported. --sep2 : idem. ---delete : delete messages in "from" imap server after - a successful transfert. useful in case you +--delete : delete messages in source imap server after + a successful transfert. Useful in case you want to migrate from one server to another one. With imap, delete tags messages as deleted, they are not really deleted. See expunge. ---expunge : expunge messages on both account. - expunge delete messages marked deleted. - expunge is made at the begining so newly - transfered messages won't be expunged. +--expunge : expunge messages on source account. + expunge really deletes messages marked deleted. + expunge is made at the begining on the + source server only. newly transfered messages + are expunged if option --expunge is given. + no expunge is done on destination account but + it will change in future releases. --syncinternaldates : set the internal dates on host2 same as host1 --maxsize : skip messages larger than bytes --maxage : skip messages older than days. diff --git a/tests.sh b/tests.sh index a6eb914..05f1ae2 100644 --- a/tests.sh +++ b/tests.sh @@ -1,8 +1,14 @@ #!/bin/sh -# $Id: tests.sh,v 1.17 2004/04/07 18:13:29 gilles Exp $ +# $Id: tests.sh,v 1.19 2004/06/15 03:42:16 gilles Exp gilles $ # $Log: tests.sh,v $ +# Revision 1.19 2004/06/15 03:42:16 gilles +# success on bigtransfer() +# +# Revision 1.18 2004/06/14 23:03:41 gilles +# Added big_transfert() +# # Revision 1.17 2004/04/07 18:13:29 gilles # Added lp_regextrans2() # @@ -420,7 +426,20 @@ bad_host() } - +big_transfert() +{ + date1=`date` + { ./imapsync \ + --host1 louloutte --user1 gilles \ + --passfile1 /var/tmp/secret \ + --host2 plume --user2 tete@est.belle \ + --passfile2 /var/tmp/secret.tete \ + --subscribed || \ + true + } + date2=`date` + echo3 $date1 $date2 +} # mandatory tests