This commit is contained in:
Nick Bebout 2011-03-12 02:44:59 +00:00
parent c6cefbbb65
commit e2a3e9d948
12 changed files with 148 additions and 63 deletions

14
CREDITS
View file

@ -1,5 +1,5 @@
#!/bin/cat
# $Id: CREDITS,v 1.142 2010/08/09 01:16:01 gilles Exp gilles $
# $Id: CREDITS,v 1.143 2010/08/15 11:18:09 gilles Exp gilles $
If you want to make a donation to the author, Gilles LAMIRAL:
@ -20,6 +20,18 @@ to remove one.
I thank very much all of these people.
Tony Pearse
Contributed by giving money 25 USD
Jan Keymeulen
Contributed by giving money 10 USD for 50% speedup.
Globule Bleu
Contributed by giving money 15 USD
Martin Schlagnitweit
Contributed by giving money 20 USD
Martin Werthmoeller
Gave a patch ./patches/imapsync-1.337_tobit_V6.patch

View file

@ -1,17 +1,27 @@
RCS file: RCS/imapsync,v
Working file: imapsync
head: 1.340
head: 1.342
branch:
locks: strict
gilles: 1.340
gilles: 1.342
access list:
symbolic names:
keyword substitution: kv
total revisions: 340; selected revisions: 340
total revisions: 342; selected revisions: 342
description:
----------------------------
revision 1.340 locked by: gilles;
revision 1.342 locked by: gilles;
date: 2010/08/15 11:02:41; author: gilles; state: Exp; lines: +12 -13
Clarity. Print capability after authenticated state.
----------------------------
revision 1.341
date: 2010/08/15 10:56:45; author: gilles; state: Exp; lines: +42 -14
Added Mail::IMAPClient::capability_update() to reset the capability cache.
Bug fix. Some imap server change their capability after authentification,
imapsync used the capability cache from the first CAPABILITY call.
----------------------------
revision 1.340
date: 2010/08/09 00:03:21; author: gilles; state: Exp; lines: +7 -7
Bug fix. Stupid undef breaking --syncinternaldates
----------------------------

View file

@ -1,5 +1,5 @@
# $Id: Makefile,v 1.34 2010/07/25 21:30:45 gilles Exp gilles $
# $Id: Makefile,v 1.35 2010/08/15 11:18:38 gilles Exp gilles $
.PHONY: help usage all
@ -13,6 +13,7 @@ usage:
@echo "make test3xx # run tests with (last) Mail-IMAPClient-3.xy"
@echo "make test229 # run tests with Mail-IMAPClient-2.2.9"
@echo "make all "
@echo "make upload_index"
DIST_NAME=imapsync-$(VERSION)
DIST_FILE=$(DIST_NAME).tgz

6
README
View file

@ -3,7 +3,7 @@ NAME
Synchronise mailboxes between two imap servers. Good at IMAP migration.
More than 36 different IMAP server softwares supported with success.
$Revision: 1.340 $
$Revision: 1.342 $
SYNOPSIS
To synchronise imap account "foo" on "imap.truc.org" to imap account
@ -87,7 +87,7 @@ USAGE
[--pidfile <filepath>]
[--tmpdir <dirpath>]
[--version] [--help]
DESCRIPTION
The command imapsync is a tool allowing incremental and recursive imap
transfer from one mailbox to another.
@ -400,5 +400,5 @@ SIMILAR SOFTWARES
Feedback (good or bad) will often be welcome.
$Id: imapsync,v 1.340 2010/08/09 00:03:21 gilles Exp gilles $
$Id: imapsync,v 1.342 2010/08/15 11:02:41 gilles Exp gilles $

22
TIME
View file

