From 93b2baf68daee9f6be816a147d956d44575302db Mon Sep 17 00:00:00 2001 From: Nick Bebout Date: Sat, 12 Mar 2011 02:44:28 +0000 Subject: [PATCH] 1.181 --- ChangeLog | 11 +++++++---- README | 4 ++-- VERSION | 2 +- imapsync | 29 ++++++++++++++++++++++------- 4 files changed, 32 insertions(+), 14 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4c46364..06d16ca 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,17 +1,20 @@ RCS file: RCS/imapsync,v Working file: imapsync -head: 1.180 +head: 1.181 branch: locks: strict - gilles: 1.180 access list: symbolic names: keyword substitution: kv -total revisions: 180; selected revisions: 180 +total revisions: 181; selected revisions: 181 description: ---------------------------- -revision 1.180 locked by: gilles; +revision 1.181 +date: 2006/07/19 14:45:29; author: gilles; state: Exp; lines: +22 -7 +Added several controls to check connected status. +---------------------------- +revision 1.180 date: 2006/07/19 13:45:55; author: gilles; state: Exp; lines: +7 -7 Updated success list ---------------------------- diff --git a/README b/README index a31e26d..cea7246 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.180 $ + $Revision: 1.181 $ INSTALL imapsync works fine under any Unix OS. @@ -290,5 +290,5 @@ AUTHOR teaching free open and gratis softwares. Don't hesitate to pay him for that services. - $Id: imapsync,v 1.180 2006/07/19 13:45:55 gilles Exp gilles $ + $Id: imapsync,v 1.181 2006/07/19 14:45:29 gilles Exp $ diff --git a/VERSION b/VERSION index b72abab..0dd8e37 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.180 +1.181 diff --git a/imapsync b/imapsync index f3d16c8..c999b9f 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.180 $ +$Revision: 1.181 $ =head1 INSTALL @@ -340,7 +340,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.180 2006/07/19 13:45:55 gilles Exp gilles $ +$Id: imapsync,v 1.181 2006/07/19 14:45:29 gilles Exp $ =cut @@ -397,7 +397,7 @@ my( use vars qw ($opt_G); # missing code for this will be option. -$rcs = ' $Id: imapsync,v 1.180 2006/07/19 13:45:55 gilles Exp gilles $ '; +$rcs = ' $Id: imapsync,v 1.181 2006/07/19 14:45:29 gilles Exp $ '; $rcs =~ m/,v (\d+\.\d+)/; $VERSION = ($1) ? $1 : "UNKNOWN"; @@ -434,8 +434,8 @@ $error=0; my $banner = join("", '$RCSfile: imapsync,v $ ', - '$Revision: 1.180 $ ', - '$Date: 2006/07/19 13:45:55 $ ', + '$Revision: 1.181 $ ', + '$Date: 2006/07/19 14:45:29 $ ', "\n", "Mail::IMAPClient version used here is ", $VERSION_IMAPClient,"\n" @@ -906,6 +906,9 @@ FOLDER: foreach my $f_fold (@f_folders) { $t_fold = to_folder_name($f_fold); print "To Folder [$t_fold]\n"; + last FOLDER if $from->IsUnconnected(); + last FOLDER if $to->IsUnconnected(); + unless ($from->select($f_fold)) { warn "From Folder $f_fold : Could not select ", @@ -952,6 +955,8 @@ FOLDER: foreach my $f_fold (@f_folders) { next FOLDER if ($justfolders); + last FOLDER if $from->IsUnconnected(); + last FOLDER if $to->IsUnconnected(); my @f_msgs = select_msgs($from); @@ -968,7 +973,9 @@ FOLDER: foreach my $f_fold (@f_folders) { my %t_hash = (); print "++++ From [$f_fold] Parse 1 ++++\n"; - + last FOLDER if $from->IsUnconnected(); + last FOLDER if $to->IsUnconnected(); + my $f_heads = $from->parse_headers2([@f_msgs], @useheader)if (@f_msgs) ; $debug and print "Time headers: ", timenext(), " s\n"; @@ -983,6 +990,9 @@ FOLDER: foreach my $f_fold (@f_folders) { $debug and print "Time headers: ", timenext(), " s\n"; print "++++ To [$t_fold] Parse 1 ++++\n"; + last FOLDER if $from->IsUnconnected(); + last FOLDER if $to->IsUnconnected(); + my $t_heads = $to->parse_headers2([@t_msgs], @useheader) if (@t_msgs); $debug and print "Time headers: ", timenext(), " s\n"; @@ -1034,6 +1044,7 @@ FOLDER: foreach my $f_fold (@f_folders) { print "+ NO msg #$f_msg [$m_id] in $t_fold\n"; # copy print "+ Copying msg #$f_msg:$f_size to folder $t_fold\n"; + last FOLDER if $from->IsUnconnected(); my $string = $from->message_string($f_msg); foreach my $regexmess (@regexmess) { $debug and print "eval \$string =~ $regexmess\n"; @@ -1056,6 +1067,7 @@ FOLDER: foreach my $f_fold (@f_folders) { my $new_id; print "flags from : [$flags_f][$d]\n"; + last FOLDER if $to->IsUnconnected(); unless ($dry) { unless($new_id = $to->append_string($t_fold,$string, $flags_f, $d)){ warn "Couldn't append msg #$f_msg (Subject:[".$from->subject($f_msg)."]) to folder $t_fold: ", @@ -1086,7 +1098,10 @@ FOLDER: foreach my $f_fold (@f_folders) { my $t_msg = $t_hash{$m_id}{'m'}; - $debug and print "Setting flags\n"; + $debug and print "Setting flags\n"; + last FOLDER if $from->IsUnconnected(); + last FOLDER if $to->IsUnconnected(); + my (@flags_f,@flags_t); my $flags_f_rv = $from->flags($f_msg); @flags_f = @{$flags_f_rv} if ref($flags_f_rv);