1
0
mirror of https://github.com/imapsync/imapsync.git synced 2024-11-17 00:02:29 +01:00
This commit is contained in:
Nick Bebout 2011-03-12 02:44:16 +00:00
parent 1ba81f554e
commit 2a4d29a7c2
7 changed files with 71 additions and 47 deletions

View File

@ -1,15 +1,23 @@
RCS file: RCS/imapsync,v RCS file: RCS/imapsync,v
Working file: imapsync Working file: imapsync
head: 1.133 head: 1.135
branch: branch:
locks: strict locks: strict
access list: access list:
symbolic names: symbolic names:
keyword substitution: kv keyword substitution: kv
total revisions: 133; selected revisions: 133 total revisions: 135; selected revisions: 135
description: description:
---------------------------- ----------------------------
revision 1.135
date: 2005/06/21 01:29:44; author: gilles; state: Exp; lines: +25 -33
Removed md5 test on perl lib
----------------------------
revision 1.134
date: 2005/06/03 10:33:11; author: gilles; state: Exp; lines: +8 -8
updated documentation.
----------------------------
revision 1.133 revision 1.133
date: 2005/05/21 02:33:29; author: gilles; state: Exp; lines: +45 -31 date: 2005/05/21 02:33:29; author: gilles; state: Exp; lines: +45 -31
Added foldersizes function Added foldersizes function

27
FAQ
View File

@ -3,6 +3,27 @@
| FAQ for imapsync | | FAQ for imapsync |
+------------------+ +------------------+
=======================================================================
Q. We have found that the sent time and date have been changed to the time at which the file was synchronised.
R. I guess this is the case with Eudora but not with Mutt, no ?
Eurora shows by default the time the imap server received the email.
I think it is quite a strong behavior since the messages can
have travelled some time before the reception.
The sent time and date are given by the "Date:" header
and it is set most of the time by the MUA (Mail User Agent,
Mutt, Eudora, Thunderbird etc.).
imapsync does not touch any header since the
header is used to identify the messages in
both parts.
Solutions: a) Don't use buggy Eudora
b) Use the --syncinternaldates option and keep using Eudora :-)
=======================================================================
Q. I'm migrating from WU to Cyrus, and the mail folders are Q. I'm migrating from WU to Cyrus, and the mail folders are
under /home/user/mail but the tool copies everything in under /home/user/mail but the tool copies everything in
/home/user, how can i avoid that? /home/user, how can i avoid that?
@ -13,7 +34,7 @@ or (better)
imapsync ... --subscribed --subscribe imapsync ... --subscribed --subscribe
=======================================================================
Q. I'm migrating from WU to Cyrus, and the mail folders are Q. I'm migrating from WU to Cyrus, and the mail folders are
under /home/user/mail directory. When imapsync creates the under /home/user/mail directory. When imapsync creates the
folders in the new cyrus imap server, it makes a folder folders in the new cyrus imap server, it makes a folder
@ -27,6 +48,7 @@ R. Use
good then remove the --dry option. good then remove the --dry option.
=======================================================================
Q. Migrating from Groupwise to Cyrus Q. Migrating from Groupwise to Cyrus
R. By Jamie Neil: R. By Jamie Neil:
@ -68,3 +90,6 @@ fly for messages that have MIME separators and so it's different every time.
getting server abends when I pushed it a bit hard! I eventually had to getting server abends when I pushed it a bit hard! I eventually had to
upgrade to 6.0.4 which seems to be a lot more stable. upgrade to 6.0.4 which seems to be a lot more stable.
=======================================================================

View File

@ -1,4 +1,4 @@
# $Id: INSTALL,v 1.7 2004/01/28 04:00:55 gilles Exp gilles $ # $Id: INSTALL,v 1.8 2005/06/21 01:29:55 gilles Exp gilles $
# #
# INSTALL file for imapsync # INSTALL file for imapsync
# imapsync : IMAP sync or copy tool. # imapsync : IMAP sync or copy tool.
@ -26,7 +26,7 @@ You need :
http://search.cpan.org/~djkernen/ http://search.cpan.org/~djkernen/
http://search.cpan.org/~djkernen/Mail-IMAPClient-2.2.9/ http://search.cpan.org/~djkernen/Mail-IMAPClient-2.2.9/
In fact I use Mail-IMAPClient-2.1.4 (debian package) In fact I use Mail-IMAPClient-2.2.9 (debian package)
To know the version you have on your system try : To know the version you have on your system try :
perl -mMail::IMAPClient -e 'print $Mail::IMAPClient::VERSION, "\n"' perl -mMail::IMAPClient -e 'print $Mail::IMAPClient::VERSION, "\n"'