@ -1,21 +1,23 @@
50 3 replies on list.
40 http://www.linux-france.org/prj/imapsync_list/threads.html#00582
75 Fix. capability issue after authenticate.
240 Various
50 3 replies on list.
40 http://www.linux-france.org/prj/imapsync_list/threads.html#00582
250 ietf imap5 discussion
30 refactoring
80 read RFC2683 - IMAP4 Implementation Recommendations
30 Refactoring
80 Read RFC2683 - IMAP4 Implementation Recommendations
140 imapsync under win32 strawberry, pp (par::packer), imapsync.exe
300 imapsync under win32. test msw, environnement, using activestate
70 Profiling tests. Interresting results!
70 Profiling tests. Interresting results!
110 FAQ review, FAQ item "messages not all transferred", imapsync stats about "noheader"
250 Reviewed varaibles names, statistics, sub definitions from top to connect_imap()
120 W3C validation of web site
120 --pidfile option. die_clean() exit_clean()
120 --pidfile option. die_clean() exit_clean()
120 reconnect counter, --debugimap1 --debugimap2
50 FAQ tested "From " removing solution.
50 FAQ tested "From " removing solution.
600 split maxcommandlenght, email, reconnect better.
25 reconnect AUTOLOADING bug?
80 --subscribe_all. 1.318
70 Risko email. 1.315 on debian.
25 reconnect AUTOLOADING bug?
80 --subscribe_all. 1.318
70 Risko email. 1.315 on debian.
130
180
190 Added reconnect to 2.2.9

15
TODO
View file

@ -1,5 +1,5 @@
#!/bin/cat
# $Id: TODO,v 1.80 2010/08/09 01:15:44 gilles Exp gilles $
# $Id: TODO,v 1.81 2010/08/15 11:15:42 gilles Exp gilles $
TODO file for imapsync
----------------------
@ -21,6 +21,11 @@ Evaluate
http://www.rackspace.com/apps/email_hosting/migrations
http://www.yippiemove.com/
Be more effiscient with large mailboxes
Write a Mail::IMAPClient::fetch_hash allowing selecting messages to fetch
4 hours estimated time coding.
Add a well described problem for each problem detected
and counted in error counter statistics.
@ -30,9 +35,6 @@ http://www.bwebcentral.com/utils/imapsync-yahoo
See patches/imapsync-yahoo
DONE. Bugfix. Duplicate messages on host2 are not deleted with --delete2
Reason: "Skipping msg #120:508 in host2 folder INBOX.2005-INBOX (duplicate so we ignore this message)"
Add NTLM authentification support
http://cpansearch.perl.org/src/BUZZ/NTLM-1.05/NTLM.pm
http://curl.haxx.se/rfc/ntlm.html
@ -153,8 +155,13 @@ http://asg.web.cmu.edu/cyrus/download/imapd/altnamespace.html
Explain expunge behavior.
===========================================================================
DONE. Bugfix. Duplicate messages on host2 are not deleted with --delete2
Reason: "Skipping msg #120:508 in host2 folder INBOX.2005-INBOX (duplicate so we ignore this message)"
DONE. Ask namespace capability after login (dovecot 2).
It was a bug from library caching CAPABILITY.
DONE. Write a clean_exit() replacing each die() or exit() call.
Wrote exit_clean() and die_clean() to remove pid file.

View file

@ -1 +1 @@
1.340
1.342

View file

