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:30 +00:00
parent 8b519bfc5f
commit 068b792ce6
6 changed files with 64 additions and 28 deletions

View File

@ -7,6 +7,10 @@ http://www.amazon.com/gp/registry/wishlist/1C9UNDIH3P7R7/
I thank very much all of these people. I thank very much all of these people.
Jalal
Found --include and --include unuseful
Wrote --include or --include patch
Daniel Ammann Daniel Ammann
Made me finally write the --folderrec option. Made me finally write the --folderrec option.
Gave OpenMail to Cyrus success Gave OpenMail to Cyrus success

View File

@ -1,15 +1,26 @@
RCS file: RCS/imapsync,v RCS file: RCS/imapsync,v
Working file: imapsync Working file: imapsync
head: 1.195 head: 1.197
branch: branch:
locks: strict locks: strict
access list: access list:
symbolic names: symbolic names:
keyword substitution: kv keyword substitution: kv
total revisions: 195; selected revisions: 195 total revisions: 197; selected revisions: 197
description: description:
---------------------------- ----------------------------
revision 1.197
date: 2006/12/10 02:49:39; author: gilles; state: Exp; lines: +7 -10
Updated online documantation about new
--include and --exclude behavior
----------------------------
revision 1.196
date: 2006/12/10 02:41:37; author: gilles; state: Exp; lines: +21 -15
- Now IO::Socket::SSL is loaded only with -ssl*
- multiple --include are taken like a "or" list ,
not an "and" list.
----------------------------
revision 1.195 revision 1.195
date: 2006/12/08 04:48:54; author: gilles; state: Exp; lines: +10 -8 date: 2006/12/08 04:48:54; author: gilles; state: Exp; lines: +10 -8
Added OpenMail success Added OpenMail success

4
README
View File

@ -3,7 +3,7 @@ NAME
Synchronise mailboxes between two imap servers. Good at IMAP migration. Synchronise mailboxes between two imap servers. Good at IMAP migration.
More than 25 different IMAP server softwares supported with success. More than 25 different IMAP server softwares supported with success.
$Revision: 1.195 $ $Revision: 1.197 $
INSTALL INSTALL
imapsync works fine under any Unix OS. imapsync works fine under any Unix OS.
@ -297,5 +297,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.195 2006/12/08 04:48:54 gilles Exp $ $Id: imapsync,v 1.197 2006/12/10 02:49:39 gilles Exp $

View File

@ -1 +1 @@
1.195 1.197

View File

