mirror of
https://github.com/imapsync/imapsync.git
synced 2025-06-06 20:55:29 +02:00
1.102
This commit is contained in:
parent
ce78978b44
commit
8eaed02a04
9 changed files with 6593565 additions and 33 deletions
4
CREDITS
4
CREDITS
|
@ -1,5 +1,9 @@
|
|||
#!/bin/cat
|
||||
|
||||
|
||||
Bryce Walter
|
||||
Gave "OpenWave to Imail 8.12"
|
||||
|
||||
David Alix
|
||||
Suggested order message transfer by uid.
|
||||
Gave "Simeon Messaging Server from MessagingDirect" and
|
||||
|
|
16
ChangeLog
16
ChangeLog
|
@ -1,15 +1,27 @@
|
|||
|
||||
RCS file: RCS/imapsync,v
|
||||
Working file: imapsync
|
||||
head: 1.99
|
||||
head: 1.102
|
||||
branch:
|
||||
locks: strict
|
||||
access list:
|
||||
symbolic names:
|
||||
keyword substitution: kv
|
||||
total revisions: 99; selected revisions: 99
|
||||
total revisions: 102; selected revisions: 102
|
||||
description:
|
||||
----------------------------
|
||||
revision 1.102
|
||||
date: 2004/10/15 14:41:25; author: gilles; state: Exp; lines: +36 -21
|
||||
Add use of fetch_hash() in foldersizes counting.
|
||||
----------------------------
|
||||
revision 1.101
|
||||
date: 2004/10/12 15:17:37; author: gilles; state: Exp; lines: +7 -6
|
||||
Added OpenWave
|
||||
----------------------------
|
||||
revision 1.100
|
||||
date: 2004/10/08 00:57:33; author: gilles; state: Exp; lines: +33 -12
|
||||
Added time infos
|
||||
----------------------------
|
||||
revision 1.99
|
||||
date: 2004/10/04 18:42:40; author: gilles; state: Exp; lines: +15 -8
|
||||
Added explanation about --skipheader option :
|
||||
|
|
7
README
7
README
|
@ -2,7 +2,7 @@ NAME
|
|||
imapsync - IMAP synchronization, copy or migration tool. Synchronize
|
||||
mailboxes between two imap servers. Good at IMAP migration.
|
||||
|
||||
$Revision: 1.99 $
|
||||
$Revision: 1.102 $
|
||||
|
||||
INSTALL
|
||||
imapsync works fine under any Unix OS.
|
||||
|
@ -170,9 +170,10 @@ IMAP SERVERS
|
|||
- Dovecot 0.99.10.4
|
||||
- Domino (Notes) 6.5, 5.0.6
|
||||
- iPlanet Messaging server 4.15, 5.1
|
||||
- IMail 7.15 (Ipswitch/Win2003)
|
||||
- IMail 7.15 (Ipswitch/Win2003), 8.12
|
||||
- MS Exchange Server 5.5
|
||||
- Netscape Mail Server 3.6 (Wintel !)
|
||||
- OpenWave
|
||||
- SunONE Messaging server 5.2, 6.0 (SUN JES - Java Enterprise System)
|
||||
- UW-imap servers (imap-2000b) rijkkramer IMAP4rev1 2000.287
|
||||
(RedHat uses UW like 2003.338rh)
|
||||
|
@ -237,5 +238,5 @@ AUTHOR
|
|||
teaching free open and gratis softwares. Don't hesitate to pay him for
|
||||
that services.
|
||||
|
||||
$Id: imapsync,v 1.99 2004/10/04 18:42:40 gilles Exp $
|
||||
$Id: imapsync,v 1.102 2004/10/15 14:41:25 gilles Exp $
|
||||
|
||||
|
|
2
VERSION
2
VERSION
|
@ -1 +1 @@
|
|||
1.99
|
||||
1.102
|
||||
|
|
516
big_transfert.log
Normal file
516
big_transfert.log
Normal file
File diff suppressed because one or more lines are too long
55096
big_transfert.log.s1
Normal file
55096
big_transfert.log.s1
Normal file
File diff suppressed because one or more lines are too long
85
imapsync
85
imapsync
|
@ -6,7 +6,7 @@ imapsync - IMAP synchronization, copy or migration
|
|||
tool. Synchronize mailboxes between two imap servers. Good
|
||||
at IMAP migration.
|
||||
|
||||
$Revision: 1.99 $
|
||||
$Revision: 1.102 $
|
||||
|
||||
=head1 INSTALL
|
||||
|
||||
|
@ -128,7 +128,6 @@ the best solution.
|
|||
imasync is not protected against sniffers on the network so
|
||||
the passwords are in plain text.
|
||||
|
||||
|
||||
=head1 EXIT STATUS
|
||||
|
||||
imapsync will exit with a 0 status (return code) if everything went good.
|
||||
|
@ -196,9 +195,10 @@ Success stories reported (softwares in alphabetic order) :
|
|||
- Dovecot 0.99.10.4
|
||||
- Domino (Notes) 6.5, 5.0.6
|
||||
- iPlanet Messaging server 4.15, 5.1
|
||||
- IMail 7.15 (Ipswitch/Win2003)
|
||||
- IMail 7.15 (Ipswitch/Win2003), 8.12
|
||||
- MS Exchange Server 5.5
|
||||
- Netscape Mail Server 3.6 (Wintel !)
|
||||
- OpenWave
|
||||
- SunONE Messaging server 5.2, 6.0 (SUN JES - Java Enterprise System)
|
||||
- UW-imap servers (imap-2000b) rijkkramer IMAP4rev1 2000.287
|
||||
(RedHat uses UW like 2003.338rh)
|
||||
|
@ -280,7 +280,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.99 2004/10/04 18:42:40 gilles Exp $
|
||||
$Id: imapsync,v 1.102 2004/10/15 14:41:25 gilles Exp $
|
||||
|
||||
=cut
|
||||
|
||||
|
@ -315,13 +315,14 @@ my(
|
|||
$mess_trans, $mess_skipped,
|
||||
$timeout, # whr (ESS/PRW)
|
||||
$timestart, $timeend, $timediff,
|
||||
$timesize, $timebefore,
|
||||
|
||||
);
|
||||
|
||||
use vars qw ($opt_G); # missing code for this will be option.
|
||||
|
||||
|
||||
$rcs = ' $Id: imapsync,v 1.99 2004/10/04 18:42:40 gilles Exp $ ';
|
||||
$rcs = ' $Id: imapsync,v 1.102 2004/10/15 14:41:25 gilles Exp $ ';
|
||||
$rcs =~ m/,v (\d+\.\d+)/;
|
||||
$VERSION = ($1) ? $1 : "UNKNOWN";
|
||||
|
||||
|
@ -358,8 +359,8 @@ $error=0;
|
|||
|
||||
my $banner = join("",
|
||||
'$RCSfile: imapsync,v $ ',
|
||||
'$Revision: 1.99 $ ',
|
||||
'$Date: 2004/10/04 18:42:40 $ ',
|
||||
'$Revision: 1.102 $ ',
|
||||
'$Date: 2004/10/15 14:41:25 $ ',
|
||||
"\n",
|
||||
"Mail::IMAPClient version used here is ",
|
||||
$VERSION_IMAPClient, " auth md5 : $md5_supported",
|
||||
|
@ -408,6 +409,7 @@ unless ($md5_supported) {
|
|||
}
|
||||
|
||||
$timestart = time();
|
||||
$timebefore = $timestart;
|
||||
|
||||
$debugimap and print "From connection\n";
|
||||
$from = login_imap($host1, $port1, $user1, $password1, $debugimap, $timeout);
|
||||
|
@ -422,6 +424,7 @@ sub login_imap {
|
|||
$imap->Server($host);
|
||||
$imap->Port($port);
|
||||
$imap->Fast_io(1);
|
||||
$imap->Buffer(65536);
|
||||
$imap->Uid(1);
|
||||
$imap->Peek(1);
|
||||
$imap->Debug($debugimap);
|
||||
|
@ -559,23 +562,52 @@ if ($foldersizes) {
|
|||
$error++;
|
||||
next;
|
||||
}
|
||||
my @f_msgs = $maxage
|
||||
? $from->since(time - 86400 * $maxage)
|
||||
: $from->search("ALL");
|
||||
foreach my $m (@f_msgs) {
|
||||
my $s = $from->size($m)
|
||||
or warn "Could not find size of message $m: $@\n";
|
||||
$stot += $s;
|
||||
$smess++;
|
||||
}
|
||||
|
||||
print "Size of $f_fold: $stot\n";
|
||||
print "Messages in $f_fold: $smess\n";
|
||||
$tot += $stot;
|
||||
$tmess += $smess;
|
||||
if ($maxage) {
|
||||
my @f_msgs = $maxage
|
||||
? $from->since(time - 86400 * $maxage)
|
||||
: $from->search("ALL");
|
||||
my $smess2 = scalar(@f_msgs);
|
||||
print "Messages in $f_fold: $smess2\n";
|
||||
foreach my $m (@f_msgs) {
|
||||
my $s = $from->size($m)
|
||||
or warn "Could not find size of message $m: $@\n";
|
||||
$stot += $s;
|
||||
$smess++;
|
||||
print ".";
|
||||
}
|
||||
print "\n";
|
||||
print "Size of $f_fold: $stot\n";
|
||||
print "Messages in $f_fold: $smess\n";
|
||||
$tot += $stot;
|
||||
$tmess += $smess;
|
||||
}else{
|
||||
my $hashref = {};
|
||||
my $stot2 = 0;
|
||||
my $smess2 = $from->message_count();
|
||||
unless ($smess2 == 0) {
|
||||
$from->fetch_hash("RFC822.SIZE",$hashref);
|
||||
#print map {$hashref->{$_}->{"RFC822.SIZE"}, " "} keys %$hashref;
|
||||
map {$stot2 += $hashref->{$_}->{"RFC822.SIZE"}} keys %$hashref;
|
||||
}
|
||||
print "Size of $f_fold: $stot2\n";
|
||||
$tot += $stot2;
|
||||
$tmess += $smess2;
|
||||
}
|
||||
}
|
||||
print "Total size: $tot\n";
|
||||
print "Total messages: $tmess\n";
|
||||
print "Time : ", timenext(), " s\n";
|
||||
|
||||
}
|
||||
|
||||
sub timenext {
|
||||
my ($timenow, $timerel);
|
||||
# $timebefore is global, beurk !
|
||||
$timenow = time;
|
||||
$timerel = $timenow - $timebefore;
|
||||
$timebefore = $timenow;
|
||||
return($timerel);
|
||||
}
|
||||
|
||||
exit if ($justconnect);
|
||||
|
@ -673,16 +705,19 @@ FOLDER: foreach my $f_fold (@f_folders) {
|
|||
my %f_hash = ();
|
||||
my %t_hash = ();
|
||||
|
||||
$debug and print "++++ From Parse ++++\n";
|
||||
print "++++ From Parse ++++\n";
|
||||
foreach my $m (@f_msgs) {
|
||||
print ".";
|
||||
parse_header_msg($m, $from, "F", \%f_hash);
|
||||
}
|
||||
|
||||
$debug and print "++++ To Parse ++++\n";
|
||||
print "Time : ", timenext(), " s\n";
|
||||
print "\n++++ To Parse ++++\n";
|
||||
foreach my $m (@t_msgs) {
|
||||
print ".";
|
||||
parse_header_msg($m, $to, "T", \%t_hash);
|
||||
}
|
||||
$debug and print "++++ Verifying ++++\n";
|
||||
print "Time : ", timenext(), " s\n";
|
||||
print "\n++++ Verifying ++++\n";
|
||||
# messages in "from" that are not good in "to"
|
||||
|
||||
my @f_hash_keys_sorted_by_uid
|
||||
|
@ -693,6 +728,7 @@ FOLDER: foreach my $f_fold (@f_folders) {
|
|||
MESS: foreach my $m_id (@f_hash_keys_sorted_by_uid) {
|
||||
my $f_size = $f_hash{$m_id}{'s'};
|
||||
my $f_msg = $f_hash{$m_id}{'m'};
|
||||
print ".";
|
||||
if (defined $maxsize and $f_size > $maxsize) {
|
||||
print "+ Skipping msg #$f_msg:$f_size in folder $f_fold (exceeds maxsize limit $maxsize bytes)\n";
|
||||
$mess_size_total_skipped += $f_msg;
|
||||
|
@ -788,6 +824,7 @@ FOLDER: foreach my $f_fold (@f_folders) {
|
|||
}
|
||||
}
|
||||
}
|
||||
print "Time : ", timenext(), " s\n";
|
||||
}
|
||||
|
||||
$timeend = time();
|
||||
|
|
48
tests.sh
48
tests.sh
|
@ -1,8 +1,14 @@
|
|||
#!/bin/sh
|
||||
|
||||
# $Id: tests.sh,v 1.23 2004/09/07 00:38:36 gilles Exp $
|
||||
# $Id: tests.sh,v 1.25 2004/10/15 14:40:05 gilles Exp $
|
||||
|
||||
# $Log: tests.sh,v $
|
||||
# Revision 1.25 2004/10/15 14:40:05 gilles
|
||||
# Added big_transfert_sizes_only()
|
||||
#
|
||||
# Revision 1.24 2004/10/12 21:18:10 gilles
|
||||
# Added big_transfert2()
|
||||
#
|
||||
# Revision 1.23 2004/09/07 00:38:36 gilles
|
||||
# Added noauthmd5 to first_sync test
|
||||
#
|
||||
|
@ -483,13 +489,49 @@ big_transfert()
|
|||
--passfile1 /var/tmp/secret \
|
||||
--host2 plume --user2 tete@est.belle \
|
||||
--passfile2 /var/tmp/secret.tete \
|
||||
--subscribed || \
|
||||
--subscribed --foldersizes --noauthmd5 || \
|
||||
true
|
||||
}
|
||||
date2=`date`
|
||||
echo3 $date1 $date2
|
||||
echo3 "[$date1] [$date2]"
|
||||
}
|
||||
|
||||
big_transfert_sizes_only()
|
||||
{
|
||||
date1=`date`
|
||||
{ ./imapsync \
|
||||
--host1 louloutte --user1 gilles \
|
||||
--passfile1 /var/tmp/secret \
|
||||
--host2 plume --user2 tete@est.belle \
|
||||
--passfile2 /var/tmp/secret.tete \
|
||||
--subscribed --foldersizes --noauthmd5 \
|
||||
--justconnect || \
|
||||
true
|
||||
}
|
||||
date2=`date`
|
||||
echo3 "[$date1] [$date2]"
|
||||
}
|
||||
|
||||
|
||||
|
||||
big_transfert2()
|
||||
{
|
||||
date1=`date`
|
||||
{ perl -d:DProf ./imapsync \
|
||||
--host1 louloutte --user1 gilles \
|
||||
--passfile1 /var/tmp/secret \
|
||||
--host2 plume --user2 tete@est.belle \
|
||||
--passfile2 /var/tmp/secret.tete \
|
||||
--subscribed --foldersizes --noauthmd5 \
|
||||
--folder INBOX.Backup_ASK || \
|
||||
true
|
||||
}
|
||||
date2=`date`
|
||||
echo3 "[$date1] [$date2]"
|
||||
dprofpp tmon.out
|
||||
}
|
||||
|
||||
|
||||
# mandatory tests
|
||||
|
||||
run_tests perl_syntax
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue