From d52ebe8b1008c79d93aa5fd980d577e51c252209 Mon Sep 17 00:00:00 2001 From: Nick Bebout Date: Sat, 12 Mar 2011 02:44:49 +0000 Subject: [PATCH] 1.293 --- CREDITS | 52 ++++++++++++++++++++++++++++++--- ChangeLog | 38 +++++++++++++++++++++--- Makefile | 7 +++-- README | 4 +-- TODO | 18 ++++++++++-- VERSION | 2 +- freshmeat_submition.inp | 14 +++------ freshmeat_submition.out | 14 +++++---- i => i2 | 0 i3 | 4 +++ imapsync | 37 +++++++++++++----------- learn/date_manip | 2 ++ memo | 35 +++++++++++----------- paypal.html | 18 ++++++++++++ tests.sh | 64 +++++++++++++++++++++++++++++++++++++---- 15 files changed, 235 insertions(+), 74 deletions(-) rename i => i2 (100%) create mode 100755 i3 create mode 100644 paypal.html diff --git a/CREDITS b/CREDITS index 926421b..579f777 100644 --- a/CREDITS +++ b/CREDITS @@ -1,6 +1,5 @@ #!/bin/cat -# $Id: CREDITS,v 1.123 2009/07/24 17:22:32 gilles Exp gilles $ - +# $Id: CREDITS,v 1.127 2009/12/09 00:12:24 gilles Exp gilles $ If you want to make a donation to the author, Gilles LAMIRAL: @@ -20,6 +19,40 @@ to remove one. I thank very much all of these people. +Matt Garretson +Contributed by giving the books +42.66 "Beautiful Testing: Leading Professionals Reveal How They Improve Software (Theory in Practice)" by Adam Goucher +13.46 "Salsa Piano - The Complete Guide with CD!: Hal Leonard Keyboard Style Series" by Hector Martignon + +Joseph L. Hemen +Contributed by giving the book +32.97 "Nmap Network Scanning: The Official Nmap Project Guide to Network Discovery and Security Scanning" by Gordon Fyodor Lyon + + +Ralf Hildebrandt +Contributed by giving the book +18.82 "The Colossal Book of Mathematics: Classic Puzzles, Paradoxes, and Problems" by Martin Gardner + +Mariano Absatz +Contributed by giving the book +28.35 "How to Measure Anything: Finding the Value of "Intangibles" in Business" by Douglas W. Hubbard + +Craig Maloney +Contributed by giving the book +9.32 "Eye Twisters: Ambigrams & Other\u200b Visual Puzzles to Amaze and Entertain" by Burkard Polster + +Michael Betts +Contributed by giving the book +9.50 "Q.E.D.: Beauty in Mathematical Proof (Wooden Books)" by Burkard Polster + +Steve Rippl +Contributed by giving the book +31.67 "The Mythical Man-Month" + +Hubert Garrido +Contributed by giving the book +19.79 "JavaScript: The Good Parts" + Kelsey Cummings Contributed by giving the book 64.12 "Computer Architecture: Concepts and Evolution 2-Volume Set" @@ -723,6 +756,17 @@ Eric Yung Total amount of book prices : c \ + +9.50+\ +\ +42.66+\ +13.46+\ +32.97+\ +18.82+\ +\ +31.67+\ +19.79+\ +\ 64.12+\ \ 29.69+\ @@ -796,5 +840,5 @@ c \ 59.99+\ 31.20+\ 40.00 - -=1825.90 += +1985.27 diff --git a/ChangeLog b/ChangeLog index 87ee044..adf2e10 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,17 +1,47 @@ RCS file: RCS/imapsync,v Working file: imapsync -head: 1.286 +head: 1.293 branch: locks: strict - gilles: 1.286 + gilles: 1.293 access list: symbolic names: keyword substitution: kv -total revisions: 286; selected revisions: 286 +total revisions: 293; selected revisions: 293 description: ---------------------------- -revision 1.286 locked by: gilles; +revision 1.293 locked by: gilles; +date: 2010/01/12 05:34:27; author: gilles; state: Exp; lines: +6 -6 +Change call for donation. +---------------------------- +revision 1.292 +date: 2010/01/12 05:15:53; author: gilles; state: Exp; lines: +8 -7 +freshmeat rate is gone. +paypal is good to encourage myself. +---------------------------- +revision 1.291 +date: 2010/01/12 04:36:03; author: gilles; state: Exp; lines: +10 -10 +Load Term::ReadKey when needed. +---------------------------- +revision 1.290 +date: 2010/01/12 03:42:09; author: gilles; state: Exp; lines: +7 -7 +One line per folder when printing the each folder list. +---------------------------- +revision 1.289 +date: 2010/01/12 01:54:52; author: gilles; state: Exp; lines: +6 -6 +Removed unused Date_Cmp from import. +---------------------------- +revision 1.288 +date: 2009/09/02 20:37:22; author: gilles; state: Exp; lines: +8 -6 +Request all folder list only when needed (sometimes the list is very long) +---------------------------- +revision 1.287 +date: 2009/08/24 00:32:36; author: gilles; state: Exp; lines: +6 -6 +- fixed fetch_hash() to return FLAGS as "" not () when no FLAGS set. +(reading Mail-IMAPClient-3.19 code) +---------------------------- +revision 1.286 date: 2009/07/24 15:53:04; author: gilles; state: Exp; lines: +10 -7 Bug fix: allow3x is on by default (was badly done after check_lib_version()) ---------------------------- diff --git a/Makefile b/Makefile index 34ba3f3..ccf8a36 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ -# $Id: Makefile,v 1.23 2009/07/03 01:01:13 gilles Exp gilles $ +# $Id: Makefile,v 1.25 2010/01/12 06:31:22 gilles Exp gilles $ TARGET=imapsync @@ -102,8 +102,9 @@ tarball: echo making tarball $(DIST_FILE) mkdir -p dist mkdir -p ../prepa_dist/$(DIST_NAME) - rsync -aCv --delete --exclude dist/ ./ ../prepa_dist/$(DIST_NAME) - cd ../prepa_dist && tar czfv --verify $(DIST_FILE) $(DIST_NAME) + rsync -aCv --delete --omit-dir-times --exclude dist/ ./ ../prepa_dist/$(DIST_NAME) + #sync && sync && sync && sleep 2 + cd ../prepa_dist && (tar czfv $(DIST_FILE) $(DIST_NAME) || tar czfv $(DIST_FILE) $(DIST_NAME)) ln -f ../prepa_dist/$(DIST_FILE) dist/ cd dist && md5sum $(DIST_FILE) > $(DIST_FILE).md5.txt cd dist && md5sum -c $(DIST_FILE).md5.txt diff --git a/README b/README index 47dff02..25932ca 100644 --- a/README +++ b/README @@ -3,7 +3,7 @@ NAME Synchronise mailboxes between two imap servers. Good at IMAP migration. More than 32 different IMAP server softwares supported with success. - $Revision: 1.286 $ + $Revision: 1.293 $ INSTALL imapsync works fine under any Unix OS with perl. @@ -362,5 +362,5 @@ SIMILAR SOFTWARES Feedback (good or bad) will always be welcome. - $Id: imapsync,v 1.286 2009/07/24 15:53:04 gilles Exp gilles $ + $Id: imapsync,v 1.293 2010/01/12 05:34:27 gilles Exp gilles $ diff --git a/TODO b/TODO index 0d7d88b..060cf1d 100644 --- a/TODO +++ b/TODO @@ -1,9 +1,12 @@ #!/bin/cat -# $Id: TODO,v 1.65 2009/07/24 17:22:13 gilles Exp gilles $ +# $Id: TODO,v 1.68 2010/01/12 05:28:22 gilles Exp gilles $ TODO file for imapsync ---------------------- + +Add option --exclude_messages_with_flag + Add more information about skipped messages. There was a time imapsync took the whole message when the @@ -12,6 +15,8 @@ messages (nowadays there are always big messages in mailboxes). May be the best is to take a part of the body. Have to code this. + + Add an option to store flags with "FLAGS.SILENT" instead of "+FLAGS.SILENT". @@ -25,7 +30,6 @@ Take a look at Mail::IMAPTalk Simon Bertrang said "way better performance, less problems, easier to use and no issues so far". Sounds good! - Post on imapsync mailing-list when a new release comes. Add an option to implement the faq entry about copying a contact folder. @@ -139,6 +143,16 @@ http://asg.web.cmu.edu/cyrus/download/imapd/altnamespace.html Explain expunge behavior. +DONE. Fix bug "Found that if folders have a space at the end of +the name, it will not create the folder name on the new +server, nor will it copy that folder's email." +Added regression test checking this. +Could not reproduce this bug. +Seems to be a old imapsync bug with 2.2.9 + + +DONE. (contacted Date::Manip maintener) Fix bug with Date::Manip 6.02 + DONE. Explain howto change only the header with --regexmess DONE. diff --git a/VERSION b/VERSION index 30fdebf..5fbdab3 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.286 +1.293 diff --git a/freshmeat_submition.inp b/freshmeat_submition.inp index 1790ee9..dcb7de5 100644 --- a/freshmeat_submition.inp +++ b/freshmeat_submition.inp @@ -5,22 +5,16 @@ #RELEASE_FOCUS="Code cleanup" #RELEASE_FOCUS="Minor feature enhancements" #RELEASE_FOCUS="Major feature enhancements" -#RELEASE_FOCUS="Minor bugfixes" -RELEASE_FOCUS="Major bugfixes" +RELEASE_FOCUS="Minor bugfixes" +#RELEASE_FOCUS="Major bugfixes" #RELEASE_FOCUS="Minor security fixes" #RELEASE_FOCUS="Major security fixes" #TEXT_BODY="Syntax cleanup" #TEXT_BODY="Updated documentation" -#TEXT_BODY="Bug fix: be case insensitive with header keywords." -#TEXT_BODY="Bug fix: rewrote the way to store messages to avoid freeze problems with some imap servers" -#TEXT_BODY="Bug fix: Allow long usernames with md5 authentification." -#TEXT_BODY="Bug fix: Bug really fixed: 'parse_headers want an ARRAY ref' crash (second time)." -TEXT_BODY="Bug fixes: -- Adaptation fix: Some imap servers return message size not equal to real message -size. Now imapsync accept this silly behavior and leave the message as is. +TEXT_BODY="Bug fixes. -- Many thanks to the freshmeat folk that correct my bad and poorly English ! +Many thanks to the freshmeat folk that correct my bad and poorly English ! " diff --git a/freshmeat_submition.out b/freshmeat_submition.out index 7bb3a18..bb87c6d 100644 --- a/freshmeat_submition.out +++ b/freshmeat_submition.out @@ -1,14 +1,16 @@ Project: imapsync -Version: 1.255 -Release-Focus: Major bugfixes +Version: 1.288 +Release-Focus: Major feature enhancements Hide: N Home-Page-URL: http://www.linux-france.org/prj/imapsync/ Gzipped-Tar-URL: http://www.linux-france.org/prj/imapsync/dist/ -Bug fixes: -- Adaptation fix: Some imap servers return message size not equal to real message -size. Now imapsync accept this silly behavior and leave the message as is. +Enhancements: +- Support Gmail imap +- Works fine under Windows XP (tm) +- Works with Mail::IMAPClient 3.xx and 2.2.9 +- Many bug fixes -- Many thanks to the freshmeat folk that correct my bad and poorly English ! +Many thanks to the freshmeat folk that correct my bad and poorly English ! diff --git a/i b/i2 similarity index 100% rename from i rename to i2 diff --git a/i3 b/i3 new file mode 100755 index 0000000..4c190b7 --- /dev/null +++ b/i3 @@ -0,0 +1,4 @@ +#!/bin/sh + +perl -IMail-IMAPClient-3.19/lib ./imapsync "$@" + diff --git a/imapsync b/imapsync index be68c98..c3b1686 100755 --- a/imapsync +++ b/imapsync @@ -9,7 +9,7 @@ tool. Synchronise mailboxes between two imap servers. Good at IMAP migration. More than 32 different IMAP server softwares supported with success. -$Revision: 1.286 $ +$Revision: 1.293 $ =head1 INSTALL @@ -418,7 +418,7 @@ Entries for imapsync: Feedback (good or bad) will always be welcome. -$Id: imapsync,v 1.286 2009/07/24 15:53:04 gilles Exp gilles $ +$Id: imapsync,v 1.293 2010/01/12 05:34:27 gilles Exp gilles $ =cut @@ -484,7 +484,7 @@ my( use vars qw ($opt_G); # missing code for this will be option. -$rcs = '$Id: imapsync,v 1.286 2009/07/24 15:53:04 gilles Exp gilles $ '; +$rcs = '$Id: imapsync,v 1.293 2010/01/12 05:34:27 gilles Exp gilles $ '; $rcs =~ m/,v (\d+\.\d+)/; $VERSION = ($1) ? $1: "UNKNOWN"; @@ -547,8 +547,8 @@ while (@argv_copy) { my $banner = join("", '$RCSfile: imapsync,v $ ', - '$Revision: 1.286 $ ', - '$Date: 2009/07/24 15:53:04 $ ', + '$Revision: 1.293 $ ', + '$Date: 2010/01/12 05:34:27 $ ', "\n",localhost_info(), " and the module Mail::IMAPClient version used here is ", $VERSION_IMAPClient,"\n", @@ -657,7 +657,7 @@ if ($syncinternaldates || $idatefromheader) { no warnings 'redefine'; local *Carp::confess = sub { return undef; }; require Date::Manip; - Date::Manip->import(qw(ParseDate Date_Cmp UnixDate Date_Init Date_TimeZone)); + Date::Manip->import(qw(ParseDate UnixDate Date_Init Date_TimeZone)); #print "Date_init: [", join(" ",Date_Init()), "]\n"; print "TimeZone:[", Date_TimeZone(), "]\n"; if (not (Date_TimeZone())) { @@ -912,7 +912,7 @@ sub remove_from_requested_folders { map { $subscribed_folder{$_} = 1 } $from->subscribed(); -my @all_source_folders = sort $from->folders(); + if (scalar(@folder) or $subscribed or scalar(@folderrec)) { # folders given by option --folder @@ -936,6 +936,7 @@ else { # no include, no folder/subscribed/folderrec options => all folders if (not scalar(@include)) { + my @all_source_folders = sort $from->folders(); add_to_requested_folders(@all_source_folders); } } @@ -943,6 +944,7 @@ else { # consider (optional) includes and excludes if (scalar(@include)) { + my @all_source_folders = sort $from->folders(); foreach my $include (@include) { my @included_folders = grep /$include/, @all_source_folders; add_to_requested_folders(@included_folders); @@ -1215,8 +1217,8 @@ foreach my $folder (@t_folders_list) { print "++++ Listing folders ++++\n", - "From folders list: ", map("[$_] ",@f_folders),"\n", - "To folders list: ", map("[$_] ",@t_folders_list),"\n"; + "From folders list:\n", map("[$_]\n",@f_folders),"\n", + "To folders list:\n", map("[$_]\n",@t_folders_list),"\n"; print "From subscribed folders list: ", @@ -1828,9 +1830,10 @@ sub stats { sub thank_author { return(join("", "Happy with this free, open and gratis GPL software?\n", - "Please, thank the author (Gilles LAMIRAL) by giving him a book:\n", + "Encourage the author (Gilles LAMIRAL) by giving him a book:\n", "http://www.amazon.com/gp/registry/wishlist/1C9UNDIH3P7R7/\n", - "or rate imapsync at http://freshmeat.net/projects/imapsync/\n")); + "or via paypal:\n", + "http://www.linux-france.org/prj/imapsync/paypal.html\n")); } sub get_options { @@ -1926,7 +1929,7 @@ sub get_options { exit; } - + $help = 1 if ! $numopt; load_modules(); # exit with --help option or no option at all @@ -1943,10 +1946,10 @@ sub load_modules { require IO::Socket::SSL if ($ssl1 or $ssl2); require Date::Manip if ($syncinternaldates || $idatefromheader) ; -# require Term::ReadKey if ( -# (not($password1 or $passfile1)) -# or (not($password2 or $passfile2)) -# or (not $help)); + require Term::ReadKey if ( + ((not($password1 or $passfile1)) + or (not($password2 or $passfile2))) + and (not $help)); #require Data::Dumper if ($debug); } @@ -2448,7 +2451,7 @@ use constant NonFolderArg => 1; # Value to pass to Massage to "| # then closing quote; or ... \( # ...an open paren (\\.| # then bslashed anychar or ... - [^\)]+) # ... non-close-paren char + [^\)]*) # ... non-close-paren char \)| # then closing paren; or ... (\S+)) # unquoted string (?:\s.*)? # possibly followed by space-stuff diff --git a/learn/date_manip b/learn/date_manip index eea5a98..a7f580b 100755 --- a/learn/date_manip +++ b/learn/date_manip @@ -5,6 +5,8 @@ require Date::Manip; Date::Manip->import(qw(ParseDate Date_Cmp UnixDate)); +print "Date::Manip::VERSION $Date::Manip::VERSION\n"; + foreach $date_inp ("21-Jan-2004 23:10:58 +0200", "21-Feb-2004 0:14:02 +0200", "15-Oct-2004 23:25:42 +0200", "19-Aug-2005 1:49:08 +0200") { $date_dm = ParseDate($date_inp); diff --git a/memo b/memo index 1a116d8..6283f15 100644 --- a/memo +++ b/memo @@ -36,28 +36,28 @@ fi niouzes_compil } - -fm_read_param() { - -# read definitions -. $NEWS_FILE_FM_INP - -} +#' nedit sucks with syntax color fm_init() { software_version -NEWS_FILE_FM="/home/gilles/public_html/imapsync/freshmeat_submition" +NEWS_FILE_FM="./freshmeat_submition" NEWS_FILE_FM_INP=${NEWS_FILE_FM}.inp NEWS_FILE_FM_OUT=${NEWS_FILE_FM}.out } +fm_read_param() { +# read definitions +. $NEWS_FILE_FM_INP +} + + fm_read_announce() { -fm_init -fm_read_param + fm_init + fm_read_param -cat << EOF + cat << EOF Project: imapsync Version: $VERSION Release-Focus: $RELEASE_FOCUS @@ -71,22 +71,19 @@ EOF } fm_announce() { -fm_init + fm_init -if ! newer VERSION $NEWS_FILE_FM_OUT; then + if ! newer VERSION $NEWS_FILE_FM_OUT; then echo "$VERSION already submitted on freshmeat" -else + else if newer VERSION $NEWS_FILE_FM_INP; then echo "Update $NEWS_FILE_FM_INP please" return 1 fi - fm_read_param fm_read_announce > $NEWS_FILE_FM_OUT - -freshmeat-submit < $NEWS_FILE_FM_OUT -fi - + freshmeat-submit < $NEWS_FILE_FM_OUT + fi } diff --git a/paypal.html b/paypal.html new file mode 100644 index 0000000..bdca039 --- /dev/null +++ b/paypal.html @@ -0,0 +1,18 @@ + + + +