@ -7,7 +7,7 @@ tool. Synchronise mailboxes between two imap servers. Good
at IMAP migration. More than 25 different IMAP server softwares at IMAP migration. More than 25 different IMAP server softwares
supported with success. supported with success.
$Revision: 1.195 $ $Revision: 1.197 $
=head1 INSTALL =head1 INSTALL
@ -347,7 +347,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.195 2006/12/08 04:48:54 gilles Exp $ $Id: imapsync,v 1.197 2006/12/10 02:49:39 gilles Exp $
=cut =cut
@ -358,8 +358,7 @@ use Getopt::Long;
use Mail::IMAPClient; use Mail::IMAPClient;
use Digest::MD5 qw(md5_base64); use Digest::MD5 qw(md5_base64);
use Term::ReadKey; use Term::ReadKey;
#use Digest::HMAC_MD5; #use IO::Socket::SSL;
use IO::Socket::SSL;
use MIME::Base64; use MIME::Base64;
use English; use English;
use POSIX qw(uname); use POSIX qw(uname);
@ -404,7 +403,7 @@ 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.195 2006/12/08 04:48:54 gilles Exp $ '; $rcs = ' $Id: imapsync,v 1.197 2006/12/10 02:49:39 gilles Exp $ ';
$rcs =~ m/,v (\d+\.\d+)/; $rcs =~ m/,v (\d+\.\d+)/;
$VERSION = ($1) ? $1 : "UNKNOWN"; $VERSION = ($1) ? $1 : "UNKNOWN";
@ -441,8 +440,8 @@ $error=0;
my $banner = join("", my $banner = join("",
'$RCSfile: imapsync,v $ ', '$RCSfile: imapsync,v $ ',
'$Revision: 1.195 $ ', '$Revision: 1.197 $ ',
'$Date: 2006/12/08 04:48:54 $ ', '$Date: 2006/12/10 02:49:39 $ ',
"\n", "\n",
"Mail::IMAPClient version used here is ", "Mail::IMAPClient version used here is ",
$VERSION_IMAPClient,"\n" $VERSION_IMAPClient,"\n"
@ -586,6 +585,7 @@ sub login_imap {
$ssl, $authmech, $authuser) = @_; $ssl, $authmech, $authuser) = @_;
my ($imap); my ($imap);
if ($ssl) { if ($ssl) {
require IO::Socket::SSL;
my $socssl = new IO::Socket::SSL("$host:$port"); my $socssl = new IO::Socket::SSL("$host:$port");
die "Error connecting to $host:$port: $@\n" unless $socssl; die "Error connecting to $host:$port: $@\n" unless $socssl;
$socssl->autoflush(1); $socssl->autoflush(1);
@ -693,18 +693,24 @@ if (scalar(@folder) or $subscribed or scalar(@folderrec)) {
}else { }else {
# no folder/subscribed/folderrec options => all folders # no folder/subscribed/folderrec options => all folders
@f_folders = sort $from->folders(); @f_folders = sort $from->folders();
# consider (optional) includes and excludes
# WARNING the following two loops are bad with more than one pass.
foreach my $include (@include) {
@f_folders = grep /$include/,@f_folders;
print "Only including folders matching pattern '$include'\n";
}
foreach my $exclude (@exclude) {
@f_folders = grep !/$exclude/,@f_folders;
print "Excluding folders matching pattern '$exclude'\n";
}
} }
# consider (optional) includes and excludes
if (scalar(@include)) {
my @f_folders_inc;
foreach my $include (@include) {
push(@f_folders_inc, grep /$include/, @f_folders);
print "Including folders matching pattern '$include'\n";
}
@f_folders = sort @f_folders_inc;
}
foreach my $exclude (@exclude) {
@f_folders = grep !/$exclude/,@f_folders;
print "Excluding folders matching pattern '$exclude'\n";
}
@t_folders = sort @{$to->folders()}; @t_folders = sort @{$to->folders()};
my($f_sep,$t_sep); my($f_sep,$t_sep);
@ -1428,14 +1434,11 @@ Several options are mandatory.
--folderrec <string> : sync only this folder recursively. --folderrec <string> : sync only this folder recursively.
--folderrec <string> : and this one, etc. --folderrec <string> : and this one, etc.
--include <regex> : only sync folders matching this regular expression --include <regex> : only sync folders matching this regular expression
(only effective if neither --folder nor --subscribed --include <regex> : or this one, etc.
is specified).
--include <regex> : and this one, etc.
in case both --include --exclude options are in case both --include --exclude options are
use, include is done before. use, include is done before.
--exclude <regex> : skips folders matching this regular expression --exclude <regex> : skips folders matching this regular expression
(only effective if neither --folder nor --subscribed Several folders to avoid:
is specified). Several folders to avoid:
--exclude 'fold1|fold2|f3' skips fold1, fold2 and f3. --exclude 'fold1|fold2|f3' skips fold1, fold2 and f3.
--exclude <regex> : and this one, etc. --exclude <regex> : and this one, etc.
--prefix1 <string> : remove prefix to all destination folders --prefix1 <string> : remove prefix to all destination folders

View File

@ -1,6 +1,6 @@
#!/bin/sh #!/bin/sh
# $Id: tests.sh,v 1.56 2006/12/08 04:05:01 gilles Exp $ # $Id: tests.sh,v 1.57 2006/12/10 02:48:14 gilles Exp gilles $
#### Shell pragmas #### Shell pragmas
@ -61,6 +61,8 @@ no_args() {
# tata@est.belle # used on locallocal() # tata@est.belle # used on locallocal()
# tata titi on most ll_*() tests
# tutu@est.belle # not used # tutu@est.belle # not used
# tete@est.belle # used on big size tests # tete@est.belle # used on big size tests
@ -629,6 +631,22 @@ ll_delete2() {
fi fi
} }
ll_bigmail() {
if test X`hostname` = X"plume"; then
echo3 Here is plume
./imapsync \
--host1 localhost --user1 tata@est.belle \
--passfile1 /var/tmp/secret.tata \
--host2 localhost --user2 titi@est.belle \
--passfile2 /var/tmp/secret.titi \
--folder INBOX.bigmail
else
:
fi
}
########################## ##########################
# specific tests # specific tests
########################## ##########################