This commit is contained in:
Nick Bebout 2011-03-12 02:43:55 +00:00
parent 5256d44504
commit 1e479e2f94
7 changed files with 79 additions and 13 deletions

View file

@ -1,5 +1,9 @@
#!/bin/cat
Ivan Zilic Schmidt
Made me start the FAQ.
Suggested the --regextrans2 option.
Leon Koch
Gave Microsoft Exchange 2000 server and
Domino IMAP4 Server Release 6.5.1

View file

@ -1,15 +1,19 @@
RCS file: RCS/imapsync,v
Working file: imapsync
head: 1.89
head: 1.90
branch:
locks: strict
access list:
symbolic names:
keyword substitution: kv
total revisions: 89; selected revisions: 89
total revisions: 90; selected revisions: 90
description:
----------------------------
revision 1.90
date: 2004/04/07 18:14:05; author: gilles; state: Exp; lines: +13 -6
Added --regextrans2 option
----------------------------
revision 1.89
date: 2004/03/31 17:37:23; author: gilles; state: Exp; lines: +17 -13
Changed debug output

29
FAQ Normal file
View file

@ -0,0 +1,29 @@
+------------------+
| FAQ for imapsync |
+------------------+
Q. I'm migrating from WU to Cyrus, and the mail folders are
under /home/user/mail but the tool copies everything in
/home/user, how can i avoid that?
R. Use
imapsync ... --include '^mail'
or (better)
imapsync ... --subscribed --subscribe
Q. I'm migrating from WU to Cyrus, and the mail folders are
under /home/user/mail directory. When imapsync creates the
folders in the new cyrus imap server, it makes a folder
"mail" and below that folder puts all the mail folders the
user have in /home/user/mail, i would like to have all those
folders directly under INBOX.
R. Use
imapsync ... --regextrans2 's/^mail/INBOX/' --dry
look at the simulation and if all transformations seem
good then remove the --dry option.

4
README
View file

@ -2,7 +2,7 @@ NAME
imapsync - IMAP sync or copy tool. Synchronize mailboxes between two
imap servers.
$Revision: 1.89 $
$Revision: 1.90 $
INSTALL
imapsync works fine under any Unix OS.
@ -229,5 +229,5 @@ AUTHOR
teaching free open and gratis softwares. Don't hesitate to pay him for
that services.
$Id: imapsync,v 1.89 2004/03/31 17:37:23 gilles Exp $
$Id: imapsync,v 1.90 2004/04/07 18:14:05 gilles Exp $

View file

@ -1 +1 @@
1.89
1.90

View file

@ -4,7 +4,7 @@
imapsync - IMAP sync or copy tool. Synchronize mailboxes between two imap servers.
$Revision: 1.89 $
$Revision: 1.90 $
=head1 INSTALL
@ -269,7 +269,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.89 2004/03/31 17:37:23 gilles Exp $
$Id: imapsync,v 1.90 2004/04/07 18:14:05 gilles Exp $
=cut
@ -288,7 +288,7 @@ my(
$rcs, $debug, $debugimap, $error,
$host1, $host2, $port1, $port2,
$user1, $user2, $password1, $password2, $passfile1, $passfile2,
@folder, $include, $exclude, $prefix2,
@folder, $include, $exclude, $prefix2, $regextrans2,
$sep1, $sep2,
$syncinternaldates,
$maxsize, $maxage,
@ -307,7 +307,7 @@ my(
use vars qw ($opt_G); # missing code for this will be option.
$rcs = ' $Id: imapsync,v 1.89 2004/03/31 17:37:23 gilles Exp $ ';
$rcs = ' $Id: imapsync,v 1.90 2004/04/07 18:14:05 gilles Exp $ ';
$rcs =~ m/,v (\d+\.\d+)/;
$VERSION = ($1) ? $1 : "UNKNOWN";
@ -343,8 +343,8 @@ $error=0;
my $banner = join("",
'$RCSfile: imapsync,v $ ',
'$Revision: 1.89 $ ',
'$Date: 2004/03/31 17:37:23 $ ',
'$Revision: 1.90 $ ',
'$Date: 2004/04/07 18:14:05 $ ',
"\n",
"Mail::IMAPClient version used here is ",
$VERSION_IMAPClient, " auth md5 : $md5_supported",
@ -544,6 +544,7 @@ print
"From subscribed folders : ", map("[$_] ", sort keys(%fs_folders)), "\n";
sub separator_invert {
# The separator we hope we'll never encounter
my $o_sep="\000";
my($f_fold, $f_sep, $t_sep) = @_;
@ -560,6 +561,10 @@ FOLDER: foreach my $f_fold (@f_folders) {
print "From Folder [$f_fold]\n";
$t_fold = separator_invert($f_fold,$f_sep, $t_sep);
if ($regextrans2) {
$debug and print "eval \$t_fold =~ $regextrans2\n";
eval("\$t_fold =~ $regextrans2");
}
$t_fold = $prefix2 . $t_fold if ($prefix2);
print "To Folder [$t_fold]\n";
@ -763,6 +768,7 @@ sub get_options
"include=s" => \$include,
"exclude=s" => \$exclude,
"prefix2=s" => \$prefix2,
"regextrans2=s" => \$regextrans2,
"delete!" => \$delete,
"syncinternaldates!" => \$syncinternaldates,
"maxsize=i" => \$maxsize,
@ -869,6 +875,7 @@ Several options are mandatory.
is specified)
--prefix2 <string> : add prefix to all destination folders
(usually INBOX. for cyrus imap servers)
--regextrans2 <regex> : Apply the whole regex to each destination folders.
--sep1 <char> : separator in case namespace is not supported.
--sep2 <char> : idem.
--delete : delete messages in "from" imap server after

View file

@ -1,8 +1,11 @@
#!/bin/sh
# $Id: tests.sh,v 1.16 2004/03/21 23:24:42 gilles Exp $
# $Id: tests.sh,v 1.17 2004/04/07 18:13:29 gilles Exp $
# $Log: tests.sh,v $
# Revision 1.17 2004/04/07 18:13:29 gilles
# Added lp_regextrans2()
#
# Revision 1.16 2004/03/21 23:24:42 gilles
# Added
# lp_skipsize()
@ -379,6 +382,24 @@ lp_include()
fi
}
lp_regextrans2()
{
sendtestmessage
if test X`hostname` = X"plume"; then
echo3 Here is plume
./imapsync \
--host2 plume --user2 tata@est.belle \
--passfile2 /var/tmp/secret.tata \
--host1 loul --user1 tata \
--passfile1 /var/tmp/secret.tata \
--regextrans2 's/yop/yopX/' --dry
else
:
fi
}
bad_login()
{
! ./imapsync \
@ -427,7 +448,8 @@ test $# -eq 0 && run_tests \
bad_host \
lp_noauthmd5 \
lp_skipsize \
lp_skipheader
lp_skipheader \
lp_regextrans2
# selective tests