This commit is contained in:
Nick Bebout 2011-03-12 02:44:22 +00:00
parent cdefaa6ccf
commit 79f17648bd
9 changed files with 109 additions and 18 deletions

View file

@ -1,5 +1,8 @@
#!/bin/cat #!/bin/cat
Subbarao & Prasanthi Punnamaraju
Asked how to move emails from InBox to a sub-folder.
Sven Havemann Sven Havemann
Moved from Braunschweig to Graz and asked Moved from Braunschweig to Graz and asked
how to move Braunschweig mail sorted into how to move Braunschweig mail sorted into

View file

@ -1,15 +1,21 @@
RCS file: RCS/imapsync,v RCS file: RCS/imapsync,v
Working file: imapsync Working file: imapsync
head: 1.158 head: 1.159
branch: branch:
locks: strict locks: strict
access list: access list:
symbolic names: symbolic names:
keyword substitution: kv keyword substitution: kv
total revisions: 158; selected revisions: 158 total revisions: 159; selected revisions: 159
description: description:
---------------------------- ----------------------------
revision 1.159
date: 2006/03/11 13:00:52; author: gilles; state: Exp; lines: +11 -8
Added failure story dkimap
Fixed bug when both --minage and --maxage are used.
Changed message date selection : date sent instead of internal date.
----------------------------
revision 1.158 revision 1.158
date: 2006/03/02 06:28:30; author: gilles; state: Exp; lines: +38 -29 date: 2006/03/02 06:28:30; author: gilles; state: Exp; lines: +38 -29
Made acls_sync() to_folder_name() Made acls_sync() to_folder_name()

45
FAQ
View file

@ -86,6 +86,51 @@ R. Examples:
2) To sync a complete account in a subfolder called FOO: 2) To sync a complete account in a subfolder called FOO:
--regextrans2 's/^INBOX(.*)/INBOX.FOO$1/' --regextrans2 's/^INBOX(.*)/INBOX.FOO$1/'
=======================================================================
Q. I would like to move emails from InBox to a sub-folder
called , say "2005-InBox" based on the date (Like all emails
received in the Year 2005 should be moved to the folder
called "2005-InBox").
R. 2 ways :
a) Manually:
------------
1) You create a folder INBOX.2005-INBOX
2) Mostly every email software allow sorting by date.
In inbox, you select from 1 january to 31 december
messages with the shift key.
3) Cut/paste in INBOX.2005-INBOX
b) With imapsync:
-----------------
you have to calculate the day of year (and
add 365). For example, running it today, Sat Mar 11
13:06:01 CET 2006:
imapsync ...
--host1 imap.truc.org --host2 imap.trac.org \
--user1 foo --user2 foo \
...
--maxage 435 --minage 70 \
--regextrans2 's/^INBOX$/INBOX.2005-INBOX/' \
--folder INBOX
To know the day of year:
$ date
Sat Mar 11 13:06:01 CET 2006
$ date +%j
070
Also, you must take imapsync 1.159 at least since I tested
what I just wrote above and found 2 bugs about --mindate
--maxdate options behavior.
======================================================================= =======================================================================
Q. I'm migrating from WU to Cyrus, and the mail folders are Q. I'm migrating from WU to Cyrus, and the mail folders are
under /home/user/mail but the tool copies everything in under /home/user/mail but the tool copies everything in

7
README
View file

@ -2,7 +2,7 @@ NAME
imapsync - IMAP synchronization, copy or migration tool. Synchronize imapsync - IMAP synchronization, copy or migration tool. Synchronize
mailboxes between two imap servers. Good at IMAP migration. mailboxes between two imap servers. Good at IMAP migration.
$Revision: 1.158 $ $Revision: 1.159 $
INSTALL INSTALL
imapsync works fine under any Unix OS. imapsync works fine under any Unix OS.
@ -178,7 +178,8 @@ IMAP SERVERS
- MailEnable 1.54 (Proprietary) http://www.mailenable.com/ - MailEnable 1.54 (Proprietary) http://www.mailenable.com/
- DBMail 2.0.7 (GPL). But DBMail 1.2.1 works. - DBMail 2.0.7 (GPL). But DBMail 1.2.1 works.
Patient and confident testers are welcome. Patient and confident testers are welcome.
- dkimap4 2.39
Success stories reported with the following imap servers (softwares Success stories reported with the following imap servers (softwares
names are in alphabetic order) : names are in alphabetic order) :
@ -274,5 +275,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.158 2006/03/02 06:28:30 gilles Exp $ $Id: imapsync,v 1.159 2006/03/11 13:00:52 gilles Exp $

View file

@ -1 +1 @@
1.158 1.159

View file

@ -1,7 +1,8 @@
Project: imapsync Project: imapsync
Version: 1.156 Version: 1.158
Release-Focus: Major feature enhancements Release-Focus: Code cleanup
Hide: N Hide: Y
Home-Page-URL: http://www.linux-france.org/prj/imapsync/ Home-Page-URL: http://www.linux-france.org/prj/imapsync/
Gzipped-Tar-URL: http://www.linux-france.org/prj/imapsync/dist/ Gzipped-Tar-URL: http://www.linux-france.org/prj/imapsync/dist/
Code cleanup.

View file

@ -6,7 +6,7 @@ imapsync - IMAP synchronization, copy or migration
tool. Synchronize mailboxes between two imap servers. Good tool. Synchronize mailboxes between two imap servers. Good
at IMAP migration. at IMAP migration.
$Revision: 1.158 $ $Revision: 1.159 $
=head1 INSTALL =head1 INSTALL
@ -205,7 +205,8 @@ Failure stories reported with the following imap servers :
- MailEnable 1.54 (Proprietary) http://www.mailenable.com/ - MailEnable 1.54 (Proprietary) http://www.mailenable.com/
- DBMail 2.0.7 (GPL). But DBMail 1.2.1 works. - DBMail 2.0.7 (GPL). But DBMail 1.2.1 works.
Patient and confident testers are welcome. Patient and confident testers are welcome.
- dkimap4 2.39
Success stories reported with the following imap servers Success stories reported with the following imap servers
(softwares names are in alphabetic order) : (softwares names are in alphabetic order) :
@ -322,7 +323,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.158 2006/03/02 06:28:30 gilles Exp $ $Id: imapsync,v 1.159 2006/03/11 13:00:52 gilles Exp $
=cut =cut
@ -370,7 +371,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.158 2006/03/02 06:28:30 gilles Exp $ '; $rcs = ' $Id: imapsync,v 1.159 2006/03/11 13:00:52 gilles Exp $ ';
$rcs =~ m/,v (\d+\.\d+)/; $rcs =~ m/,v (\d+\.\d+)/;
$VERSION = ($1) ? $1 : "UNKNOWN"; $VERSION = ($1) ? $1 : "UNKNOWN";
@ -407,8 +408,8 @@ $error=0;
my $banner = join("", my $banner = join("",
'$RCSfile: imapsync,v $ ', '$RCSfile: imapsync,v $ ',
'$Revision: 1.158 $ ', '$Revision: 1.159 $ ',
'$Date: 2006/03/02 06:28:30 $ ', '$Date: 2006/03/11 13:00:52 $ ',
"\n", "\n",
"Mail::IMAPClient version used here is ", "Mail::IMAPClient version used here is ",
$VERSION_IMAPClient,"\n" $VERSION_IMAPClient,"\n"
@ -1084,16 +1085,18 @@ sub select_msgs {
return(@msgs); return(@msgs);
} }
if (defined($maxage)) { if (defined($maxage)) {
@max = $imap->since(time - 86400 * $maxage); @max = $imap->sentsince(time - 86400 * $maxage);
} }
if (defined($minage)) { if (defined($minage)) {
@min = $imap->before(time - 86400 * $minage); @min = $imap->sentbefore(time - 86400 * $minage);
} }
SWITCH: { SWITCH: {
unless(defined($minage)) {@msgs = @max; last SWITCH}; unless(defined($minage)) {@msgs = @max; last SWITCH};
unless(defined($maxage)) {@msgs = @min; last SWITCH}; unless(defined($maxage)) {@msgs = @min; last SWITCH};
my (%union, %inter); my (%union, %inter);
foreach my $m (@min, @max) {$union{$m}++ && $inter{$m}++} foreach my $m (@min, @max) {$union{$m}++ && $inter{$m}++}
@inter = keys(%inter);
@union = keys(%union);
# normal case # normal case
if ($minage <= $maxage) {@msgs = @inter; last SWITCH}; if ($minage <= $maxage) {@msgs = @inter; last SWITCH};
# just exclude messages between # just exclude messages between

3
memo
View file

@ -44,11 +44,12 @@ else
cat > $NEWS_FILE_FM << EOF cat > $NEWS_FILE_FM << EOF
Project: imapsync Project: imapsync
Version: $VERSION Version: $VERSION
Release-Focus: Minor feature enhancements Release-Focus: Major bugfixe
Hide: Y Hide: Y
Home-Page-URL: http://www.linux-france.org/prj/imapsync/ Home-Page-URL: http://www.linux-france.org/prj/imapsync/
Gzipped-Tar-URL: http://www.linux-france.org/prj/imapsync/dist/ Gzipped-Tar-URL: http://www.linux-france.org/prj/imapsync/dist/
Code cleanup.
EOF EOF
freshmeat-submit < $NEWS_FILE_FM freshmeat-submit < $NEWS_FILE_FM
fi fi

31
zzz Normal file
View file

@ -0,0 +1,31 @@
$RCSfile: imapsync,v $ $Revision: 1.158 $ $Date: 2006/03/02 06:28:30 $
Mail::IMAPClient version used here is 2.2.9
From imap server [loul] port [143] user [tata]
To imap server [plume] port [143] user [tata]
Server [loul] has NOT capability CRAM-MD5
Server [plume] has NOT capability CRAM-MD5
From software : 2 CAPABILITY
To software : 2 CAPABILITY
From capability : QUOTA X-NETSCAPE NAMESPACE X-NON-HIERARCHICAL-RENAME ACL UNSELECT LITERAL+ NO_ATOMIC_RENAME UIDPLUS IMAP4 IMAP4REV1
To capability : ACL AUTH=LOGIN NAMESPACE IMAP4REV1 IMAP4
From separator and prefix : [.][INBOX.]
To separator and prefix : [/][]
++++ Calculating sizes ++++
From Folder [INBOX] Size: 5703203 Messages: 1432
Total size: 5703203
Total messages: 1432
Time : 0 s
++++ Calculating sizes ++++
To Folder [INBOX] Size: 17108791 Messages: 4294
Total size: 17108791
Total messages: 4294
Time : 0 s
From folders : [INBOX]
To folders : [INBOX]
From subscribed folders : [INBOX.yop.yap]
From Folder [INBOX]
To Folder [INBOX]
++++ From [INBOX] Parse 1 ++++
++++ To [INBOX] Parse 1 ++++
++++ Verifying [INBOX] -> [INBOX] ++++
Time : 11 s