6
README
View File

@ -2,7 +2,7 @@ NAME
imapsync - IMAP synchronization, copy or migration tool. Synchronize imapsync - IMAP synchronization, copy or migration tool. Synchronize
mailboxes between two imap servers. Good at IMAP migration. mailboxes between two imap servers. Good at IMAP migration.
$Revision: 1.133 $ $Revision: 1.135 $
INSTALL INSTALL
imapsync works fine under any Unix OS. imapsync works fine under any Unix OS.
@ -175,7 +175,7 @@ IMAP SERVERS
- Cyrus IMAP 1.5, 1.6, 2.1, 2.1.15, 2.1.16, 2.1.18 - Cyrus IMAP 1.5, 1.6, 2.1, 2.1.15, 2.1.16, 2.1.18
2.2.1, 2.2.2-BETA, 2.2.10 2.2.1, 2.2.2-BETA, 2.2.10
- DBMail 1.2.1 - DBMail 1.2.1
- Dovecot 0.99.10.4 - Dovecot 0.99.10.4 0.99.14
- Domino (Notes) 6.5, 5.0.6, 5.0.7 - Domino (Notes) 6.5, 5.0.6, 5.0.7
- Groupwise IMAP (Novell). Buggy so see the FAQ. - Groupwise IMAP (Novell). Buggy so see the FAQ.
- iPlanet Messaging server 4.15, 5.1 - iPlanet Messaging server 4.15, 5.1
@ -253,5 +253,5 @@ AUTHOR
teaching free open and gratis softwares. Don't hesitate to pay him for teaching free open and gratis softwares. Don't hesitate to pay him for
that services. that services.
$Id: imapsync,v 1.133 2005/05/21 02:33:29 gilles Exp $ $Id: imapsync,v 1.135 2005/06/21 01:29:44 gilles Exp $

View File

@ -1 +1 @@
1.133 1.135

View File

@ -6,7 +6,7 @@ imapsync - IMAP synchronization, copy or migration
tool. Synchronize mailboxes between two imap servers. Good tool. Synchronize mailboxes between two imap servers. Good
at IMAP migration. at IMAP migration.
$Revision: 1.133 $ $Revision: 1.135 $
=head1 INSTALL =head1 INSTALL
@ -200,7 +200,7 @@ Success stories reported with the following imap servers
- Cyrus IMAP 1.5, 1.6, 2.1, 2.1.15, 2.1.16, 2.1.18 - Cyrus IMAP 1.5, 1.6, 2.1, 2.1.15, 2.1.16, 2.1.18
2.2.1, 2.2.2-BETA, 2.2.10 2.2.1, 2.2.2-BETA, 2.2.10
- DBMail 1.2.1 - DBMail 1.2.1
- Dovecot 0.99.10.4 - Dovecot 0.99.10.4 0.99.14
- Domino (Notes) 6.5, 5.0.6, 5.0.7 - Domino (Notes) 6.5, 5.0.6, 5.0.7
- Groupwise IMAP (Novell). Buggy so see the FAQ. - Groupwise IMAP (Novell). Buggy so see the FAQ.
- iPlanet Messaging server 4.15, 5.1 - iPlanet Messaging server 4.15, 5.1
@ -296,7 +296,7 @@ Gilles LAMIRAL earn his living writing, installing,
configuring and teaching free open and gratis configuring and teaching free open and gratis
softwares. Don't hesitate to pay him for that services. softwares. Don't hesitate to pay him for that services.
$Id: imapsync,v 1.133 2005/05/21 02:33:29 gilles Exp $ $Id: imapsync,v 1.135 2005/06/21 01:29:44 gilles Exp $
=cut =cut
@ -341,34 +341,34 @@ my(
use vars qw ($opt_G); # missing code for this will be option. use vars qw ($opt_G); # missing code for this will be option.
$rcs = ' $Id: imapsync,v 1.133 2005/05/21 02:33:29 gilles Exp $ '; $rcs = ' $Id: imapsync,v 1.135 2005/06/21 01:29:44 gilles Exp $ ';
$rcs =~ m/,v (\d+\.\d+)/; $rcs =~ m/,v (\d+\.\d+)/;
$VERSION = ($1) ? $1 : "UNKNOWN"; $VERSION = ($1) ? $1 : "UNKNOWN";
my $VERSION_IMAPClient = $Mail::IMAPClient::VERSION; my $VERSION_IMAPClient = $Mail::IMAPClient::VERSION;
my $md5_supported = 0; check_lib_version() or
$md5_supported = md5_supported(); die "Upgrade perl lib Mail::IMAPClient to release 2.2.9 at least\n";
$mess_size_total_trans = 0; $mess_size_total_trans = 0;
$mess_size_total_skipped = 0; $mess_size_total_skipped = 0;
$mess_size_total_error = 0; $mess_size_total_error = 0;
$mess_trans = $mess_skipped = 0; $mess_trans = $mess_skipped = 0;
sub md5_supported {
sub check_lib_version {
# before 2.2.6 no md5 native
# I know this is ugly, I should write a sort function # I know this is ugly, I should write a sort function
if ($VERSION_IMAPClient =~ m/(\d+)\.(\d+)\.(\d+)/) { if ($VERSION_IMAPClient =~ m/(\d+)\.(\d+)\.(\d+)/) {
$debug and print "VERSION_IMAPClient $1 $2 $3\n"; $debug and print "VERSION_IMAPClient $1 $2 $3\n";
my($major,$minor,$sub) = ($1, $2, $3); my($major,$minor,$sub) = ($1, $2, $3);
return(1) if($major >=3); return(1) if($major >=3);
return(0) if($major <=1); return(0) if($major <=1);
return(1) if($minor >=3); return(1) if($minor >=3);
return(0) if($minor <=1); return(0) if($minor <=1);
return(1) if($sub >=6); return(1) if($sub >=8);
return(0) if($sub <=5); return(0) if($sub <=7);
}else{ }else{
return 0; # don't match regex => bad return 0; # don't match regex => bad
} }
@ -378,12 +378,11 @@ $error=0;
my $banner = join("", my $banner = join("",
'$RCSfile: imapsync,v $ ', '$RCSfile: imapsync,v $ ',
'$Revision: 1.133 $ ', '$Revision: 1.135 $ ',
'$Date: 2005/05/21 02:33:29 $ ', '$Date: 2005/06/21 01:29:44 $ ',
"\n", "\n",
"Mail::IMAPClient version used here is ", "Mail::IMAPClient version used here is ",
$VERSION_IMAPClient, " auth md5 : $md5_supported", $VERSION_IMAPClient,"\n"
"\n"
); );
unless(defined(&_SYSEXITS_H)) { unless(defined(&_SYSEXITS_H)) {
@ -439,11 +438,6 @@ my $to = ();
my $authmech = "CRAM-MD5"; my $authmech = "CRAM-MD5";
unless ($md5_supported) {
print "Auth $authmech not supported by IMAPClient $VERSION_IMAPClient\n";
}else{
print "Auth $authmech supported by IMAPClient $VERSION_IMAPClient\n";
}
$timestart = time(); $timestart = time();
$timebefore = $timestart; $timebefore = $timestart;
@ -491,9 +485,7 @@ sub login_imap {
sub md5auth() { sub md5auth() {
my ($imap) = @_; my ($imap) = @_;
unless ($md5_supported) {
return;
}
unless ($authmd5) { unless ($authmd5) {
print "$authmech not wanted by you\n"; print "$authmech not wanted by you\n";
return; return;
@ -775,17 +767,17 @@ FOLDER: foreach my $f_fold (@f_folders) {
print "From Buffer I/O : ", $from->Buffer(), "\n"; #print "From Buffer I/O : ", $from->Buffer(), "\n";
print "To Buffer I/O : ", $to->Buffer(), "\n"; #print "To Buffer I/O : ", $to->Buffer(), "\n";
print "++++ From Parse 1 ++++\n"; print "++++ From Parse 1 ++++\n";
my $f_heads = $from->parse_headers($from->Range([@f_msgs]),@useheader) my $f_heads = $from->parse_headers($from->Range([@f_msgs]),@useheader)
if (@f_msgs) ; if (@f_msgs) ;
print "Time headers: ", timenext(), " s\n"; $debug and print "Time headers: ", timenext(), " s\n";
my $f_size = $from->fetch_hash("RFC822.SIZE") if (@f_msgs); my $f_size = $from->fetch_hash("RFC822.SIZE") if (@f_msgs);
print "Time sizes : ", timenext(), " s\n"; $debug and print "Time sizes : ", timenext(), " s\n";
#my $f_flags = $from->flags(@f_msgs) ; #my $f_flags = $from->flags(@f_msgs) ;
#print "Time flags : ", timenext(), " s\n"; #print "Time flags : ", timenext(), " s\n";
use Data::Dumper; use Data::Dumper;
@ -796,24 +788,24 @@ FOLDER: foreach my $f_fold (@f_folders) {
foreach my $m (@f_msgs) { foreach my $m (@f_msgs) {
parse_header_msg1($m, $f_heads, $f_size, "F", \%f_hash); parse_header_msg1($m, $f_heads, $f_size, "F", \%f_hash);
} }
print "Time headers: ", timenext(), " s\n"; $debug and print "Time headers: ", timenext(), " s\n";
print "\n++++ To Parse 1 ++++\n"; print "++++ To Parse 1 ++++\n";
my $t_heads = $to->parse_headers($to->Range([@t_msgs]),@useheader) my $t_heads = $to->parse_headers($to->Range([@t_msgs]),@useheader)
if (@t_msgs); if (@t_msgs);
print "Time headers: ", timenext(), " s\n"; $debug and print "Time headers: ", timenext(), " s\n";
my $t_size = $to->fetch_hash("RFC822.SIZE") if (@t_msgs); my $t_size = $to->fetch_hash("RFC822.SIZE") if (@t_msgs);
print "Time sizes : ", timenext(), " s\n"; $debug and print "Time sizes : ", timenext(), " s\n";
#my $t_flags = $to->flags(@t_msgs) ; #my $t_flags = $to->flags(@t_msgs) ;
#print "Time flags : ", timenext(), " s\n"; #print "Time flags : ", timenext(), " s\n";
foreach my $m (@t_msgs) { foreach my $m (@t_msgs) {
parse_header_msg1($m, $t_heads, $t_size, "T", \%t_hash); parse_header_msg1($m, $t_heads, $t_size, "T", \%t_hash);
} }
print "Time headers: ", timenext(), " s\n"; $debug and print "Time headers: ", timenext(), " s\n";
#exit; #exit;
print "\n++++ Verifying ++++\n"; print "++++ Verifying ++++\n";
# messages in "from" that are not good in "to" # messages in "from" that are not good in "to"
my @f_hash_keys_sorted_by_uid my @f_hash_keys_sorted_by_uid
@ -1154,7 +1146,7 @@ Several options are mandatory.
--(no)foldersizes : Calculate the size of each "From" folder in bytes --(no)foldersizes : Calculate the size of each "From" folder in bytes
and message counts. Meant to be used with and message counts. Meant to be used with
--justconnect. Turned on by default. --justconnect. Turned on by default.
--syncacls : Synchronizes acls. --syncacls : Synchronizes acls (Access Control Lists).
--nosyncacls : Does not synchronize acls. This is the default. --nosyncacls : Does not synchronize acls. This is the default.
--debug : debug mode. --debug : debug mode.
--debugimap : imap debug mode. --debugimap : imap debug mode.
@ -1162,7 +1154,7 @@ Several options are mandatory.
--justconnect : just connect to both servers and print useful --justconnect : just connect to both servers and print useful
information. information.
--justfolders : just do things about folders (ignore messages). --justfolders : just do things about folders (ignore messages).
--fast : be faster. --fast : be faster (does not sync flags).
--timeout <int> : imap connect timeout. --timeout <int> : imap connect timeout.
--help : print this. --help : print this.

View File

@ -1,6 +1,6 @@
#!/bin/sh #!/bin/sh
# $Id: tests.sh,v 1.38 2005/05/20 02:51:33 gilles Exp $ # $Id: tests.sh,v 1.39 2005/06/21 01:29:07 gilles Exp $
#### Shell pragmas #### Shell pragmas
@ -653,7 +653,6 @@ test $# -eq 0 && run_tests \
lp_regextrans2 \ lp_regextrans2 \
foldersizes2 \ foldersizes2 \
foldersizes \ foldersizes \
big_transfert_sizes_only \
regexmess \ regexmess \
useheader \ useheader \