mirror of
https://github.com/imapsync/imapsync.git
synced 2025-06-06 20:55:29 +02:00
1.10
This commit is contained in:
parent
7876dbe7a4
commit
e3723130d5
9 changed files with 109 additions and 37 deletions
20
ChangeLog
20
ChangeLog
|
@ -1,17 +1,29 @@
|
|||
|
||||
RCS file: RCS/imapsync,v
|
||||
Working file: imapsync
|
||||
head: 1.7
|
||||
head: 1.10
|
||||
branch:
|
||||
locks: strict
|
||||
gilles: 1.7
|
||||
access list:
|
||||
symbolic names:
|
||||
keyword substitution: kv
|
||||
total revisions: 7; selected revisions: 7
|
||||
total revisions: 10; selected revisions: 10
|
||||
description:
|
||||
----------------------------
|
||||
revision 1.7 locked by: gilles;
|
||||
revision 1.10
|
||||
date: 2003/05/05 22:37:48; author: gilles; state: Exp; lines: +5 -5
|
||||
Updated --folder documentation.
|
||||
----------------------------
|
||||
revision 1.9
|
||||
date: 2003/05/05 22:33:50; author: gilles; state: Exp; lines: +8 -7
|
||||
Commented INBOX prefix addition (cyrus "buggy" namespace)
|
||||
----------------------------
|
||||
revision 1.8
|
||||
date: 2003/05/05 21:05:14; author: gilles; state: Exp; lines: +20 -4
|
||||
When folders are given with the --folder option then nested are
|
||||
also taken into account.
|
||||
----------------------------
|
||||
revision 1.7
|
||||
date: 2003/03/15 03:40:54; author: gilles; state: Exp; lines: +19 -9
|
||||
Added documentation.
|
||||
----------------------------
|
||||
|
|
27
INSTALL
27
INSTALL
|
@ -1,4 +1,4 @@
|
|||
# $Id: INSTALL,v 1.2 2003/03/15 03:41:31 gilles Exp gilles $
|
||||
# $Id: INSTALL,v 1.4 2003/05/05 22:42:51 gilles Exp $
|
||||
#
|
||||
# INSTALL file for ftpsync
|
||||
|
||||
|
@ -19,6 +19,18 @@ You need :
|
|||
try : perl -mMail::IMAPClient -e ''
|
||||
|
||||
|
||||
INSTALLING
|
||||
----------
|
||||
To see what will be done, just run:
|
||||
|
||||
make -n install
|
||||
|
||||
To install imapsync, just run:
|
||||
|
||||
make install
|
||||
|
||||
or copy the file imapsync where you want it to be.
|
||||
|
||||
TESTING
|
||||
-------
|
||||
|
||||
|
@ -32,14 +44,7 @@ sh tests.sh
|
|||
|
||||
The tests.sh script break on first failure ("set -e" directive).
|
||||
|
||||
INSTALLING
|
||||
----------
|
||||
To see what will be done, just run:
|
||||
Since I added more tests you also need a remote imap server see the
|
||||
file tests.sh and help yourself. No time to make a universal test
|
||||
file.
|
||||
|
||||
make -n install
|
||||
|
||||
To install imapsync, just run:
|
||||
|
||||
make install
|
||||
|
||||
or copy the file imapsync where you want it to be.
|
||||
|
|
3
Makefile
3
Makefile
|
@ -1,5 +1,5 @@
|
|||
|
||||
# $Id: Makefile,v 1.2 2003/03/14 02:25:27 gilles Exp gilles $
|
||||
# $Id: Makefile,v 1.3 2003/05/05 22:55:25 gilles Exp $
|
||||
|
||||
TARGET=imapsync
|
||||
|
||||
|
@ -90,3 +90,4 @@ lfo: dist
|
|||
/home/gilles/public_html/www.linux-france.org/html/prj/$(TARGET)/
|
||||
sh ~/memo/lfo-rsync
|
||||
|
||||
|
||||
|
|
4
README
4
README
|
@ -1,7 +1,7 @@
|
|||
NAME
|
||||
imapsync - synchronize mailboxes between two imap servers.
|
||||
|
||||
$Revision: 1.7 $
|
||||
$Revision: 1.10 $
|
||||
|
||||
INSTALL
|
||||
Get imapsync at http://www.linux-france.org/prj/imapsync/dist/
|
||||
|
@ -98,5 +98,5 @@ BUGS
|
|||
SIMILAR SOFTWARES
|
||||
None known. Feedback will be welcome.
|
||||
|
||||
$Id: imapsync,v 1.7 2003/03/15 03:40:54 gilles Exp gilles $
|
||||
$Id: imapsync,v 1.10 2003/05/05 22:37:48 gilles Exp $
|
||||
|
||||
|
|
9
TODO
Normal file
9
TODO
Normal file
|
@ -0,0 +1,9 @@
|
|||
|
||||
Add SASL support MD5 : DIGEST-MD5 and CRAM-MD5
|
||||
see authenticate in IMAPClient.pm
|
||||
|
||||
Tested on
|
||||
> The source imap server runs Cyrus imapd 1.6.22,
|
||||
> the destination one Cyrus imapd 2.1.12.
|
||||
by Per Steinar Iversen <PerSteinar.Iversen@adm.hio.no>
|
||||
|
2
VERSION
2
VERSION
|
@ -1 +1 @@
|
|||
1.7
|
||||
1.10
|
||||
|
|
37
imapsync
37
imapsync
|
@ -4,7 +4,7 @@
|
|||
|
||||
imapsync - synchronize mailboxes between two imap servers.
|
||||
|
||||
$Revision: 1.7 $
|
||||
$Revision: 1.10 $
|
||||
|
||||
=head1 INSTALL
|
||||
|
||||
|
@ -120,7 +120,7 @@ Report any bugs to the author: lamiral@linux-france.org
|
|||
None known.
|
||||
Feedback will be welcome.
|
||||
|
||||
$Id: imapsync,v 1.7 2003/03/15 03:40:54 gilles Exp gilles $
|
||||
$Id: imapsync,v 1.10 2003/05/05 22:37:48 gilles Exp $
|
||||
|
||||
=cut
|
||||
|
||||
|
@ -145,7 +145,7 @@ my(
|
|||
use vars qw ($opt_G); # missing code for this will be option.
|
||||
|
||||
|
||||
$rcs = ' $Id: imapsync,v 1.7 2003/03/15 03:40:54 gilles Exp gilles $ ';
|
||||
$rcs = ' $Id: imapsync,v 1.10 2003/05/05 22:37:48 gilles Exp $ ';
|
||||
$rcs =~ m/,v (\d+\.\d+)/;
|
||||
$VERSION = ($1) ? $1 : "UNKNOWN";
|
||||
$error=0;
|
||||
|
@ -193,18 +193,35 @@ $to = Mail::IMAPClient->new( Server => $host2,
|
|||
Debug => 0,)
|
||||
or die "can't open imap connection on [$host2] with user [$user2]\n";
|
||||
|
||||
my @f_folders = (scalar(@folder)) ? @folder : @{$from->folders()};
|
||||
my @f_folders;
|
||||
# @f_folders = (scalar(@folder)) ? @folder : @{$from->folders()};
|
||||
|
||||
|
||||
if (scalar(@folder)) {
|
||||
# folders are given as argument.
|
||||
foreach my $f_fold (@folder) {
|
||||
push (@f_folders, @{$from->folders("$f_fold", ".")});
|
||||
}
|
||||
}else{
|
||||
# no folder given so select all
|
||||
@f_folders = @{$from->folders()};
|
||||
}
|
||||
|
||||
|
||||
print "From folders : @f_folders\n";
|
||||
#exit;
|
||||
|
||||
FOLDER: foreach my $f_fold (@f_folders) {
|
||||
my $t_fold;
|
||||
print "From Folder $f_fold\n";
|
||||
unless ($f_fold =~ m/^INBOX/) {
|
||||
$t_fold = "INBOX." . $f_fold;
|
||||
}else {
|
||||
# unless ($f_fold =~ m/^INBOX/) {
|
||||
# $t_fold = "INBOX." . $f_fold;
|
||||
# }else {
|
||||
$t_fold = $f_fold;
|
||||
}
|
||||
# }
|
||||
$t_fold =~ s@\\@\.@g;
|
||||
$t_fold =~ s@\/@\.@g;
|
||||
print "To Folder $t_fold\n";
|
||||
unless ($from->select($f_fold)) {
|
||||
warn
|
||||
"From Folder $f_fold : Could not select ",
|
||||
|
@ -427,8 +444,8 @@ Several options are mandatory.
|
|||
--user2 <string> : user to login. Mandatory.
|
||||
--password2 <string> : password for the user2. Dangerous, use --passfile2
|
||||
--passfile2 <string> : password file for the user2. Contains the password.
|
||||
--folder <string> : sync only this folder
|
||||
--folder <string> : and this one.
|
||||
--folder <string> : sync only this folder and its children.
|
||||
--folder <string> : and this one (and its children).
|
||||
--folder <string> : and this one, etc.
|
||||
--delete : delete messages in "from" imap server after
|
||||
a successful transfert. useful in case you
|
||||
|
|
3
memo
3
memo
|
@ -1,3 +0,0 @@
|
|||
|
||||
perl -mMail::IMAPClient -e ''
|
||||
|
41
tests.sh
41
tests.sh
|
@ -1,8 +1,14 @@
|
|||
#!/bin/sh
|
||||
|
||||
# $Id: tests.sh,v 1.1 2003/03/12 23:14:45 gilles Exp gilles $
|
||||
# $Id: tests.sh,v 1.3 2003/05/05 22:32:01 gilles Exp $
|
||||
|
||||
# $Log: tests.sh,v $
|
||||
# Revision 1.3 2003/05/05 22:32:01 gilles
|
||||
# Added pl_folder() test
|
||||
#
|
||||
# Revision 1.2 2003/05/05 21:05:49 gilles
|
||||
# Added lp_folder to test --folder option
|
||||
#
|
||||
# Revision 1.1 2003/03/12 23:14:45 gilles
|
||||
# Initial revision
|
||||
#
|
||||
|
@ -10,9 +16,9 @@
|
|||
|
||||
#### Shell pragmas
|
||||
|
||||
exec 3>&2
|
||||
#set -x # debug mode. See what is running
|
||||
set -e # exit on first failure
|
||||
exec 3>&2 #
|
||||
#set -x # debug mode. See what is running
|
||||
set -e # exit on first failure
|
||||
|
||||
#### functions definitions
|
||||
|
||||
|
@ -100,6 +106,29 @@ plumeloul() {
|
|||
fi
|
||||
}
|
||||
|
||||
lp_folder() {
|
||||
if test X`hostname` = X"plume"; then
|
||||
echo3 Here is plume
|
||||
./imapsync \
|
||||
--host2 plume --user2 tata@est.belle --passfile2 /var/tmp/secret.tata \
|
||||
--folder INBOX.yop \
|
||||
--host1 loul --user1 tata --passfile1 /var/tmp/secret.tata
|
||||
else
|
||||
:
|
||||
fi
|
||||
}
|
||||
|
||||
pl_folder() {
|
||||
if test X`hostname` = X"plume"; then
|
||||
echo3 Here is plume
|
||||
./imapsync \
|
||||
--host1 plume --user1 tata@est.belle --passfile1 /var/tmp/secret.tata \
|
||||
--folder INBOX.yop \
|
||||
--host2 loul --user2 tata --passfile2 /var/tmp/secret.tata
|
||||
else
|
||||
:
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
# mandatory tests
|
||||
|
@ -112,7 +141,9 @@ test $# -eq 0 && run_tests \
|
|||
no_args \
|
||||
first_sync \
|
||||
loulplume \
|
||||
plumeloul
|
||||
plumeloul \
|
||||
lp_folder \
|
||||
pl_folder
|
||||
|
||||
# selective tests
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue