diff --git a/ChangeLog b/ChangeLog index 4fc57e6..26d58ce 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,15 +1,20 @@ RCS file: RCS/imapsync,v Working file: imapsync -head: 1.64 +head: 1.65 branch: locks: strict access list: symbolic names: keyword substitution: kv -total revisions: 64; selected revisions: 64 +total revisions: 65; selected revisions: 65 description: ---------------------------- +revision 1.65 +date: 2003/12/24 03:04:34; author: gilles; state: Exp; lines: +20 -7 +Wrote separator_invert() +Use separator_invert() to transform separators +---------------------------- revision 1.64 date: 2003/12/23 19:45:46; author: gilles; state: Exp; lines: +5 -8 Removed auth capability debug diff --git a/README b/README index d96820f..8ca7bd0 100644 --- a/README +++ b/README @@ -1,7 +1,7 @@ NAME imapsync - synchronize mailboxes between two imap servers. - $Revision: 1.64 $ + $Revision: 1.65 $ INSTALL Get imapsync at @@ -184,5 +184,5 @@ SIMILAR SOFTWARES Feedback (good or bad) will be always welcome. - $Id: imapsync,v 1.64 2003/12/23 19:45:46 gilles Exp $ + $Id: imapsync,v 1.65 2003/12/24 03:04:34 gilles Exp $ diff --git a/TODO b/TODO index 6ee8ba3..b72edd2 100644 --- a/TODO +++ b/TODO @@ -6,10 +6,10 @@ Add a --recurse option. Add --prefix1 option. Don't know what is the need exactly. -Pb if "to separator" is in "from folder" name. +DONE. Pb if "to separator" is in "from folder" name. Have to choose a caracter != to separator and not in from folders. The solution can be to -just exchange the two caracters. +just exchange the two separator caracters. DONE. Look at the separator() function in Mail::IMAPClient diff --git a/VERSION b/VERSION index 8725364..5b6cd6b 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.64 +1.65 diff --git a/imapsync b/imapsync index de16b22..74d540f 100755 --- a/imapsync +++ b/imapsync @@ -4,7 +4,7 @@ imapsync - synchronize mailboxes between two imap servers. -$Revision: 1.64 $ +$Revision: 1.65 $ =head1 INSTALL @@ -220,7 +220,7 @@ Welcome in shell programming ! Feedback (good or bad) will be always welcome. -$Id: imapsync,v 1.64 2003/12/23 19:45:46 gilles Exp $ +$Id: imapsync,v 1.65 2003/12/24 03:04:34 gilles Exp $ =cut @@ -251,7 +251,7 @@ my( use vars qw ($opt_G); # missing code for this will be option. -$rcs = ' $Id: imapsync,v 1.64 2003/12/23 19:45:46 gilles Exp $ '; +$rcs = ' $Id: imapsync,v 1.65 2003/12/24 03:04:34 gilles Exp $ '; $rcs =~ m/,v (\d+\.\d+)/; $VERSION = ($1) ? $1 : "UNKNOWN"; @@ -282,8 +282,8 @@ $error=0; my $banner = join("", '$RCSfile: imapsync,v $ ', - '$Revision: 1.64 $ ', - '$Date: 2003/12/23 19:45:46 $ ', + '$Revision: 1.65 $ ', + '$Date: 2003/12/24 03:04:34 $ ', "\n", "Mail::IMAPClient version used here is ", $VERSION_IMAPClient, " auth md5 : $md5_supported", @@ -423,13 +423,26 @@ print print "From subscribed folders : ", map("[$_] ", keys(%fs_folders)), "\n"; +sub separator_invert { + my $o_sep="\000"; + + my($f_fold, $f_sep, $t_sep) = @_; + + my $t_fold = $f_fold; + $t_fold =~ s@\Q$t_sep@$o_sep@g; + $t_fold =~ s@\Q$f_sep@$t_sep@g; + $t_fold =~ s@\Q$o_sep@$f_sep@g; + return($t_fold); +} + FOLDER: foreach my $f_fold (@f_folders) { my $t_fold; print "From Folder [$f_fold]\n"; - $t_fold = $f_fold; - $t_fold =~ s@\Q$f_sep@$t_sep@g unless ($f_sep eq $t_sep); + + $t_fold = separator_invert($f_fold,$f_sep, $t_sep); $t_fold = $prefix2 . $t_fold if ($prefix2); print "To Folder [$t_fold]\n"; + unless ($from->select($f_fold)) { warn "From Folder $f_fold : Could not select ", diff --git a/learn/hugemigr b/learn/hugemigr old mode 100644 new mode 100755 diff --git a/learn/separator b/learn/separator new file mode 100755 index 0000000..939b5b3 --- /dev/null +++ b/learn/separator @@ -0,0 +1,27 @@ +#!/usr/bin/perl -w + +my $f_sep="/"; +my $t_sep="."; +my $o_sep="\000"; + +foreach my $f_fold ("testsub/testsub3", "testsub.testsub3", "a.b/c.d/e" ) { + my $t_fold; + print "From Folder [$f_fold]\n"; + $t_fold = $f_fold; + my $t_fold2 = $t_fold3 = $f_fold; + + $t_fold =~ s@\Q$f_sep@$t_sep@g; + $t_fold2 =~ s@\Q$t_sep@$f_sep@g; + $t_fold3 =~ s@\Q$t_sep@$o_sep@g; + $t_fold4 = $t_fold3; + $t_fold4 =~ s@\Q$f_sep@$t_sep@g; + $t_fold5 = $t_fold4; + $t_fold5 =~ s@\Q$o_sep@$f_sep@g; + + #$t_fold =~ s@/@.@g; + print "To /. Folder [$t_fold]\n"; + print "To ./ Folder2[$t_fold2]\n"; + print "To .0 Folder3[$t_fold3]\n"; + print "To .0 Folder4[$t_fold4]\n"; + print "To 0/ Folder5[$t_fold5]\n\n"; +} diff --git a/learn/zz b/learn/zz deleted file mode 100644 index 4be32ee..0000000 --- a/learn/zz +++ /dev/null @@ -1,16 +0,0 @@ - -my $f_sep="/"; -my $t_sep="."; - -foreach my $f_fold ("testsub/testsub3", "testsub.testsub3" ) { - my $t_fold; - print "From Folder [$f_fold]\n"; - $t_fold = $f_fold; - my $t_fold2 = $f_fold; - $t_fold =~ s@\Q$f_sep@$t_sep@g; - $t_fold2 =~ s@\Q$t_sep@$f_sep@g; - #$t_fold =~ s@/@.@g; - print "To /. Folder [$t_fold]\n"; - print "To ./ Folder2[$t_fold2]\n\n"; - -}