imapsync donation

+ +Help the author to maintain imapsync: +
+ + + + +
+ +Thanks in advance! + + + diff --git a/tests.sh b/tests.sh index 9fed319..a6ce57c 100644 --- a/tests.sh +++ b/tests.sh @@ -1,6 +1,6 @@ #!/bin/sh -# $Id: tests.sh,v 1.93 2009/07/24 17:20:41 gilles Exp gilles $ +# $Id: tests.sh,v 1.95 2010/01/12 04:09:57 gilles Exp gilles $ # Example: # CMD_PERL='perl -I./Mail-IMAPClient-3.14/lib' sh -x tests.sh @@ -157,6 +157,15 @@ locallocal() { --allow3xx } +ll_ask_password() { + { sleep 2; cat ../../var/pass/secret.tata; } | \ + $CMD_PERL ./imapsync \ + --host1 $HOST1 --user1 tata \ + --host2 $HOST2 --user2 titi \ + --passfile2 ../../var/pass/secret.titi \ + --justlogin +} + ll_timeout() { $CMD_PERL ./imapsync \ --host1 $HOST1 --user1 tata \ @@ -236,6 +245,17 @@ ll_justfolders() { echo "rm -rf /home/vmail/titi/.new_folder/" } +ll_bug_folder_name_with_blank() { + $CMD_PERL ./imapsync \ + --host1 $HOST1 --user1 tata \ + --passfile1 ../../var/pass/secret.tata \ + --host2 $HOST2 --user2 titi \ + --passfile2 ../../var/pass/secret.titi \ + --justfolders \ + --allow3xx + echo "rm -rf /home/vmail/titi/.bugs/" +} + ll_prefix12() { $CMD_PERL ./imapsync \ @@ -627,12 +647,40 @@ ll_regex_flag() --host2 $HOST2 --user2 titi \ --passfile2 ../../var/pass/secret.titi \ --folder INBOX.yop.yap \ - --dry --debug --regexflag 's/\\Answered/\\AnXweXed/g' \ - --allow3xx + --debug --regexflag 's/\\Answered/\\Flagged/g' - echo 'rm /home/vmail/titi/.yop.yap/cur/*' + echo 'rm -f /home/vmail/titi/.yop.yap/cur/*' } +ll_regex_flag2() +{ + $CMD_PERL ./imapsync \ + --host1 $HOST1 --user1 tata \ + --passfile1 ../../var/pass/secret.tata \ + --host2 $HOST2 --user2 titi \ + --passfile2 ../../var/pass/secret.titi \ + --folder INBOX.yop.yap \ + --debug --regexflag s/\\\\Answered/\\\\Flagged/g + + echo 'rm -f /home/vmail/titi/.yop.yap/cur/*' +} + + +ll_regex_flag3() +{ + $CMD_PERL ./imapsync \ + --host1 $HOST1 --user1 tata \ + --passfile1 ../../var/pass/secret.tata \ + --host2 $HOST2 --user2 titi \ + --passfile2 ../../var/pass/secret.titi \ + --folder INBOX.yop.yap \ + --debug --regexflag s/\\\\Answered//g + + echo 'rm -f /home/vmail/titi/.yop.yap/cur/*' +} + + + ssl_justconnect() { @@ -783,7 +831,8 @@ gmail_gmail() { --useheader 'Message-Id' --skipsize \ --regextrans2 's¤INBOX¤inbox_copy¤' \ --folder INBOX \ - --authmech1 LOGIN --authmech2 LOGIN + --authmech1 LOGIN --authmech2 LOGIN \ + --allowsizemismatch #--dry # --debug --debugimap # --authmech1 LOGIN } @@ -801,7 +850,8 @@ gmail_gmail2() { --passfile2 ../../var/pass/secret.imapsync.gl_gmail \ --useheader 'Message-Id' --skipsize \ --folder INBOX \ - --authmech1 LOGIN --authmech2 LOGIN + --authmech1 LOGIN --authmech2 LOGIN \ + --allowsizemismatch #--dry # --debug --debugimap # --authmech1 LOGIN } @@ -1107,6 +1157,8 @@ test $# -eq 0 && run_tests \ first_sync_dry \ first_sync \ locallocal \ + ll_ask_password \ + ll_bug_folder_name_with_blank \ ll_timeout \ ll_folder \ ll_buffersize \