@ -19,7 +19,7 @@ tool. Synchronise mailboxes between two imap servers. Good
at IMAP migration. More than 36 different IMAP server softwares
supported with success.
$Revision: 1.340 $
$Revision: 1.342 $
=head1 SYNOPSIS
@ -469,7 +469,7 @@ Entries for imapsync:
Feedback (good or bad) will often be welcome.
$Id: imapsync,v 1.340 2010/08/09 00:03:21 gilles Exp gilles $
$Id: imapsync,v 1.342 2010/08/15 11:02:41 gilles Exp gilles $
=cut
@ -557,7 +557,7 @@ my(
# global variables initialisation
$rcs = '$Id: imapsync,v 1.340 2010/08/09 00:03:21 gilles Exp gilles $ ';
$rcs = '$Id: imapsync,v 1.342 2010/08/15 11:02:41 gilles Exp gilles $ ';
$total_bytes_transferred = 0;
$total_bytes_skipped = 0;
@ -728,8 +728,8 @@ $reconnectretry2 = (defined($reconnectretry2)) ? $reconnectretry2 : 3;
@useheader = ("ALL") unless (@useheader);
print "Host1 imap server [$host1] port [$port1] user [$user1]\n";
print "Host2 imap server [$host2] port [$port2] user [$user2]\n";
print "Host1: imap server [$host1] port [$port1] user [$user1]\n";
print "Host2: imap server [$host2] port [$port2] user [$user2]\n";
sub ask_for_password {
@ -860,15 +860,14 @@ sub server_banner {
return $banner;
}
$debug and print "Host1 capability: ", join(" ", $imap1->capability()), "\n";
$debug and print "Host2 capability: ", join(" ", $imap2->capability()), "\n";
die_clean() unless $imap1->IsAuthenticated();
print "host1: state Authenticated\n";
print "Host1: state Authenticated\n";
die_clean() unless $imap2->IsAuthenticated();
print "host2: state Authenticated\n";
print "Host2: state Authenticated\n";
print "Host1 capability: ", join(" ", $imap1->capability_update()), "\n";
print "Host2 capability: ", join(" ", $imap2->capability_update()), "\n";
exit_clean(0) if ($justlogin);
@ -1087,13 +1086,9 @@ sub tests_compare_lists {
}
my($h1_sep,$h2_sep);
# what are the private folders separators for each server ?
$debug and print "Getting separators\n";
$h1_sep = get_separator($imap1, $sep1, "--sep1");
$h2_sep = get_separator($imap2, $sep2, "--sep2");
@ -2101,7 +2096,7 @@ exit_clean(0);
# subroutines
sub imapsync_version {
my $rcs = '$Id: imapsync,v 1.340 2010/08/09 00:03:21 gilles Exp gilles $ ';
my $rcs = '$Id: imapsync,v 1.342 2010/08/15 11:02:41 gilles Exp gilles $ ';
$rcs =~ m/,v (\d+\.\d+)/;
my $VERSION = ($1) ? $1: "UNKNOWN";
return($VERSION);
@ -2185,8 +2180,8 @@ sub banner_imapsync {
my @argv_copy = @_;
my $banner_imapsync = join("",
'$RCSfile: imapsync,v $ ',
'$Revision: 1.340 $ ',
'$Date: 2010/08/09 00:03:21 $ ',
'$Revision: 1.342 $ ',
'$Date: 2010/08/15 11:02:41 $ ',
"\n",localhost_info(), "\n",
"Command line used:\n",
"$0 ", command_line_nopassword(@argv_copy), "\n",
@ -3476,6 +3471,29 @@ no warnings 'once';
};
# capability 2.2.9 is stupid: it caches and return first imap CAPABILITY call
# but call imap CAPABILITY each time.
# Copy/paste from 3.25
*Mail::IMAPClient::capability = sub {
my $self = shift;
if ( $self->{CAPABILITY} ) {
my @caps = keys %{ $self->{CAPABILITY} };
return wantarray ? @caps : \@caps;
}
$self->_imap_command('CAPABILITY')
or return undef;
my @caps = map { split } grep s/^\*\s+CAPABILITY\s+//, $self->History;
foreach (@caps) {
$self->{CAPABILITY}{ uc $_ }++;
$self->{ uc $1 } = uc $2 if /(.*?)\=(.*)/;
}
return wantarray ? @caps : \@caps;
};
*Mail::IMAPClient::_read_line = sub {
my $self = shift;
my $sh = $self->Socket;
@ -3751,6 +3769,7 @@ no warnings 'once';
};
}
# End of sub override_imapclient (yes, very bad indentation)
@ -3891,3 +3910,11 @@ sub RawSocket2 {
#$self->Fast_io( $self->Fast_io );
$sock;
}
sub capability_update {
my $self = shift;
delete $self->{CAPABILITY};
$self->capability;
}

View file

@ -5,7 +5,7 @@
<title>imapsync <!--#exec cmd="cat VERSION" --> </title>
<meta name="generator" content="Bluefish 1.0.7"/>
<meta name="author" content="Gilles LAMIRAL"/>
<meta name="date" content="2010-07-27T01:39:03+0200"/>
<meta name="date" content="2010-08-15T13:32:58+0200"/>
<meta name="copyright" content="None"/>
<meta name="keywords" content="imap, transfert, migration"/>
<meta name="description" content="imap migration tool"/>
@ -22,6 +22,11 @@
<p><b>imapsync</b> software is a command line tool allowing incremental and
recursive <b>imap</b> transfers from one mailbox to another, both anywhere on the internet.
imapsync is useful for imap account migration or imap account backup.
imapsync is not adequat for maintening two active imap accounts in synchronization
(where user plays independently on both sides).
</p>
<a id="AUTHOR"></a>
@ -135,14 +140,14 @@ If you really want a feature you can donate money and I'll code it.<br/>
<p>Some features and their time/money to be done evaluation</p>
<table cellpadding="10" cellspacing="0" border="1">
<tr align="right"><th>Feature </th><th>Time guessed</th><th>Time spent</th><th>Money received</th><th>Money still needed</th></tr>
<tr align="right"><td>Speedup 50% </td><td>10 hours </td><td>80 min </td><td>0 $ </td><td>300 $ </td></tr>
<tr align="right"><td>Backup to files </td><td> 8 hours </td><td>60 min </td><td>0 $ </td><td>240 $ </td></tr>
<tr align="right"><td>--deletefolder2 </td><td> 3 hours </td><td>30 min </td><td>0 $ </td><td> 90 $ </td></tr>
<tr align="right"><td>NTLM auth </td><td> 3 hours </td><td>60 min </td><td>0 $ </td><td> 90 $ </td></tr>
<tr align="right"><td>Win32 imapsync.exe </td><td> 8 hours </td><td>520 min </td><td>0 $ </td><td>240 $ </td></tr>
</table>
<tr align="right"><th>Feature </th><th>Time guessed</th><th>Time spent</th><th>Money received</th><th>Money needed</th></tr>
<tr align="right"><td>Speedup 50% </td><td>10 hours </td><td> 80 min </td><td>10 $ </td><td>300 $ </td></tr>
<tr align="right"><td>Backup to files </td><td> 8 hours </td><td> 60 min </td><td> 0 $ </td><td>240 $ </td></tr>
<tr align="right"><td>--deletefolder2 </td><td> 3 hours </td><td> 30 min </td><td> 0 $ </td><td> 90 $ </td></tr>
<tr align="right"><td>NTLM auth </td><td> 3 hours </td><td> 60 min </td><td> 0 $ </td><td> 90 $ </td></tr>
<tr align="right"><td>Win32 imapsync.exe </td><td> 8 hours </td><td>520 min </td><td> 0 $ </td><td>240 $ </td></tr>
<tr align="right"><td>Fix capability changes </td><td> 1 hour </td><td> 80 min </td><td> 0 $ </td><td>240 $ </td></tr>
</table>
<h2><a href="COPYING">COPYING</a></h2>
@ -159,7 +164,7 @@ If you really want a feature you can donate money and I'll code it.<br/>
<!--#config timefmt="%D" -->
<!--#config timefmt="%A %B %d, %Y" -->
This document last modified <!--#echo var="LAST_MODIFIED" --> <br/>
$Id: index.shtml,v 1.17 2010/07/26 23:40:00 gilles Exp gilles $
$Id: index.shtml,v 1.18 2010/08/15 11:33:12 gilles Exp gilles $
</p>
</body>

View file

@ -1,18 +1,17 @@
%REM $Id: test.bat,v 1.5 2010/07/16 23:27:13 gilles Exp gilles $
REM $Id: test.bat,v 1.6 2010/08/15 11:10:49 gilles Exp gilles $
cd C:\msys\1.0\home\Admin\imapsync
perl -mMail::IMAPClient -mDigest::MD5 -mTerm::ReadKey -mIO::Socket::SSL -mDate::Manip -mFile::Spec -mDigest::HMAC_MD5 -e ''
set TZ="GMT"
perl ./imapsync --host1 l --user1 toto --passfile1 secret.toto --host2 l --user2 titi --passfile2 secret.titi --noauthmd5 --delete2 --expunge2
perl ./imapsync --host1 l --user1 tata --passfile1 secret.tata --host2 l --user2 titi --passfile2 secret.titi --noauthmd5 --delete2 --expunge2 --folder INBOX
REM perl ./imapsync --host1 l --user1 toto --passfile1 secret.toto --host2 l --user2 titi --passfile2 secret.titi --noauthmd5 --delete2 --expunge2
REM perl ./imapsync --host1 l --user1 tata --passfile1 secret.tata --host2 l --user2 titi --passfile2 secret.titi --noauthmd5 --delete2 --expunge2 --folder INBOX
% REM -M Date::Manip 6.xx buggy?
REM -M Date::Manip 6.xx buggy?
pp -o imapsync.exe -M Term::ReadKey -M IO::Socket::SSL -M Digest::HMAC_MD5 imapsync
echo Checking imapsync.exe
.\imapsync.exe --host1 l --user1 toto --passfile1 secret.toto --host2 l --user2 titi --passfile2 secret.titi --noauthmd5 --delete2 --expunge2
.\imapsync.exe --host1 l --user1 tata --passfile1 secret.tata --host2 l --user2 titi --passfile2 secret.titi --noauthmd5 --delete2 --expunge2 --folder INBOX
.\imapsync.exe --host1 l --user1 tata --passfile1 secret.tata --host2 l --user2 titi --passfile2 secret.titi --noauthmd5 --delete2 --expunge2 --folder INBOX
echo Done Checking imapsync.exe

8
test2.bat Executable file
View file

@ -0,0 +1,8 @@
cd C:\msys\1.0\home\Admin\imapsync
perl -mMail::IMAPClient -mDigest::MD5 -mTerm::ReadKey -mIO::Socket::SSL -mFile::Spec -mDigest::HMAC_MD5 -e ''
.\imapsync.exe --host1 l --user1 toto --passfile1 secret.toto --host2 l --user2 titi --passfile2 secret.titi --noauthmd5 --delete2 --expunge2
.\imapsync.exe --host1 l --user1 tata --passfile1 secret.tata --host2 l --user2 titi --passfile2 secret.titi --noauthmd5 --delete2 --expunge2 --folder INBOX

View file

@ -1,6 +1,6 @@
#!/bin/sh
# $Id: tests.sh,v 1.109 2010/07/16 23:28:12 gilles Exp gilles $
# $Id: tests.sh,v 1.110 2010/08/15 11:10:04 gilles Exp gilles $
# Example:
# CMD_PERL='perl -I./Mail-IMAPClient-3.25/lib' sh -x tests.sh
@ -950,7 +950,7 @@ msw() {
if can_send; then
sendtestmessage toto
fi
scp imapsync test.bat \
scp imapsync test.bat test2.bat\
../../var/pass/secret.toto \
../../var/pass/secret.titi \
../../var/pass/secret.tata \
@ -960,6 +960,20 @@ msw() {
scp Admin@c:'C:/msys/1.0/home/Admin/imapsync/imapsync.exe' .
}
msw2() {
if can_send; then
sendtestmessage toto
fi
scp imapsync test2.bat\
../../var/pass/secret.toto \
../../var/pass/secret.titi \
../../var/pass/secret.tata \
Admin@c:'C:/msys/1.0/home/Admin/imapsync/'
ssh Admin@c 'C:/msys/1.0/home/Admin/imapsync/test2.bat'
}