This commit is contained in:
Nick Bebout 2011-03-12 02:44:29 +00:00
parent 46dc7303ef
commit 6bb9d52826
12 changed files with 458 additions and 954 deletions

11
CREDITS
View file

@ -2,6 +2,17 @@
I thank very much all of these people.
RISKO Gergely
Maintain imapsync debian package.
Marten Lehmann
Found bug : imapsync does not delete messages immediately
after a successful transfer but the next run.
Paul Fisher
Bug fix when "user<NUL>authuser<NUL>password" is over 76 characters
encode_base64 and \n
Christian Michallek
Success with "David Tobit V8" to dbmail 2.0.9

View file

@ -1,15 +1,41 @@
RCS file: RCS/imapsync,v
Working file: imapsync
head: 1.182
head: 1.188
branch:
locks: strict
gilles: 1.188
access list:
symbolic names:
keyword substitution: kv
total revisions: 182; selected revisions: 182
total revisions: 188; selected revisions: 188
description:
----------------------------
revision 1.188 locked by: gilles;
date: 2006/10/30 01:18:37; author: gilles; state: Exp; lines: +22 -17
Fixed typos about transfer*
----------------------------
revision 1.187
date: 2006/09/29 12:18:53; author: gilles; state: Exp; lines: +6 -6
bug fixed when "user<NUL>authuser<NUL>password" is over 76 characters
----------------------------
revision 1.186
date: 2006/09/29 12:09:15; author: gilles; state: Exp; lines: +6 -6
Surgemail release
----------------------------
revision 1.185
date: 2006/09/28 11:15:20; author: gilles; state: Exp; lines: +6 -5
Surgemail success.
----------------------------
revision 1.184
date: 2006/08/22 01:25:18; author: gilles; state: Exp; lines: +9 -5
Added advice in case bad PLAIN AUTHENTICATE.
----------------------------
revision 1.183
date: 2006/08/22 01:17:28; author: gilles; state: Exp; lines: +7 -6
exit if --authmech1 method is not supported by an imap
server.
----------------------------
revision 1.182
date: 2006/08/01 23:07:42; author: gilles; state: Exp; lines: +8 -6
David Tobit V8

32
FAQ
View file

@ -10,6 +10,7 @@ Q. We have found that the sent time and date have been changed to the
R. This is the case with:
- Eudora
- Zimbra
- Outlook 2003
but not with
- Mutt
- Thunderbird
@ -119,15 +120,25 @@ supported with tls encryption most of the time.
Here is an example:
imapsync \
--host1 server1 \
--ssl1 \
--host2 server2 \
--user1 joe \
--authuser1 AdminAccount \
--password1 AdminAccountPassword \
--user1 joe \
--ssl1 \
--host2 server2 \
--user2 joe \
--password2 joespassonserver2 \
--exclude '^user\.'
======================================================================
Q. imapsync fails with the following error:
flags from : [\Seen NonJunk]["10-Aug-2006 13:00:30 -0400"]
Error trying to append string: 58 NO APPEND Invalid flag list
R. Flags have to begin with a \ character.
The flag "NonJunk" is not a valid flag so use for example:
imapsync ... --regexflag 's/NonJunk//g'
======================================================================
Q. I have moved from Braunschweig to Graz, so I would like to have my whole
@ -318,3 +329,16 @@ Q. Migrating from David Tobit V8
R. Use the following options :
imapsync ... --prefix1 INBOX. --sep1 / --subscribe
=======================================================================
Q. I need to migrate 1250 mailboxes from one cyrus-IMAP server to another
(empty) one. (Box-swap). The passwords are in a MySQL Database.
Can you tell me if your script suits my needs?
Partially, mailboxes must exist before running imapsync.
May be, Box-swap is not listed in "Failure stories"
nor "Success stories" in the README file.
You have to extract user and password in a csv file.
See the "HUGE MIGRATION" section in the README file.

View file

@ -1,5 +1,5 @@
# $Id: Makefile,v 1.12 2006/08/01 22:58:42 gilles Exp $
# $Id: Makefile,v 1.13 2006/10/30 03:05:12 gilles Exp gilles $
TARGET=imapsync
@ -91,14 +91,18 @@ clean_dist:
.PHONY: lfo niouze
lfo: dist niouze
lfo: dist lfo_upload niouze
lfo_upload:
rsync -av --delete . \
/home/gilles/public_html/www.linux-france.org/html/prj/$(TARGET)/
rsync -av --delete ../prepa_dist/imapsync-*tgz \
/home/gilles/public_html/www.linux-france.org/ftp/prj/$(TARGET)/
sh ~/memo/lfo-rsync
niouze: VERSION
. memo && lfo_announce
. memo && fm_announce
public: niouze

19
README
View file

@ -3,7 +3,7 @@ NAME
Synchronise mailboxes between two imap servers. Good at IMAP migration.
More than 25 different IMAP server softwares supported with success.
$Revision: 1.182 $
$Revision: 1.188 $
INSTALL
imapsync works fine under any Unix OS.
@ -71,15 +71,15 @@ DESCRIPTION
This is called migration.
imapsync is the adequate tool because it reduces the amount of data
transfered by not transfering a given message if it is already on both
sides. Same headers, same message size and the transfert is done only
transferred by not transferring a given message if it is already on both
sides. Same headers, same message size and the transfer is done only
once. All flags are preserved, unread will stay unread, read will stay
read, deleted will stay deleted. You can stop the transfert at any time
read, deleted will stay deleted. You can stop the transfer at any time
and restart it later, imapsync is adapted to a bad connection.
You can decide to delete the messages from the source mailbox after a
successful transfert (it is a good feature when migrating). In that
case, use the --delete --expunge1 options.
successful transfer (it is a good feature when migrating). In that case,
use the --delete --expunge1 options.
You can also just synchronize a mailbox A from another mailbox B in case
you just want to keep a "live" copy of B in A.
@ -92,7 +92,7 @@ HISTORY
new imap server without loosing huge old mailboxes located on a far away
remote imap server accessible by a low bandwith link. The tool imapcp
(written in python) could not help me because I had to verify every
mailbox was well transfered and delete it after a good transfert.
mailbox was well transferred and delete it after a good transfer.
imapsync started its life being a copy_folder.pl patch. The tool
copy_folder.pl comes from the Mail-IMAPClient-2.1.3 perl module tarball
source (in the examples/ directory of the tarball).
@ -120,7 +120,7 @@ SECURITY
solution.
imasync is not totally protected against sniffers on the network since
passwords may be transfered in plain text in case CRAM-MD5 is not
passwords may be transferred in plain text in case CRAM-MD5 is not
supported by your imap servers. Use --ssl1 and --ssl2 to enable
encryption on host1 and host2.
@ -219,6 +219,7 @@ IMAP SERVERS
- Samsung Contact IMAP server 8.5.0
- Scalix v10.1
- SunONE Messaging server 5.2, 6.0 (SUN JES - Java Enterprise System)
- Surgemail 3.6f5-5
- UW-imap servers (imap-2000b) rijkkramer IMAP4rev1 2000.287
(RedHat uses UW like 2003.338rh) (OSI Approved)
(http://www.washington.edu/imap/)
@ -292,5 +293,5 @@ AUTHOR
teaching free open and gratis softwares. Don't hesitate to pay him for
that services.
$Id: imapsync,v 1.182 2006/08/01 23:07:42 gilles Exp $
$Id: imapsync,v 1.188 2006/10/30 01:18:37 gilles Exp gilles $

8
TODO
View file

@ -1,6 +1,12 @@
TODO file for imapsync
----------------------
Add and option to sync to & from files.
Use examine() instead of select() in --dry mode.
Add a method doing the switch automagicaly.
Add --verbose from Kjetil jumbo patch.
Talk about mbox and maildir format when "Invalid header"
@ -30,6 +36,8 @@ http://asg.web.cmu.edu/cyrus/download/imapd/altnamespace.html
Explain expunge behavior.
DONE. Remove file rfc2342.txt "IMAP4 Namespace"
DONE. Add an --exactsync option to remove target messages
that are not on source. Maybe --delete2 is a better name.

View file

@ -1 +1 @@
1.182
1.188

View file

@ -1,8 +1,8 @@
#
#RELEASE_FOCUS="Initial freshmeat announcement"
RELEASE_FOCUS="Documentation"
#RELEASE_FOCUS="Code cleanup"
#RELEASE_FOCUS="Documentation"
RELEASE_FOCUS="Code cleanup"
#RELEASE_FOCUS="Minor feature enhancements"
#RELEASE_FOCUS="Major feature enhancements"
#RELEASE_FOCUS="Minor bugfixes"
@ -11,6 +11,7 @@ RELEASE_FOCUS="Documentation"
#RELEASE_FOCUS="Major security fixes"
#TEXT_BODY="Syntax cleanup"
TEXT_BODY="Updated documentation"
#TEXT_BODY="Updated documentation"
TEXT_BODY="Updated documentation and tests"

View file

@ -7,7 +7,7 @@ tool. Synchronise mailboxes between two imap servers. Good
at IMAP migration. More than 25 different IMAP server softwares
supported with success.
$Revision: 1.182 $
$Revision: 1.188 $
=head1 INSTALL
@ -82,16 +82,16 @@ We sometimes need to transfer mailboxes from one imap server to
another. This is called migration.
imapsync is the adequate tool because it reduces the amount
of data transfered by not transfering a given message if it
of data transferred by not transferring a given message if it
is already on both sides. Same headers, same message size
and the transfert is done only once. All flags are
and the transfer is done only once. All flags are
preserved, unread will stay unread, read will stay read,
deleted will stay deleted. You can stop the transfert at any
deleted will stay deleted. You can stop the transfer at any
time and restart it later, imapsync is adapted to a bad
connection.
You can decide to delete the messages from the source mailbox
after a successful transfert (it is a good feature when migrating).
after a successful transfer (it is a good feature when migrating).
In that case, use the --delete --expunge1 options.
You can also just synchronize a mailbox A from another mailbox B
@ -107,8 +107,8 @@ I wrote imapsync because an enterprise (basystemes) paid me to install
a new imap server without loosing huge old mailboxes located on a far
away remote imap server accessible by a low bandwith link. The tool
imapcp (written in python) could not help me because I had to verify
every mailbox was well transfered and delete it after a good
transfert. imapsync started its life being a copy_folder.pl patch.
every mailbox was well transferred and delete it after a good
transfer. imapsync started its life being a copy_folder.pl patch.
The tool copy_folder.pl comes from the Mail-IMAPClient-2.1.3 perl
module tarball source (in the examples/ directory of the tarball).
@ -140,7 +140,7 @@ the password in a well protected file (600 or rw-------) is
the best solution.
imasync is not totally protected against sniffers on the
network since passwords may be transfered in plain text in
network since passwords may be transferred in plain text in
case CRAM-MD5 is not supported by your imap servers. Use
--ssl1 and --ssl2 to enable encryption on host1 and host2.
@ -248,6 +248,7 @@ Success stories reported with the following imap servers
- Samsung Contact IMAP server 8.5.0
- Scalix v10.1
- SunONE Messaging server 5.2, 6.0 (SUN JES - Java Enterprise System)
- Surgemail 3.6f5-5
- UW-imap servers (imap-2000b) rijkkramer IMAP4rev1 2000.287
(RedHat uses UW like 2003.338rh) (OSI Approved)
(http://www.washington.edu/imap/)
@ -342,7 +343,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.182 2006/08/01 23:07:42 gilles Exp $
$Id: imapsync,v 1.188 2006/10/30 01:18:37 gilles Exp gilles $
=cut
@ -399,7 +400,7 @@ my(
use vars qw ($opt_G); # missing code for this will be option.
$rcs = ' $Id: imapsync,v 1.182 2006/08/01 23:07:42 gilles Exp $ ';
$rcs = ' $Id: imapsync,v 1.188 2006/10/30 01:18:37 gilles Exp gilles $ ';
$rcs =~ m/,v (\d+\.\d+)/;
$VERSION = ($1) ? $1 : "UNKNOWN";
@ -436,8 +437,8 @@ $error=0;
my $banner = join("",
'$RCSfile: imapsync,v $ ',
'$Revision: 1.182 $ ',
'$Date: 2006/08/01 23:07:42 $ ',
'$Revision: 1.188 $ ',
'$Date: 2006/10/30 01:18:37 $ ',
"\n",
"Mail::IMAPClient version used here is ",
$VERSION_IMAPClient,"\n"
@ -618,8 +619,13 @@ sub login_imap {
$imap->Authmechanism($authmech);
$imap->Authcallback(\&plainauth) if $authmech eq "PLAIN";
} else {
printf("%s: no support for AUTHENTICATE %s, using LOGIN\n",
printf("%s: No CAPABILITY for AUTHENTICATE %s\n",
$imap->Server, $authmech);
if ($authmech eq 'PLAIN') {
print "Frequently PLAIN is only supported with SSL, ",
"try --ssl1 or --ssl2 option\n";
}
exit(1);
}
$imap->User($user);
@ -635,7 +641,7 @@ sub plainauth() {
my $string = sprintf("%s\x00%s\x00%s", $imap->User,
$imap->Authuser, $imap->Password);
return encode_base64("$string");
return encode_base64("$string", "");
}
@ -1085,6 +1091,11 @@ FOLDER: foreach my $f_fold (@f_folders) {
print "Copied msg id [$f_msg] to folder $t_fold msg id [$new_id]\n";
$mess_size_total_trans += $f_size;
$mess_trans += 1;
if($delete) {
print "Deleting msg #$f_msg in folder $f_fold\n";
$from->delete_message($f_msg) unless ($dry);
$from->expunge() if ($expunge and not $dry);
}
}
}
next MESS;
@ -1218,9 +1229,9 @@ sub select_msgs {
sub stats {
print "++++ Statistics ++++\n";
print "Time : $timediff sec\n";
print "Messages transfered : $mess_trans\n";
print "Messages transferred : $mess_trans\n";
print "Messages skipped : $mess_skipped\n";
print "Total bytes transfered : $mess_size_total_trans\n";
print "Total bytes transferred: $mess_size_total_trans\n";
print "Total bytes skipped : $mess_size_total_skipped\n";
print "Total bytes error : $mess_size_total_error\n";
print "Detected $error errors\n";
@ -1442,7 +1453,7 @@ Several options are mandatory.
--expunge : expunge messages on source account.
expunge really deletes messages marked deleted.
expunge is made at the beginning on the
source server only. newly transfered messages
source server only. newly transferred messages
are expunged if option --expunge is given.
no expunge is done on destination account but
it will change in future releases.
@ -1468,8 +1479,8 @@ Several options are mandatory.
--useheader <string> and this one, etc.
--skipsize : Don't take message size into account.
--dry : do nothing, just print what would be done.
--subscribed : transfer only subscribed folders.
--subscribe : subscribe to the folders transfered on the
--subscribed : transfers only subscribed folders.
--subscribe : subscribe to the folders transferred on the
"destination" server that are subscribed
on the "source" server.
--(no)foldersizes : Calculate the size of each "From" folder in bytes

View file

@ -17,4 +17,6 @@ vi /etc/courier/userdb
ls -a /home/vmail/tata/
userdbpw -hmac-md5 | userdb tata@est.belle set hmac-md5pw
makeuserdb

View file

@ -1,563 +0,0 @@
Network Working Group M. Gahrns
Request for Comments: 2342 Microsoft
Category: Standards Track C. Newman
Innosoft
May 1998
IMAP4 Namespace
Status of this Memo
This document specifies an Internet standards track protocol for the
Internet community, and requests discussion and suggestions for
improvements. Please refer to the current edition of the "Internet
Official Protocol Standards" (STD 1) for the standardization state
and status of this protocol. Distribution of this memo is unlimited.
Copyright Notice
Copyright (C) The Internet Society (1998). All Rights Reserved.
1. Abstract
IMAP4 [RFC-2060] does not define a default server namespace. As a
result, two common namespace models have evolved:
The "Personal Mailbox" model, in which the default namespace that is
presented consists of only the user's personal mailboxes. To access
shared mailboxes, the user must use an escape mechanism to reach
another namespace.
The "Complete Hierarchy" model, in which the default namespace that
is presented includes the user's personal mailboxes along with any
other mailboxes they have access to.
These two models, create difficulties for certain client operations.
This document defines a NAMESPACE command that allows a client to
discover the prefixes of namespaces used by a server for personal
mailboxes, other users' mailboxes, and shared mailboxes. This allows
a client to avoid much of the manual user configuration that is now
necessary when mixing and matching IMAP4 clients and servers.
2. Conventions used in this document
In examples, "C:" and "S:" indicate lines sent by the client and
server respectively. If such lines are wrapped without a new "C:" or
"S:" label, then the wrapping is for editorial clarity and is not
part of the command.
Gahrns & Newman Standards Track [Page 1]
RFC 2342 IMAP4 Namespace May 1998
Personal Namespace: A namespace that the server considers within the
personal scope of the authenticated user on a particular connection.
Typically, only the authenticated user has access to mailboxes in
their Personal Namespace. It is the part of the namespace that
belongs to the user that is allocated for mailboxes. If an INBOX
exists for a user, it MUST appear within the user's personal
namespace. In the typical case, there SHOULD be only one Personal
Namespace on a server.
Other Users' Namespace: A namespace that consists of mailboxes from
the Personal Namespaces of other users. To access mailboxes in the
Other Users' Namespace, the currently authenticated user MUST be
explicitly granted access rights. For example, it is common for a
manager to grant to their secretary access rights to their mailbox.
In the typical case, there SHOULD be only one Other Users' Namespace
on a server.
Shared Namespace: A namespace that consists of mailboxes that are
intended to be shared amongst users and do not exist within a user's
Personal Namespace.
The namespaces a server uses MAY differ on a per-user basis.
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
document are to be interpreted as described in [RFC-2119].
3. Introduction and Overview
Clients often attempt to create mailboxes for such purposes as
maintaining a record of sent messages (e.g. "Sent Mail") or
temporarily saving messages being composed (e.g. "Drafts"). For
these clients to inter-operate correctly with the variety of IMAP4
servers available, the user must enter the prefix of the Personal
Namespace used by the server. Using the NAMESPACE command, a client
is able to automatically discover this prefix without manual user
configuration.
In addition, users are often required to manually enter the prefixes
of various namespaces in order to view the mailboxes located there.
For example, they might be required to enter the prefix of #shared to
view the shared mailboxes namespace. The NAMESPACE command allows a
client to automatically discover the namespaces that are available on
a server. This allows a client to present the available namespaces to
the user in what ever manner it deems appropriate. For example, a
Gahrns & Newman Standards Track [Page 2]
RFC 2342 IMAP4 Namespace May 1998
client could choose to initially display only personal mailboxes, or
it may choose to display the complete list of mailboxes available,
and initially position the user at the root of their Personal
Namespace.
A server MAY choose to make available to the NAMESPACE command only a
subset of the complete set of namespaces the server supports. To
provide the ability to access these namespaces, a client SHOULD allow
the user the ability to manually enter a namespace prefix.
4. Requirements
IMAP4 servers that support this extension MUST list the keyword
NAMESPACE in their CAPABILITY response.
The NAMESPACE command is valid in the Authenticated and Selected
state.
5. NAMESPACE Command
Arguments: none
Response: an untagged NAMESPACE response that contains the prefix
and hierarchy delimiter to the server's Personal
Namespace(s), Other Users' Namespace(s), and Shared
Namespace(s) that the server wishes to expose. The
response will contain a NIL for any namespace class
that is not available. Namespace_Response_Extensions
MAY be included in the response.
Namespace_Response_Extensions which are not on the IETF
standards track, MUST be prefixed with an "X-".
Result: OK - Command completed
NO - Error: Can't complete command
BAD - argument invalid
Example 5.1:
===========
< A server that supports a single personal namespace. No leading
prefix is used on personal mailboxes and "/" is the hierarchy
delimiter.>
C: A001 NAMESPACE
S: * NAMESPACE (("" "/")) NIL NIL
S: A001 OK NAMESPACE command completed
Gahrns & Newman Standards Track [Page 3]
RFC 2342 IMAP4 Namespace May 1998
Example 5.2:
===========
< A user logged on anonymously to a server. No personal mailboxes
are associated with the anonymous user and the user does not have
access to the Other Users' Namespace. No prefix is required to
access shared mailboxes and the hierarchy delimiter is "." >
C: A001 NAMESPACE
S: * NAMESPACE NIL NIL (("" "."))
S: A001 OK NAMESPACE command completed
Example 5.3:
===========
< A server that contains a Personal Namespace and a single Shared
Namespace. >
C: A001 NAMESPACE
S: * NAMESPACE (("" "/")) NIL (("Public Folders/" "/"))
S: A001 OK NAMESPACE command completed
Example 5.4:
===========
< A server that contains a Personal Namespace, Other Users'
Namespace and multiple Shared Namespaces. Note that the hierarchy
delimiter used within each namespace can be different. >
C: A001 NAMESPACE
S: * NAMESPACE (("" "/")) (("~" "/")) (("#shared/" "/")
("#public/" "/")("#ftp/" "/")("#news." "."))
S: A001 OK NAMESPACE command completed
The prefix string allows a client to do things such as automatically
creating personal mailboxes or LISTing all available mailboxes within
a namespace.
Example 5.5:
===========
< A server that supports only the Personal Namespace, with a
leading prefix of INBOX to personal mailboxes and a hierarchy
delimiter of ".">
C: A001 NAMESPACE
S: * NAMESPACE (("INBOX." ".")) NIL NIL
S: A001 OK NAMESPACE command completed
Gahrns & Newman Standards Track [Page 4]
RFC 2342 IMAP4 Namespace May 1998
< Automatically create a mailbox to store sent items.>
C: A002 CREATE "INBOX.Sent Mail"
S: A002 OK CREATE command completed
Although typically a server will support only a single Personal
Namespace, and a single Other User's Namespace, circumstances exist
where there MAY be multiples of these, and a client MUST be prepared
for them. If a client is configured such that it is required to
create a certain mailbox, there can be circumstances where it is
unclear which Personal Namespaces it should create the mailbox in.
In these situations a client SHOULD let the user select which
namespaces to create the mailbox in.
Example 5.6:
===========
< In this example, a server supports 2 Personal Namespaces. In
addition to the regular Personal Namespace, the user has an
additional personal namespace to allow access to mailboxes in an
MH format mailstore. >
< The client is configured to save a copy of all mail sent by the
user into a mailbox called 'Sent Mail'. Furthermore, after a
message is deleted from a mailbox, the client is configured to
move that message to a mailbox called 'Deleted Items'.>
< Note that this example demonstrates how some extension flags can
be passed to further describe the #mh namespace. >
C: A001 NAMESPACE
S: * NAMESPACE (("" "/")("#mh/" "/" "X-PARAM" ("FLAG1" "FLAG2")))
NIL NIL
S: A001 OK NAMESPACE command completed
< It is desired to keep only one copy of sent mail. It is unclear
which Personal Namespace the client should use to create the 'Sent
Mail' mailbox. The user is prompted to select a namespace and
only one 'Sent Mail' mailbox is created. >
C: A002 CREATE "Sent Mail"
S: A002 OK CREATE command completed
< The client is designed so that it keeps two 'Deleted Items'
mailboxes, one for each namespace. >
C: A003 CREATE "Delete Items"
S: A003 OK CREATE command completed
Gahrns & Newman Standards Track [Page 5]
RFC 2342 IMAP4 Namespace May 1998
C: A004 CREATE "#mh/Deleted Items"
S: A004 OK CREATE command completed
The next level of hierarchy following the Other Users' Namespace
prefix SHOULD consist of <username>, where <username> is a user name
as per the IMAP4 LOGIN or AUTHENTICATE command.
A client can construct a LIST command by appending a "%" to the Other
Users' Namespace prefix to discover the Personal Namespaces of other
users that are available to the currently authenticated user.
In response to such a LIST command, a server SHOULD NOT return user
names that have not granted access to their personal mailboxes to the
user in question.
A server MAY return a LIST response containing only the names of
users that have explicitly granted access to the user in question.
Alternatively, a server MAY return NO to such a LIST command,
requiring that a user name be included with the Other Users'
Namespace prefix before listing any other user's mailboxes.
Example 5.7:
===========
< A server that supports providing a list of other user's
mailboxes that are accessible to the currently logged on user. >
C: A001 NAMESPACE
S: * NAMESPACE (("" "/")) (("Other Users/" "/")) NIL
S: A001 OK NAMESPACE command completed
C: A002 LIST "" "Other Users/%"
S: * LIST () "/" "Other Users/Mike"
S: * LIST () "/" "Other Users/Karen"
S: * LIST () "/" "Other Users/Matthew"
S: * LIST () "/" "Other Users/Tesa"
S: A002 OK LIST command completed
Example 5.8:
===========
< A server that does not support providing a list of other user's
mailboxes that are accessible to the currently logged on user.
The mailboxes are listable if the client includes the name of the
other user with the Other Users' Namespace prefix. >
Gahrns & Newman Standards Track [Page 6]
RFC 2342 IMAP4 Namespace May 1998
C: A001 NAMESPACE
S: * NAMESPACE (("" "/")) (("#Users/" "/")) NIL
S: A001 OK NAMESPACE command completed
< In this example, the currently logged on user has access to the
Personal Namespace of user Mike, but the server chose to suppress
this information in the LIST response. However, by appending the
user name Mike (received through user input) to the Other Users'
Namespace prefix, the client is able to get a listing of the
personal mailboxes of user Mike. >
C: A002 LIST "" "#Users/%"
S: A002 NO The requested item could not be found.
C: A003 LIST "" "#Users/Mike/%"
S: * LIST () "/" "#Users/Mike/INBOX"
S: * LIST () "/" "#Users/Mike/Foo"
S: A003 OK LIST command completed.
A prefix string might not contain a hierarchy delimiter, because
in some cases it is not needed as part of the prefix.
Example 5.9:
===========
< A server that allows access to the Other Users' Namespace by
prefixing the others' mailboxes with a '~' followed by <username>,
where <username> is a user name as per the IMAP4 LOGIN or
AUTHENTICATE command.>
C: A001 NAMESPACE
S: * NAMESPACE (("" "/")) (("~" "/")) NIL
S: A001 OK NAMESPACE command completed
< List the mailboxes for user mark >
C: A002 LIST "" "~mark/%"
S: * LIST () "/" "~mark/INBOX"
S: * LIST () "/" "~mark/foo"
S: A002 OK LIST command completed
Historical convention has been to start all namespaces with the "#"
character. Namespaces that include the "#" character are not IMAP
URL [IMAP-URL] friendly requiring the "#" character to be represented
as %23 when within URLs. As such, server implementers MAY instead
consider using namespace prefixes that do not contain the "#"
character.
Gahrns & Newman Standards Track [Page 7]
RFC 2342 IMAP4 Namespace May 1998
6. Formal Syntax
The following syntax specification uses the augmented Backus-Naur
Form (BNF) as described in [ABNF].
atom = <atom>
; <atom> as defined in [RFC-2060]
Namespace = nil / "(" 1*( "(" string SP (<"> QUOTED_CHAR <"> /
nil) *(Namespace_Response_Extension) ")" ) ")"
Namespace_Command = "NAMESPACE"
Namespace_Response_Extension = SP string SP "(" string *(SP string)
")"
Namespace_Response = "*" SP "NAMESPACE" SP Namespace SP Namespace SP
Namespace
; The first Namespace is the Personal Namespace(s)
; The second Namespace is the Other Users' Namespace(s)
; The third Namespace is the Shared Namespace(s)
nil = <nil>
; <nil> as defined in [RFC-2060]
QUOTED_CHAR = <QUOTED_CHAR>
; <QUOTED_CHAR> as defined in [RFC-2060]
string = <string>
; <string> as defined in [RFC-2060]
; Note that the namespace prefix is to a mailbox and following
; IMAP4 convention, any international string in the NAMESPACE
; response MUST be of modified UTF-7 format as described in
; [RFC-2060].
7. Security Considerations
In response to a LIST command containing an argument of the Other
Users' Namespace prefix, a server SHOULD NOT list users that have not
granted list access to their personal mailboxes to the currently
authenticated user. Providing such a list, could compromise security
by potentially disclosing confidential information of who is located
on the server, or providing a starting point of a list of user
accounts to attack.
Gahrns & Newman Standards Track [Page 8]
RFC 2342 IMAP4 Namespace May 1998
8. References
[RFC-2060], Crispin, M., "Internet Message Access Protocol Version
4rev1", RFC 2060, December 1996.
[RFC-2119], Bradner, S., "Key words for use in RFCs to Indicate
Requirement Levels", BCP 14, RFC 2119, March 1997.
[ABNF] Crocker, D., Editor, and P. Overell, "Augmented BNF for Syntax
Specifications: ABNF", RFC 2234, November 1997.
[IMAP-URL], Newman, C., "IMAP URL Scheme", RFC 2192, September 1997.
9. Acknowledgments
Many people have participated in the discussion of IMAP namespaces on
the IMAP mailing list. In particular, the authors would like to
thank Mark Crispin for many of the concepts relating to the Personal
Namespace and accessing the Personal Namespace of other users, Steve
Hole for summarizing the two namespace models, John Myers and Jack De
Winter for their work in a preceding effort trying to define a
standardized personal namespace, and Larry Osterman for his review
and collaboration on this document.
11. Authors' Addresses
Mike Gahrns
Microsoft
One Microsoft Way
Redmond, WA, 98072, USA
Phone: (425) 936-9833
EMail: mikega@microsoft.com
Chris Newman
Innosoft International, Inc.
1050 East Garvey Ave. South
West Covina, CA, 91790, USA
EMail: chris.newman@innosoft.com
Gahrns & Newman Standards Track [Page 9]
RFC 2342 IMAP4 Namespace May 1998
12. Full Copyright Statement
Copyright (C) The Internet Society (1998). All Rights Reserved.
This document and translations of it may be copied and furnished to
others, and derivative works that comment on or otherwise explain it
or assist in its implementation may be prepared, copied, published
and distributed, in whole or in part, without restriction of any
kind, provided that the above copyright notice and this paragraph are
included on all such copies and derivative works. However, this
document itself may not be modified in any way, such as by removing
the copyright notice or references to the Internet Society or other
Internet organizations, except as needed for the purpose of
developing Internet standards in which case the procedures for
copyrights defined in the Internet Standards process must be
followed, or as required to translate it into languages other than
English.
The limited permissions granted above are perpetual and will not be
revoked by the Internet Society or its successors or assigns.
This document and the information contained herein is provided on an
"AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING
TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING
BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION
HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF
MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
Gahrns & Newman Standards Track [Page 10]

679
tests.sh
View file

@ -1,6 +1,6 @@
#!/bin/sh
# $Id: tests.sh,v 1.53 2006/06/08 00:53:21 gilles Exp $
# $Id: tests.sh,v 1.55 2006/10/30 01:19:46 gilles Exp gilles $
#### Shell pragmas
@ -49,47 +49,53 @@ no_args() {
./imapsync
}
# list of accounts on plume :
# toto@est.belle # used on first_sync()
# bad_login()
# bad_host()
# titi@est.belle # used on first_sync()
# bad_host()
# locallocal()
# tata@est.belle # used on locallocal()
# tutu@est.belle # not used
# tete@est.belle # used on big size tests
# big_transfert()
# big_transfert_sizes_only()
# dprof()
sendtestmessage() {
rand=`pwgen 16 1`
mess='test:'$rand
cmd="echo $mess""| mail -s ""$mess"" tata@est.belle"
echo $cmd
eval "$cmd"
}
first_sync() {
./imapsync \
--host1 localhost --user1 toto@est.belle \
--passfile1 /var/tmp/secret1 \
--host2 localhost --user2 titi@est.belle \
--passfile2 /var/tmp/secret2 \
--passfile2 /var/tmp/secret.titi \
--noauthmd5
}
sendtestmessage() {
rand=`pwgen 16 1`
mess='test:'$rand
cmd="echo $mess""| mail -s ""$mess"" tata"
echo $cmd
ssh gilles@loul $cmd
}
loulplume() {
locallocal() {
if test X`hostname` = X"plume"; then
echo3 Here is plume
sendtestmessage
./imapsync \
--host1 loul --user1 tata \
--host1 localhost --user1 tata@est.belle \
--passfile1 /var/tmp/secret.tata \
--host2 plume --user2 tata@est.belle \
--passfile2 /var/tmp/secret.tata
else
:
fi
}
loulloul() {
if test X`hostname` = X"plume"; then
echo3 Here is plume
sendtestmessage
./imapsync \
--host1 loul --user1 tata \
--passfile1 /var/tmp/secret.tata \
--host2 loul --user2 titi \
--passfile2 /var/tmp/secret.tata
--host2 localhost --user2 titi@est.belle \
--passfile2 /var/tmp/secret.titi \
else
:
fi
@ -97,41 +103,30 @@ loulloul() {
plumeloul() {
ll_folder() {
if test X`hostname` = X"plume"; then
echo3 Here is plume
./imapsync \
--host1 plume --user1 tata@est.belle \
--host1 localhost --user1 tata@est.belle \
--passfile1 /var/tmp/secret.tata \
--host2 loul --user2 tata \
--passfile2 /var/tmp/secret.tata
--host2 localhost --user2 titi@est.belle \
--passfile2 /var/tmp/secret.titi \
--folder INBOX.yop --folder INBOX.Trash
else
:
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 --folder INBOX.Trash \
--host1 loul --user1 tata \
--passfile1 /var/tmp/secret.tata
else
:
fi
}
lp_buffersize() {
ll_buffersize() {
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 \
--host1 localhost --user1 tata@est.belle \
--passfile1 /var/tmp/secret.tata \
--host2 localhost --user2 titi@est.belle \
--passfile2 /var/tmp/secret.titi \
--buffersize 8
else
:
@ -140,15 +135,14 @@ lp_buffersize() {
lp_justfolders() {
ll_justfolders() {
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 --folder INBOX.Trash \
--host1 loul --user1 tata \
--host1 localhost --user1 tata@est.belle \
--passfile1 /var/tmp/secret.tata \
--host2 localhost --user2 titi@est.belle \
--passfile2 /var/tmp/secret.titi \
--justfolders
else
:
@ -156,31 +150,17 @@ lp_justfolders() {
}
pl_folder_qqq() {
ll_prefix12() {
if test X`hostname` = X"plume"; then
echo3 Here is plume
./imapsync \
--host1 plume --user1 tata@est.belle \
--host1 localhost --user1 tata@est.belle \
--passfile1 /var/tmp/secret.tata \
--host2 localhost --user2 titi@est.belle \
--passfile2 /var/tmp/secret.titi \
--folder INBOX.qqq \
--host2 loul --user2 tata \
--passfile2 /var/tmp/secret.tata
else
:
fi
}
pl_prefix12() {
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.qqq \
--host2 loul --user2 tata \
--passfile2 /var/tmp/secret.tata \
--prefix1 INBOX.\
--prefix2 INBOX. \
--prefix2 INBOX.
else
:
fi
@ -188,16 +168,16 @@ pl_prefix12() {
lp_internaldate() {
ll_internaldate() {
if test X`hostname` = X"plume"; then
echo3 Here is plume
sendtestmessage
./imapsync \
--host2 plume --user2 tata@est.belle \
--passfile2 /var/tmp/secret.tata \
--folder INBOX \
--host1 loul --user1 tata \
--host1 localhost --user1 tata@est.belle \
--passfile1 /var/tmp/secret.tata \
--host2 localhost --user2 titi@est.belle \
--passfile2 /var/tmp/secret.titi \
--folder INBOX \
--syncinternaldates
else
:
@ -207,29 +187,29 @@ lp_internaldate() {
pl_folder() {
ll_folder_rev() {
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
--host1 localhost --user1 titi@est.belle \
--passfile1 /var/tmp/secret.titi \
--host2 localhost --user2 tata@est.belle \
--passfile2 /var/tmp/secret.tata \
--folder INBOX.yop
else
:
fi
}
lp_subscribed()
ll_subscribed()
{
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 \
--host1 localhost --user1 tata@est.belle \
--passfile1 /var/tmp/secret.tata \
--host2 localhost --user2 titi@est.belle \
--passfile2 /var/tmp/secret.titi \
--subscribed
else
:
@ -237,43 +217,43 @@ lp_subscribed()
}
lp_subscribe()
ll_subscribe()
{
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 \
--host1 localhost --user1 tata@est.belle \
--passfile1 /var/tmp/secret.tata \
--host2 localhost --user2 titi@est.belle \
--passfile2 /var/tmp/secret.titi \
--subscribed --subscribe
else
:
fi
}
lp_justconnect()
ll_justconnect()
{
if test X`hostname` = X"plume"; then
echo3 Here is plume
./imapsync \
--host2 plume \
--host1 loul \
--host2 localhost \
--host1 localhost \
--justconnect
else
:
fi
}
lp_justfoldersizes()
ll_justfoldersizes()
{
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 \
--host1 localhost --user1 tata@est.belle \
--passfile1 /var/tmp/secret.tata \
--host2 localhost --user2 titi@est.belle \
--passfile2 /var/tmp/secret.titi \
--justfoldersizes
else
:
@ -282,30 +262,30 @@ lp_justfoldersizes()
lp_authmd5()
ll_authmd5()
{
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 \
--host1 localhost --user1 tata@est.belle \
--passfile1 /var/tmp/secret.tata \
--justfoldersizes
--host2 localhost --user2 titi@est.belle \
--passfile2 /var/tmp/secret.titi \
--justfoldersizes --authmd5
else
:
fi
}
lp_noauthmd5()
ll_noauthmd5()
{
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 \
--host1 localhost --user1 tata@est.belle \
--passfile1 /var/tmp/secret.tata \
--host2 localhost --user2 titi@est.belle \
--passfile2 /var/tmp/secret.titi \
--justfoldersizes --noauthmd5
else
:
@ -313,16 +293,16 @@ lp_noauthmd5()
}
lp_maxage()
ll_maxage()
{
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 \
--host1 localhost --user1 tata@est.belle \
--passfile1 /var/tmp/secret.tata \
--host2 localhost --user2 titi@est.belle \
--passfile2 /var/tmp/secret.titi \
--maxage 1
else
:
@ -331,48 +311,48 @@ lp_maxage()
lp_maxsize()
ll_maxsize()
{
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 \
--host1 localhost --user1 tata@est.belle \
--passfile1 /var/tmp/secret.tata \
--host2 localhost --user2 titi@est.belle \
--passfile2 /var/tmp/secret.titi \
--maxsize 10
else
:
fi
}
lp_skipsize()
ll_skipsize()
{
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 \
--host1 localhost --user1 tata@est.belle \
--passfile1 /var/tmp/secret.tata \
--host2 localhost --user2 titi@est.belle \
--passfile2 /var/tmp/secret.titi \
--skipsize --folder INBOX.yop.yap
else
:
fi
}
lp_skipheader()
ll_skipheader()
{
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 \
--host1 localhost --user1 tata@est.belle \
--passfile1 /var/tmp/secret.tata \
--host2 localhost --user2 titi@est.belle \
--passfile2 /var/tmp/secret.titi \
--skipheader 'X-.*' --folder INBOX.yop.yap
else
:
@ -381,48 +361,47 @@ lp_skipheader()
lp_include()
ll_include()
{
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 \
--host1 localhost --user1 tata@est.belle \
--passfile1 /var/tmp/secret.tata \
--host2 localhost --user2 titi@est.belle \
--passfile2 /var/tmp/secret.titi \
--include '^INBOX.yop'
else
:
fi
}
lp_regextrans2()
ll_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 \
--host1 localhost --user1 tata@est.belle \
--passfile1 /var/tmp/secret.tata \
--host2 localhost --user2 titi@est.belle \
--passfile2 /var/tmp/secret.titi \
--regextrans2 's/yop/yopX/' --dry
else
:
fi
}
lp_sep2()
ll_sep2()
{
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 \
--host1 localhost --user1 tata@est.belle \
--passfile1 /var/tmp/secret.tata \
--host2 localhost --user2 titi@est.belle \
--passfile2 /var/tmp/secret.titi \
--folder INBOX.yop.yap \
--sep2 '\\' --dry
else
@ -430,9 +409,7 @@ lp_sep2()
fi
}
bad_login()
ll_bad_login()
{
! ./imapsync \
--host1 localhost --user1 toto@est.belle \
@ -442,7 +419,7 @@ bad_login()
}
bad_host()
ll_bad_host()
{
! ./imapsync \
--host1 badhost --user1 toto@est.belle \
@ -453,23 +430,195 @@ bad_host()
}
foldersizes()
ll_justfoldersizes()
{
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 \
--host1 localhost --user1 tata@est.belle \
--passfile1 /var/tmp/secret.tata \
--host2 localhost --user2 titi@est.belle \
--passfile2 /var/tmp/secret.titi \
--justfoldersizes
else
:
fi
}
ll_useheader()
{
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.yop.yap \
--useheader 'Message-ID' \
--dry --debug
echo 'rm /home/vmail/tata/.yop.yap/cur/*'
else
:
fi
}
ll_regexmess()
{
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.yop.yap \
--regexmess 's/\157/O/g' \
--regexmess 's/p/Z/g' \
--dry --debug
echo 'rm /home/vmail/titi/.yop.yap/cur/*'
else
:
fi
}
ll_flags()
{
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.yop.yap \
--dry --debug
echo 'rm /home/vmail/titi/.yop.yap/cur/*'
else
:
fi
}
ll_regex_flag()
{
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.yop.yap \
--dry --debug --regexflag 's/\\Answered/\\AnXweXed/g'
echo 'rm /home/vmail/titi/.yop.yap/cur/*'
else
:
fi
}
ll_ssl() {
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 \
--ssl1 --ssl2
else
:
fi
}
ll_authmech_PLAIN() {
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 \
--justfoldersizes --nofoldersizes \
--authmech1 PLAIN --authmech2 PLAIN
else
:
fi
}
ll_authuser() {
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 \
--justfoldersizes --nofoldersizes \
--authuser2 titi@est.belle
else
:
fi
}
ll_authmech_LOGIN() {
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 \
--justfoldersizes --nofoldersizes \
--authmech1 LOGIN --authmech2 LOGIN
else
:
fi
}
ll_authmech_CRAMMD5() {
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 \
--justfoldersizes --nofoldersizes \
--authmech1 CRAM-MD5 --authmech2 CRAM-MD5
else
:
fi
}
ll_delete2() {
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 \
--delete2 --expunge2
else
:
fi
}
##########################
# specific tests
##########################
big_transfert()
{
date1=`date`
@ -620,183 +769,11 @@ perl -I bugs/lib ./imapsync \
}
##########################
##########################
useheader()
{
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 \
--folder INBOX.yop.yap \
--useheader 'Message-ID' \
--dry --debug
echo 'rm /home/vmail/tata/.yop.yap/cur/*'
else
:
fi
}
regexmess()
{
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 \
--folder INBOX.yop.yap \
--regexmess 's/\157/O/g' \
--regexmess 's/p/Z/g' \
--dry --debug
echo 'rm /home/vmail/tata/.yop.yap/cur/*'
else
:
fi
}
flags()
{
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 \
--folder INBOX.yop.yap \
--dry --debug
echo 'rm /home/vmail/tata/.yop.yap/cur/*'
else
:
fi
}
regex_flag()
{
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 \
--folder INBOX.yop.yap \
--dry --debug --regexflag 's/\\Answered//g'
echo 'rm /home/vmail/tata/.yop.yap/cur/*'
else
:
fi
}
lp_ssl() {
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 \
--ssl1 --ssl2
else
:
fi
}
lp_authmech_PLAIN() {
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 \
--justfoldersizes --nofoldersizes \
--authmech1 PLAIN --authmech2 PLAIN
else
:
fi
}
lp_authuser() {
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 \
--justfoldersizes --nofoldersizes \
--authuser2 tata@est.belle
else
:
fi
}
lp_authmech_LOGIN() {
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 \
--justfoldersizes --nofoldersizes \
--authmech1 LOGIN --authmech2 LOGIN
else
:
fi
}
lp_authmech_CRAMMD5() {
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 \
--justfoldersizes --nofoldersizes \
--authmech1 CRAM-MD5 --authmech2 CRAM-MD5
else
:
fi
}
lp_delete2() {
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 \
--folder INBOX \
--delete2 --expunge2
else
:
fi
}
# mandatory tests
@ -810,37 +787,39 @@ run_tests perl_syntax
test $# -eq 0 && run_tests \
no_args \
first_sync \
loulplume \
plumeloul \
lp_folder \
lp_buffersize \
pl_folder \
pl_folder_qqq \
pl_prefix12 \
lp_internaldate \
lp_subscribed \
lp_subscribe \
lp_justconnect \
lp_justfoldersizes \
lp_authmd5 \
lp_maxage \
lp_maxsize \
lp_include \
bad_login \
bad_host \
lp_noauthmd5 \
lp_skipsize \
lp_skipheader \
lp_regextrans2 \
foldersizes \
regexmess \
useheader \
lp_ssl \
lp_authmech_LOGIN \
lp_authmech_CRAMMD5 \
lp_authmech_PLAIN \
lp_authuser
locallocal \
ll_folder \
ll_buffersize \
ll_justfolders \
ll_prefix12 \
ll_internaldate \
ll_folder_rev \
ll_subscribed \
ll_subscribe \
ll_justconnect \
ll_justfoldersizes \
ll_authmd5 \
ll_noauthmd5 \
ll_maxage \
ll_maxsize \
ll_skipsize \
ll_skipheader \
ll_include \
ll_regextrans2 \
ll_sep2 \
ll_bad_login \
ll_bad_host \
ll_justfoldersizes \
ll_useheader \
ll_regexmess \
ll_flags \
ll_regex_flag \
ll_ssl \
ll_authmech_PLAIN \
ll_authmech_LOGIN \
ll_authmech_CRAMMD5 \
ll_authuser \
ll_delete2