diff --git a/ChangeLog b/ChangeLog index a8e7e11..421c64b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,17 +1,38 @@ RCS file: RCS/imapsync,v Working file: imapsync -head: 1.48 +head: 1.53 branch: locks: strict - gilles: 1.48 access list: symbolic names: keyword substitution: kv -total revisions: 48; selected revisions: 48 +total revisions: 53; selected revisions: 53 description: ---------------------------- -revision 1.48 locked by: gilles; +revision 1.53 +date: 2003/12/12 17:34:45; author: gilles; state: Exp; lines: +17 -6 +Added comments. +Added subscribe code. +---------------------------- +revision 1.52 +date: 2003/12/12 17:16:51; author: gilles; state: Exp; lines: +12 -4 +Use join() for the banner (less ugly). +---------------------------- +revision 1.51 +date: 2003/12/12 17:12:39; author: gilles; state: Exp; lines: +25 -9 +Updated the INSTALL pod doc. +Prepared the --subscribe option. +---------------------------- +revision 1.50 +date: 2003/12/01 16:32:15; author: gilles; state: Exp; lines: +6 -4 +Added Mail::IMAPClient::VERSION +---------------------------- +revision 1.49 +date: 2003/12/01 16:19:46; author: gilles; state: Exp; lines: +6 -6 +Updated success stories. +---------------------------- +revision 1.48 date: 2003/11/21 04:23:10; author: gilles; state: Exp; lines: +26 -4 Added "HUGE MIGRATION" pod section. (Thanks Tommi Lätti diff --git a/README b/README index b839880..828decc 100644 --- a/README +++ b/README @@ -1,13 +1,22 @@ NAME imapsync - synchronize mailboxes between two imap servers. - $Revision: 1.48 $ + $Revision: 1.53 $ INSTALL - Get imapsync at http://www.linux-france.org/prj/imapsync/dist/ - tar xzvf imapsync-x.xx.tgz # x.xx is the version number - Read the INSTALL file. - freshmeat record: http://freshmeat.net/projects/imapsync/ + Get imapsync at + 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 + you want : + + tar xzvf imapsync-x.xx.tgz + + Go into the directory imapsync-x.xx and read the INSTALL + file. + + The freshmeat record is http://freshmeat.net/projects/imapsync/ SYNOPSIS imapsync [options] @@ -121,8 +130,8 @@ BUGS IMAP SERVERS Success stories reported : - - Courier IMAP 1.5.1 - - Cyrus IMAP 1.5, 1.6, 2.1 + - Courier IMAP 1.5.1, 2.1.1 + - Cyrus IMAP 1.5, 1.6, 2.1, 2.1.15, 2.2.1 - Netscape Mail Server 3.6 (Wintel) - CommunicatePro server (Redhat 8.0) - SunONE Messaging server 5.2 @@ -157,6 +166,7 @@ HUGE MIGRATION Welcome in shell programming ! +Hacking SIMILAR SOFTWARES offlineimap : http://gopher.quux.org:70/devel/offlineimap/ mailsync : http://mailsync.sourceforge.net/ @@ -165,5 +175,5 @@ SIMILAR SOFTWARES Feedback (good or bad) will be always welcome. - $Id: imapsync,v 1.48 2003/11/21 04:23:10 gilles Exp gilles $ + $Id: imapsync,v 1.53 2003/12/12 17:34:45 gilles Exp $ diff --git a/VERSION b/VERSION index c05d912..74df8b1 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.48 +1.53 diff --git a/imapsync b/imapsync index 7e386a6..845ce12 100755 --- a/imapsync +++ b/imapsync @@ -4,14 +4,23 @@ imapsync - synchronize mailboxes between two imap servers. -$Revision: 1.48 $ +$Revision: 1.53 $ =head1 INSTALL - Get imapsync at http://www.linux-france.org/prj/imapsync/dist/ - tar xzvf imapsync-x.xx.tgz # x.xx is the version number - Read the INSTALL file. - freshmeat record: http://freshmeat.net/projects/imapsync/ + Get imapsync at + 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 + you want : + + tar xzvf imapsync-x.xx.tgz + + Go into the directory imapsync-x.xx and read the INSTALL + file. + + The freshmeat record is http://freshmeat.net/projects/imapsync/ =head1 SYNOPSIS @@ -143,8 +152,8 @@ Report any bugs to the author: lamiral@linux-france.org Success stories reported : - - Courier IMAP 1.5.1 - - Cyrus IMAP 1.5, 1.6, 2.1 + - Courier IMAP 1.5.1, 2.1.1 + - Cyrus IMAP 1.5, 1.6, 2.1, 2.1.15, 2.2.1 - Netscape Mail Server 3.6 (Wintel) - CommunicatePro server (Redhat 8.0) - SunONE Messaging server 5.2 @@ -185,6 +194,10 @@ done ; } < file.csv Welcome in shell programming ! +=head1 Hacking + + + =head1 SIMILAR SOFTWARES offlineimap : http://gopher.quux.org:70/devel/offlineimap/ @@ -194,7 +207,7 @@ Welcome in shell programming ! Feedback (good or bad) will be always welcome. -$Id: imapsync,v 1.48 2003/11/21 04:23:10 gilles Exp gilles $ +$Id: imapsync,v 1.53 2003/12/12 17:34:45 gilles Exp $ =cut @@ -215,19 +228,28 @@ my( @folder, $prefix2, $sep1, $sep2, $syncinternaldates, - $delete, $expunge, $dry, $subscribed, + $delete, $expunge, $dry, $subscribed, $subscribe, $version, $VERSION, $help, ); use vars qw ($opt_G); # missing code for this will be option. -$rcs = ' $Id: imapsync,v 1.48 2003/11/21 04:23:10 gilles Exp gilles $ '; +$rcs = ' $Id: imapsync,v 1.53 2003/12/12 17:34:45 gilles Exp $ '; $rcs =~ m/,v (\d+\.\d+)/; $VERSION = ($1) ? $1 : "UNKNOWN"; + $error=0; -my $banner = '$RCSfile: imapsync,v $ ' . '$Revision: 1.48 $ ' . '$Date: 2003/11/21 04:23:10 $ ' . "\n"; +my $banner = join("", + '$RCSfile: imapsync,v $ ', + '$Revision: 1.53 $ ', + '$Date: 2003/12/12 17:34:45 $ ', + "\n", + "Mail::IMAPClient version used here is ", + $Mail::IMAPClient::VERSION, + "\n" + ); unless(defined(&_SYSEXITS_H)) { # 64 on my linux box. @@ -388,6 +410,11 @@ FOLDER: foreach my $f_fold (@f_folders) { $to->expunge(); } + if ($subscribe) { + print "Subscribing to folder $t_fold on destination server\n"; + $to->subscribe($t_fold); + } + my @f_msgs = $from->search("ALL"); $debug and print "LIST FROM : @f_msgs\n"; my @t_msgs = $to->search("ALL"); @@ -528,13 +555,20 @@ sub get_options "dry!" => \$dry, "expunge!" => \$expunge, "subscribed!" => \$subscribed, + "subscribe!" => \$subscribe, "version" => \$version, "help" => \$help, ); $debug and print "get options: [$opt_ret]\n"; + + # just the version print "$VERSION\n" and exit if ($version) ; + + # exit with --help option or no option at all usage() and exit if ($help or ! $numopt) ; + + # don't go on if options are not all known. exit(EX_USAGE()) unless ($opt_ret) ; @@ -613,6 +647,8 @@ Several options are mandatory. --syncinternaldates : set the internal dates on host2 same as host1 --dry : do nothing, just print what would be done. --subscribed : transfer only subscribed folders. +--subscribe : subscribe to the folders transfered on the + "destination" server. --debug : debug mode. --debugimap : imap debug mode. --version : print sotfware version. @@ -626,6 +662,7 @@ $0 \\ --host2 imap.trac.org --user2 bar --passfile2 /etc/secret2 + Mail::IMAPClient version is $Mail::IMAPClient::VERSION $rcs imapsync copyleft is the GNU General Public License. See http://www.gnu.org/copyleft/gpl.html diff --git a/tests.sh b/tests.sh index a327aa4..0c8424f 100644 --- a/tests.sh +++ b/tests.sh @@ -1,8 +1,11 @@ #!/bin/sh -# $Id: tests.sh,v 1.10 2003/11/21 03:20:14 gilles Exp $ +# $Id: tests.sh,v 1.11 2003/12/12 17:48:02 gilles Exp $ # $Log: tests.sh,v $ +# Revision 1.11 2003/12/12 17:48:02 gilles +# Added lp_subscribe() test +# # Revision 1.10 2003/11/21 03:20:14 gilles # Renamed lp_folder_qqq() pl_folder_qqq() # Removed --prefix2 INBOX. in pl_folder_qqq() @@ -205,12 +208,24 @@ lp_subscribed() else : fi - - - } +lp_subscribe() +{ + 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 \ + --subscribed --subscribe + else + : + fi +} + # mandatory tests @@ -227,7 +242,8 @@ test $# -eq 0 && run_tests \ pl_folder \ pl_folder_qqq \ lp_internaldate \ - lp_subscribed + lp_subscribed \ + lp_subscribe \ # selective tests