mirror of
https://github.com/imapsync/imapsync.git
synced 2025-07-31 06:16:08 +02:00
1.96
This commit is contained in:
parent
a4913ee70d
commit
2e6098e2f0
7 changed files with 84 additions and 984 deletions
77
imapsync
77
imapsync
|
@ -5,7 +5,7 @@
|
|||
imapsync - IMAP sync or copy tool. Synchronize mailboxes
|
||||
between two imap servers.
|
||||
|
||||
$Revision: 1.95 $
|
||||
$Revision: 1.96 $
|
||||
|
||||
=head1 INSTALL
|
||||
|
||||
|
@ -272,7 +272,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.95 2004/07/08 23:31:53 gilles Exp $
|
||||
$Id: imapsync,v 1.96 2004/07/09 09:08:43 gilles Exp $
|
||||
|
||||
=cut
|
||||
|
||||
|
@ -313,7 +313,7 @@ my(
|
|||
use vars qw ($opt_G); # missing code for this will be option.
|
||||
|
||||
|
||||
$rcs = ' $Id: imapsync,v 1.95 2004/07/08 23:31:53 gilles Exp $ ';
|
||||
$rcs = ' $Id: imapsync,v 1.96 2004/07/09 09:08:43 gilles Exp $ ';
|
||||
$rcs =~ m/,v (\d+\.\d+)/;
|
||||
$VERSION = ($1) ? $1 : "UNKNOWN";
|
||||
|
||||
|
@ -350,8 +350,8 @@ $error=0;
|
|||
|
||||
my $banner = join("",
|
||||
'$RCSfile: imapsync,v $ ',
|
||||
'$Revision: 1.95 $ ',
|
||||
'$Date: 2004/07/08 23:31:53 $ ',
|
||||
'$Revision: 1.96 $ ',
|
||||
'$Date: 2004/07/09 09:08:43 $ ',
|
||||
"\n",
|
||||
"Mail::IMAPClient version used here is ",
|
||||
$VERSION_IMAPClient, " auth md5 : $md5_supported",
|
||||
|
@ -536,37 +536,38 @@ sub get_separator {
|
|||
print "From separator : [$f_sep]\n";
|
||||
print "To separator : [$t_sep]\n";
|
||||
|
||||
if ($foldersizes)
|
||||
{
|
||||
my $tot = 0;
|
||||
my $tmess = 0;
|
||||
print "Calculating sizes...\n";
|
||||
foreach my $f_fold (@f_folders)
|
||||
{
|
||||
print "From Folder [$f_fold]\n";
|
||||
my $stot = 0;
|
||||
my $smess = 0;
|
||||
unless ($from->select($f_fold)) {
|
||||
warn
|
||||
"From Folder $f_fold : Could not select ",
|
||||
$from->LastError, "\n";
|
||||
$error++;
|
||||
next;
|
||||
if ($foldersizes) {
|
||||
my $tot = 0;
|
||||
my $tmess = 0;
|
||||
print "Calculating sizes...\n";
|
||||
foreach my $f_fold (@f_folders) {
|
||||
print "From Folder [$f_fold]\n";
|
||||
my $stot = 0;
|
||||
my $smess = 0;
|
||||
unless ($from->select($f_fold)) {
|
||||
warn
|
||||
"From Folder $f_fold : Could not select ",
|
||||
$from->LastError, "\n";
|
||||
$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;
|
||||
}
|
||||
my $szs = $from->fetch_hash("RFC822.SIZE") || (warn("Can't get sizes for $f_fold: ",$from->LastError),$error++,next);
|
||||
my ($k,$v);
|
||||
while (($k,$v) = each(%$szs))
|
||||
{
|
||||
$stot += $v->{'RFC822.SIZE'};
|
||||
$smess++;
|
||||
}
|
||||
print "Size of $f_fold: $stot\n";
|
||||
print "Messages in $f_fold: $smess\n";
|
||||
$tot += $stot;
|
||||
$tmess += $smess;
|
||||
}
|
||||
print "Total size: $tot\n";
|
||||
print "Total messages: $tmess\n";
|
||||
print "Total size: $tot\n";
|
||||
print "Total messages: $tmess\n";
|
||||
}
|
||||
|
||||
exit if ($justconnect);
|
||||
|
@ -601,10 +602,14 @@ FOLDER: foreach my $f_fold (@f_folders) {
|
|||
print "From Folder [$f_fold]\n";
|
||||
|
||||
$t_fold = separator_invert($f_fold,$f_sep, $t_sep);
|
||||
|
||||
# Transforming the folder name by the --regextrans2 option
|
||||
if ($regextrans2) {
|
||||
$debug and print "eval \$t_fold =~ $regextrans2\n";
|
||||
eval("\$t_fold =~ $regextrans2");
|
||||
}
|
||||
|
||||
# Adding the prefix supplied by the --prefix2 option
|
||||
$t_fold = $prefix2 . $t_fold if ($prefix2);
|
||||
print "To Folder [$t_fold]\n";
|
||||
|
||||
|
@ -659,7 +664,7 @@ FOLDER: foreach my $f_fold (@f_folders) {
|
|||
|
||||
my %f_hash = ();
|
||||
my %t_hash = ();
|
||||
|
||||
|
||||
$debug and print "++++ From Parse ++++\n";
|
||||
foreach my $m (@f_msgs) {
|
||||
parse_header_msg($m, $from, "F", \%f_hash);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue