This commit is contained in:
Nick Bebout 2011-09-25 15:31:48 -05:00
parent 90be463820
commit 1b3773e80f
22 changed files with 592 additions and 208 deletions

View file

@ -1,17 +1,33 @@
RCS file: RCS/imapsync,v RCS file: RCS/imapsync,v
Working file: imapsync Working file: imapsync
head: 1.452 head: 1.456
branch: branch:
locks: strict locks: strict
gilles: 1.452 gilles: 1.456
access list: access list:
symbolic names: symbolic names:
keyword substitution: kv keyword substitution: kv
total revisions: 452; selected revisions: 452 total revisions: 456; selected revisions: 456
description: description:
---------------------------- ----------------------------
revision 1.452 locked by: gilles; revision 1.456 locked by: gilles;
date: 2011/08/24 04:21:30; author: gilles; state: Exp; lines: +15 -13
Help message on --sep when namespace separator is NIL. Yahoo case.
----------------------------
revision 1.455
date: 2011/07/29 03:00:25; author: gilles; state: Exp; lines: +8 -8
Empty default value for $h1_flags $h2_flags to avoid useless Perl warnings.
----------------------------
revision 1.454
date: 2011/07/15 16:17:06; author: gilles; state: Exp; lines: +22 -10
file.csv example
----------------------------
revision 1.453
date: 2011/07/15 00:35:37; author: gilles; state: Exp; lines: +10 -6
MDaemon 12.0.3 failure as host2 (APPEND buggy)
----------------------------
revision 1.452
date: 2011/07/11 00:29:06; author: gilles; state: Exp; lines: +64 -47 date: 2011/07/11 00:29:06; author: gilles; state: Exp; lines: +64 -47
Added the --search option allowing to select messages with the powerful IMAP SEARCH command. Added the --search option allowing to select messages with the powerful IMAP SEARCH command.
---------------------------- ----------------------------

125
FAQ
View file

@ -1,5 +1,5 @@
#!/bin/cat #!/bin/cat
# $Id: FAQ,v 1.89 2011/07/11 01:17:39 gilles Exp gilles $ # $Id: FAQ,v 1.92 2011/08/24 06:50:17 gilles Exp gilles $
+------------------+ +------------------+
| FAQ for imapsync | | FAQ for imapsync |
@ -8,14 +8,16 @@
Unix versus Windows syntax. Unix versus Windows syntax.
On Unix shells you can write a single command on multiple lines On Unix shells you can write a single command on multiple lines
by using the escape character \ at the end of each line by using the escape character \ at the end of each line
(except the last one). (except the last one). On Windows this character is ^
Unix example:
./imapsync \ ./imapsync \
--host1 imap.truc.org --user1 foo --password1 secret1 \ --host1 imap.truc.org --user1 foo --password1 secret1 \
--host2 imap.trac.org --user2 bar --password2 secret2 --host2 imap.trac.org --user2 bar --password2 secret2
On Windows this character is ^ Windows example:
imapsync ^ imapsync ^
--host1 imap.truc.org --user1 foo --password1 secret1 ^ --host1 imap.truc.org --user1 foo --password1 secret1 ^
@ -47,8 +49,8 @@ R. http://www.linux-france.org/prj/imapsync/FAQ
======================================================================= =======================================================================
Q. How can I have commercial support? Q. How can I have commercial support?
R. Ask the imapsync author and expert: Gilles LAMIRAL R. Buy support from imapsync author and expert: Gilles LAMIRAL
Rates per hour (2011) : 84 euros (111 USD) http://ks.lamiral.info/imapsync/#buy_support
======================================================================= =======================================================================
Q. How can I have gratis support? Q. How can I have gratis support?
@ -76,31 +78,36 @@ post to this list if you want to stay private.
Thank you for your participation. Thank you for your participation.
======================================================================= =======================================================================
Q. Where I can read up on the various IMAP RFCs? Q. I need to migrate hundred accounts, how can I do?
R. Here: R. If you have many mailboxes to migrate think about a little
shell program. Write a file called file.csv (for example)
containing users and passwords.
The separator used in this example is ';'
RFC 3501 - INTERNET MESSAGE ACCESS PROTOCOL - VERSION 4rev1 The file.csv file contains:
http://www.faqs.org/rfcs/rfc3501.html
RFC2683 - IMAP4 Implementation Recommendations user001_1;password001_1;user001_2;password001_2
http://www.faqs.org/rfcs/rfc2683.html user002_1;password002_1;user002_2;password002_2
user003_1;password003_1;user003_2;password003_2
user004_1;password004_1;user004_2;password004_2
user005_1;password005_1;user005_2;password005_2
...
RFC 2595 - Using TLS with IMAP, POP3 and ACAP On Unix the shell program can be:
http://www.faqs.org/rfcs/rfc2595.html
RFC 2822 - Internet Message Format { while IFS=';' read u1 p1 u2 p2; do
http://www.faqs.org/rfcs/rfc2822.html imapsync --host1 imap.side1.org --user1 "$u1" --password1 "$p1" \
--host2 imap.side2.org --user2 "$u2" --password2 "$p2" ...
done ; } < file.csv
RFC 2342 - IMAP4 Namespace On Windows the batch program can be:
http://www.faqs.org/rfcs/rfc2342.html
RFC2180 - IMAP4 Multi-Accessed Mailbox Practice FOR /F "tokens=1,2,3,4 delims=; eol=#" %%G IN (file.csv) DO imapsync ^
http://www.faqs.org/rfcs/rfc2180.html --host1 imap.side1.org --user1 %%G --password1 %%H ^
--host2 imap.side2.org --user2 %%I --password2 %%J ...
RFC 4549 - Synchronization Operations for Disconnected IMAP4 Clients
http://www.faqs.org/rfcs/rfc4549.html
The ... can be replaced by nothing or any supplementary imapsync option.
======================================================================= =======================================================================
Q. Where I can find old imapsync releases? Q. Where I can find old imapsync releases?
@ -190,26 +197,34 @@ The sent time and date are given by the "Date:" header and it is set
most of the time by the MUA (Mail User Agent, Mutt, Eudora, most of the time by the MUA (Mail User Agent, Mutt, Eudora,
Thunderbird etc.). Thunderbird etc.).
imapsync does not touch any header since the header is used to imapsync does not touch any byte of messages unless told to do so
identify the messages in both parts. by an option. Messages on both parts should be identical
(some IMAP servers add or even change header lines).
Solutions: Solutions:
a) use --idatefromheader to set the internal dates on host2 same as the a) Use the --syncinternaldates option and keep using Eudora.
"Date:" headers. But --syncinternaldates is now turn on by default so if you
b) In Maildir boxes, after the sync (too late...), use the script encounter the issue then the solution is harder, depending
on email client softwares and IMAP server softwares.
b) use --idatefromheader to set the internal dates on host2 same as the
"Date:" headers. It won't work if a) doesn't work.
c) In Maildir boxes, after the sync (too late...), use the script
learn/adjust_time.pl to change the internal dates from the "Date:" header. learn/adjust_time.pl to change the internal dates from the "Date:" header.
c) Don't use buggy Eudora.
d) Use the --syncinternaldates option and keep using Eudora. d) Use a better email client.
--syncinternaldates is now turn on by default.
======================================================================= =======================================================================
Q. imapsync calculates 479 messages in a folder but only transfers 400 Q. imapsync calculates 479 messages in a folder but only transfers 400
messages. What's happen? messages. What's happen?
R1. imapsync considers the header part of a message (as a whole or R1. Unless --useuid is used, imapsync considers the header part
only specific lines depending on --useheader --skipheader) of a message to identify a message on both sides.
to identify a message on both sides. Header part is taken as a whole with "--useheader ALL" or
only specific lines depending on --useheader --skipheader
or default values.
Consequences: Consequences:
@ -222,6 +237,22 @@ R2. With option --useuid imapsync doesn't use headers to identify
messages on both sides but it uses their imap uid. In than case messages on both sides but it uses their imap uid. In than case
duplicates are transfered and --delete2 won't work. duplicates are transfered and --delete2 won't work.
=======================================================================
Q. I need to log every output on a file named log.txt
R. Use redirections of both standard and error outputs "> log.txt 2>&1"
imapsync ... > log.txt 2>&1
=======================================================================
Q. I need to log every output on a file named log.txt and also to the
screen in order to keep seeing what's going on during execution
R. Use the tee program (also available on Windows)
http://en.wikipedia.org/wiki/Tee_%28command%29
imapsync ... 2>&1 | tee log.txt
======================================================================= =======================================================================
Q. I run multiple imapsync applications at the same time then get a Q. I run multiple imapsync applications at the same time then get a
warning "imapsync.pid already exists, overwriting it". warning "imapsync.pid already exists, overwriting it".
@ -1241,3 +1272,31 @@ R. You'll find an RPM imapsync.spec file in the directory learn/rpm/
It has been tested with imapsync 1.434 (May 2011) on CentOS5 It has been tested with imapsync 1.434 (May 2011) on CentOS5
and RedHat RHEL5 Linux. (Thanks to Ole Holm Nielsen). and RedHat RHEL5 Linux. (Thanks to Ole Holm Nielsen).
This imapsync.spec is derivated from Neil Brown work in 2007. This imapsync.spec is derivated from Neil Brown work in 2007.
=======================================================================
Q. Where I can read up on the various IMAP RFCs?
R. Here:
RFC 3501 - INTERNET MESSAGE ACCESS PROTOCOL - VERSION 4rev1
http://www.faqs.org/rfcs/rfc3501.html
RFC2683 - IMAP4 Implementation Recommendations
http://www.faqs.org/rfcs/rfc2683.html
RFC 2595 - Using TLS with IMAP, POP3 and ACAP
http://www.faqs.org/rfcs/rfc2595.html
RFC 2822 - Internet Message Format
http://www.faqs.org/rfcs/rfc2822.html
RFC 2342 - IMAP4 Namespace
http://www.faqs.org/rfcs/rfc2342.html
RFC2180 - IMAP4 Multi-Accessed Mailbox Practice
http://www.faqs.org/rfcs/rfc2180.html
RFC 4549 - Synchronization Operations for Disconnected IMAP4 Clients
http://www.faqs.org/rfcs/rfc4549.html

View file

@ -1,5 +1,5 @@
# $Id: Makefile,v 1.82 2011/07/11 01:02:45 gilles Exp gilles $ # $Id: Makefile,v 1.84 2011/07/29 03:02:01 gilles Exp gilles $
.PHONY: help usage all .PHONY: help usage all
@ -17,6 +17,7 @@ usage:
@echo "make tests_win32_dev # run test2.bat on win32" @echo "make tests_win32_dev # run test2.bat on win32"
@echo "make all " @echo "make all "
@echo "make upload_index" @echo "make upload_index"
@echo "make upload_ks"
@echo "make imapsync.exe" @echo "make imapsync.exe"
@echo "make imapsync_elf_x86.bin" @echo "make imapsync_elf_x86.bin"
@ -144,7 +145,7 @@ tests_win32: dosify_bat
# ssh Admin@c 'tasklist /NH /FO CSV' # ssh Admin@c 'tasklist /NH /FO CSV'
tests_win32_dev: dosify_bat tests_win32_dev: dosify_bat
scp imapsync test2.bat Admin@c:'C:/msys/1.0/home/Admin/imapsync/' scp imapsync file.csv test2.bat Admin@c:'C:/msys/1.0/home/Admin/imapsync/'
ssh Admin@c 'C:/msys/1.0/home/Admin/imapsync/test2.bat' ssh Admin@c 'C:/msys/1.0/home/Admin/imapsync/test2.bat'
test_imapsync_exe: dosify_bat test_imapsync_exe: dosify_bat
@ -238,7 +239,7 @@ dist_dir:
dist_prepa_exe: imapsync.exe dist_prepa_exe: imapsync.exe
mkdir -p $(DIST_PATH) mkdir -p $(DIST_PATH)
ln -f ./imapsync.exe $(DIST_PATH)/ cp -a ./imapsync.exe $(DIST_PATH)/
#cd $(DIST_PATH)/ && md5sum ./imapsync.exe > ./imapsync.exe.md5.txt #cd $(DIST_PATH)/ && md5sum ./imapsync.exe > ./imapsync.exe.md5.txt
#cd $(DIST_PATH)/ && md5sum -c ./imapsync.exe.md5.txt #cd $(DIST_PATH)/ && md5sum -c ./imapsync.exe.md5.txt
@ -279,8 +280,6 @@ upload_index: index.shtml
../../public_html/www.linux-france.org/html/prj/imapsync/ ../../public_html/www.linux-france.org/html/prj/imapsync/
sh $(HOME)/memo/lfo-rsync sh $(HOME)/memo/lfo-rsync
niouze_lfo : niouze_lfo :
echo "CORRECT ME: . ./memo && lfo_announce" echo "CORRECT ME: . ./memo && lfo_announce"

27
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 36 different IMAP server softwares supported with success. More than 36 different IMAP server softwares supported with success.
$Revision: 1.452 $ $Revision: 1.456 $
SYNOPSIS SYNOPSIS
To synchronise imap account "foo" on "imap.truc.org" to imap account To synchronise imap account "foo" on "imap.truc.org" to imap account
@ -293,6 +293,9 @@ IMAP SERVERS
- DBMail 0.9, 2.0.7 (GPL). But DBMail 1.2.1 is supported. - DBMail 0.9, 2.0.7 (GPL). But DBMail 1.2.1 is supported.
Patient and confident testers are welcome. Patient and confident testers are welcome.
- Imail 7.04 (maybe). - Imail 7.04 (maybe).
- (2011) MDaemon 12.0.3 as host2 but MDaemon is supported as host1.
MDaemon is simply buggy with the APPEND IMAP command with
any IMAP email client.
Success stories reported with the following 44 imap servers (software Success stories reported with the following 44 imap servers (software
names are in alphabetic order): names are in alphabetic order):
@ -387,15 +390,27 @@ HUGE MIGRATION
The file.csv file contains: The file.csv file contains:
user0001;password0001;user0002;password0002 user001_1;password001_1;user001_2;password001_2
user0011;password0011;user0012;password0012 ... user002_1;password002_1;user002_2;password002_2
user003_1;password003_1;user003_2;password003_2
user004_1;password004_1;user004_2;password004_2
user005_1;password005_1;user005_2;password005_2 ...
And the shell program is just: On Unix the shell program can be:
{ while IFS=';' read u1 p1 u2 p2; do { while IFS=';' read u1 p1 u2 p2; do
imapsync --user1 "$u1" --password1 "$p1" --user2 "$u2" --password2 "$p2" ... imapsync --host1 imap.side1.org --user1 "$u1" --password1 "$p1" \
--host2 imap.side2.org --user2 "$u2" --password2 "$p2" ...
done ; } < file.csv done ; } < file.csv
On Windows the batch program can be:
FOR /F "tokens=1,2,3,4 delims=; eol=#" %%G IN (file.csv) DO imapsync ^
--host1 imap.side1.org --user1 %%G --password1 %%H ^
--host2 imap.side2.org --user2 %%I --password2 %%J ...
The ... have to be replaced by nothing or any imapsync option.
Welcome in shell programming ! Welcome in shell programming !
Hacking Hacking
@ -426,5 +441,5 @@ SIMILAR SOFTWARES
Feedback (good or bad) will often be welcome. Feedback (good or bad) will often be welcome.
$Id: imapsync,v 1.452 2011/07/11 00:29:06 gilles Exp gilles $ $Id: imapsync,v 1.456 2011/08/24 04:21:30 gilles Exp gilles $

2
TIME
View file

@ -1,3 +1,5 @@
120 Statistics statistics_VERSION_synthesis
150 10 years old announce. index.html. 10 EUR. freshmeat announce+release 1.452
60 Added --search option. 60 Added --search option.
600 (1.446) new host ks. newsletter for imapsync updates. first letter to 563 members. 600 (1.446) new host ks. newsletter for imapsync updates. first letter to 563 members.
30 Patched tests_good_date() and good_date() with Dax Kelson patches. 30 Patched tests_good_date() and good_date() with Dax Kelson patches.

4
TODO
View file

@ -1,5 +1,5 @@
#!/bin/cat #!/bin/cat
# $Id: TODO,v 1.100 2011/07/11 01:09:39 gilles Exp gilles $ # $Id: TODO,v 1.101 2011/08/24 06:50:30 gilles Exp gilles $
TODO file for imapsync TODO file for imapsync
---------------------- ----------------------
@ -36,6 +36,8 @@ Does \lalala can be forbidden (courier does a
with with
* OK [PERMANENTFLAGS (\* \Draft \Answered \Flagged \Deleted \Seen)] Limited * OK [PERMANENTFLAGS (\* \Draft \Answered \Flagged \Deleted \Seen)] Limited
Add an option to log both on screen and append to a file.
At least document the tee command solution (Unix and Windows)
Suggestion: it's very difficult to track down messages which are behaving Suggestion: it's very difficult to track down messages which are behaving
funny during the sync. It would be great - and presumably easy to code - funny during the sync. It would be great - and presumably easy to code -

View file

@ -1 +1 @@
1.452 1.456

View file

@ -1 +1 @@
1.452 1.456

View file

@ -1,6 +1,6 @@
#!/usr/bin/perl #!/usr/bin/perl
# $Id: paypal_bilan,v 1.35 2011/06/28 23:18:12 gilles Exp gilles $ # $Id: paypal_bilan,v 1.36 2011/07/18 19:21:07 gilles Exp gilles $
use strict; use strict;
use warnings; use warnings;
@ -143,23 +143,21 @@ my $nb_invoice_sent = scalar( @invoice_sent ) ;
print "USD banque $total_usd_received\n" ; print "USD banque $total_usd_received\n" ;
print "USD invoice $total_usd_invoice\n" ; print "USD invoice $total_usd_invoice\n" ;
my $total_eur_from_usd ; my $total_eur_from_usd ;
$total_eur_from_usd = int( ( $total_usd_invoice / $usdeur ) + 0.5 ) ; # au 30 nov 2010 http://fr.finance.yahoo.com/devises/convertisseur/#from=EUR;to=USD;amt=1 $total_eur_from_usd = sprintf('%2.2f', $total_usd_invoice / $usdeur ) ; # au 30 nov 2010 http://fr.finance.yahoo.com/devises/convertisseur/#from=EUR;to=USD;amt=1
print "EUR from USD $total_eur_from_usd\n" ; print "EUR from USD $total_eur_from_usd\n" ;
#$total_eur = int( ( $total_eur_invoice / 1.3 ) + 0.5 ) ;
#print "EUR $total_eur_from_usd\n" ;
print "EUR banque $total_eur_received\n" ; print "EUR banque $total_eur_received\n" ;
print "EUR invoice $total_eur_invoice\n" ; print "EUR invoice $total_eur_invoice\n" ;
my $total_eur = $total_eur_from_usd + $total_eur_invoice ; my $total_eur = $total_eur_from_usd + $total_eur_invoice ;
$total_HT_EUR_exo = sprintf('%2.f', $total_HT_EUR_exo) ; $total_HT_EUR_exo = sprintf('%2.2f', $total_HT_EUR_exo) ;
$total_HT_EUR_ass = sprintf('%2.f', $total_HT_EUR_ass) ; $total_HT_EUR_ass = sprintf('%2.2f', $total_HT_EUR_ass) ;
$total_TVA_EUR = sprintf('%2.f', $total_TVA_EUR) ; $total_TVA_EUR = sprintf('%2.2f', $total_TVA_EUR) ;
$total_HT_EUR_sup = sprintf('%2.f', $total_HT_EUR_sup) ; $total_HT_EUR_sup = sprintf('%2.2f', $total_HT_EUR_sup) ;
$total_TVA_EUR_sup = sprintf('%2.f', $total_TVA_EUR_sup) ; $total_TVA_EUR_sup = sprintf('%2.2f', $total_TVA_EUR_sup) ;
$total_eur = sprintf('%2.f', $total_eur) ; $total_eur = sprintf('%2.2f', $total_eur) ;
print "EUR total $total_eur\n" ; print "EUR total $total_eur\n" ;
print "EUR total HT exo $total_HT_EUR_exo\n" ; print "EUR total HT exo $total_HT_EUR_exo\n" ;

View file

@ -13,8 +13,12 @@ set -x
#/g/public_html/imapsync/W/paypal_reply/paypal_bilan --write_invoices --first_in 473 /g/paypal/paypal_2011_03_complet.csv #/g/public_html/imapsync/W/paypal_reply/paypal_bilan --write_invoices --first_in 473 /g/paypal/paypal_2011_03_complet.csv
#/g/public_html/imapsync/W/paypal_reply/paypal_bilan --write_invoices --first_in 570 /g/paypal/paypal_2011_04_complet.csv #/g/public_html/imapsync/W/paypal_reply/paypal_bilan --write_invoices --first_in 570 /g/paypal/paypal_2011_04_complet.csv
#/g/public_html/imapsync/W/paypal_reply/paypal_bilan --write_invoices --first_in 645 /g/paypal/paypal_2011_05_complet.csv #/g/public_html/imapsync/W/paypal_reply/paypal_bilan --write_invoices --first_in 645 /g/paypal/paypal_2011_05_complet.csv
/g/public_html/imapsync/W/paypal_reply/paypal_bilan --write_invoices --first_in 733 /g/paypal/paypal_2011_06_complet.csv #/g/public_html/imapsync/W/paypal_reply/paypal_bilan --write_invoices --first_in 733 /g/paypal/paypal_2011_06_complet.csv
/g/public_html/imapsync/W/paypal_reply/paypal_bilan --write_invoices --first_in 824 /g/paypal/paypal_2011_07_complet.csv #/g/public_html/imapsync/W/paypal_reply/paypal_bilan --write_invoices --first_in 824 /g/paypal/paypal_2011_07_complet.csv
/g/public_html/imapsync/W/paypal_reply/paypal_bilan --write_invoices --first_in 917 /g/paypal/paypal_2011_08_complet.csv
# /g/public_html/imapsync/W/paypal_reply/paypal_bilan --first_in 824 /g/paypal/paypal_2011_07_complet.csv
# /g/public_html/imapsync/W/paypal_reply/paypal_bilan --first_in 917 /g/paypal/paypal_2011_08_complet.csv
set +x set +x
# La totale # La totale
@ -22,6 +26,12 @@ set +x
--first_in 147 --avoid_numbers '292 293 643 644 731 732' \ --first_in 147 --avoid_numbers '292 293 643 644 731 732' \
/g/paypal/paypal_201?_??_complet.csv /g/paypal/paypal_201?_??_complet.csv
: || /g/public_html/imapsync/W/paypal_reply/paypal_bilan \
--first_in 147 --avoid_numbers '292 293 643 644 731 732' \
/g/paypal/paypal_201?_??_complet.csv
# USD de 147 à 340 # USD de 147 à 340
# EUR de 341 à ... # EUR de 341 à ...
@ -67,6 +77,8 @@ set +x
# 556 TVA 4,92 # 556 TVA 4,92
# 563 TVA 4,92 # 563 TVA 4,92
echo 'sh paypal_build_invoices /g/var/paypal_invoices/???'
for d in "$@"; do for d in "$@"; do
echo "==== $d ====" echo "==== $d ===="
cd $d cd $d

View file

@ -1,6 +1,6 @@
#!/bin/sh #!/bin/sh
# $Id: paypal_send_invoices,v 1.6 2011/06/07 23:40:21 gilles Exp gilles $ # $Id: paypal_send_invoices,v 1.7 2011/07/14 12:31:44 gilles Exp gilles $
# usages: # usages:
# sh paypal_send_invoices /g/var/paypal_invoices/147 # sh paypal_send_invoices /g/var/paypal_invoices/147
@ -26,7 +26,7 @@ send_invoice() {
test -f facture_message_body.txt || { echo NO facture_message_body.txt ; return; } test -f facture_message_body.txt || { echo NO facture_message_body.txt ; return; }
test -f email_address.txt || { echo NO email_address.txt ; return; } test -f email_address.txt || { echo NO email_address.txt ; return; }
email=${2:-`cat email_address.txt`} email=${2:-`cat email_address_2.txt || cat email_address.txt`}
> facture_message_to.txt > facture_message_to.txt
egrep '^To: ' facture_message_header.txt > /dev/null || echo "To: $email" > facture_message_to.txt egrep '^To: ' facture_message_header.txt > /dev/null || echo "To: $email" > facture_message_to.txt
cat facture_message_header.txt facture_message_to.txt facture_message_body.txt > facture_message.txt cat facture_message_header.txt facture_message_to.txt facture_message_body.txt > facture_message.txt
@ -49,6 +49,8 @@ send_invoice() {
} }
} }
echo $0 '/g/var/paypal_invoices/99?'
for d in "$@"; do for d in "$@"; do
( send_invoice "$d" ) ( send_invoice "$d" )
done done

22
file.csv Normal file
View file

@ -0,0 +1,22 @@
# Example file.csv for imapsync massive migration.
# Thanks to http://ss64.com/nt/for_f.html
#
# A line beginning with # is a comment thanks to option Win32 eol=#
# Separator is character ; it can be changed by any character using delims=;
# Each contains 4 columns, columns are parameters for --user1 --password1 --user2 --password2
#
# This file can be used on Windows with the following line in a batch
# FOR /F "tokens=1,2,3,4 delims=; eol=#" %%G IN (file.csv) DO imapsync --host1 imap.truc.org --user1 %%G --password1 %%H --host2 imap.trac.org --user2 %%I --password2 %%J
#
# This file can be used on Unix with the following line in a Bourne shell script
# { while IFS=';' read u1 p1 u2 p2; do imapsync --user1 "$u1" --password1 "$p1" --user2 "$u2" --password2 "$p2" ... ; done ; } < file.csv
#
#
#
user001_1;password001_1;user001_2;password001_2
user002_1;password002_1;user002_2;password002_2
user003_1;password003_1;user003_2;password003_2
# Another comment blabla
user004_1;password004_1;user004_2;password004_2
user005_1;password005_1;user005_2;password005_2
Can't render this file because it contains an unexpected character in line 10 and column 10.

View file

@ -20,7 +20,7 @@ Synchronise mailboxes between two imap servers.
Good at IMAP migration. More than 36 different IMAP server softwares Good at IMAP migration. More than 36 different IMAP server softwares
supported with success. supported with success.
$Revision: 1.452 $ $Revision: 1.456 $
=head1 SYNOPSIS =head1 SYNOPSIS
@ -341,6 +341,10 @@ Failure stories reported with the following 3 imap servers:
- DBMail 0.9, 2.0.7 (GPL). But DBMail 1.2.1 is supported. - DBMail 0.9, 2.0.7 (GPL). But DBMail 1.2.1 is supported.
Patient and confident testers are welcome. Patient and confident testers are welcome.
- Imail 7.04 (maybe). - Imail 7.04 (maybe).
- (2011) MDaemon 12.0.3 as host2 but MDaemon is supported as host1.
MDaemon is simply buggy with the APPEND IMAP command with
any IMAP email client.
Success stories reported with the following 44 imap servers Success stories reported with the following 44 imap servers
(software names are in alphabetic order): (software names are in alphabetic order):
@ -454,16 +458,28 @@ The separator used in this example is ';'
The file.csv file contains: The file.csv file contains:
user0001;password0001;user0002;password0002 user001_1;password001_1;user001_2;password001_2
user0011;password0011;user0012;password0012 user002_1;password002_1;user002_2;password002_2
user003_1;password003_1;user003_2;password003_2
user004_1;password004_1;user004_2;password004_2
user005_1;password005_1;user005_2;password005_2
... ...
And the shell program is just: On Unix the shell program can be:
{ while IFS=';' read u1 p1 u2 p2; do { while IFS=';' read u1 p1 u2 p2; do
imapsync --user1 "$u1" --password1 "$p1" --user2 "$u2" --password2 "$p2" ... imapsync --host1 imap.side1.org --user1 "$u1" --password1 "$p1" \
--host2 imap.side2.org --user2 "$u2" --password2 "$p2" ...
done ; } < file.csv done ; } < file.csv
On Windows the batch program can be:
FOR /F "tokens=1,2,3,4 delims=; eol=#" %%G IN (file.csv) DO imapsync ^
--host1 imap.side1.org --user1 %%G --password1 %%H ^
--host2 imap.side2.org --user2 %%I --password2 %%J ...
The ... have to be replaced by nothing or any imapsync option.
Welcome in shell programming ! Welcome in shell programming !
=head1 Hacking =head1 Hacking
@ -500,7 +516,7 @@ Entries for imapsync:
Feedback (good or bad) will often be welcome. Feedback (good or bad) will often be welcome.
$Id: imapsync,v 1.452 2011/07/11 00:29:06 gilles Exp gilles $ $Id: imapsync,v 1.456 2011/08/24 04:21:30 gilles Exp gilles $
=cut =cut
@ -614,7 +630,7 @@ my(
# global variables initialisation # global variables initialisation
$rcs = '$Id: imapsync,v 1.452 2011/07/11 00:29:06 gilles Exp gilles $ '; $rcs = '$Id: imapsync,v 1.456 2011/08/24 04:21:30 gilles Exp gilles $ ';
$total_bytes_transferred = 0; $total_bytes_transferred = 0;
$total_bytes_skipped = 0; $total_bytes_skipped = 0;
@ -980,6 +996,12 @@ my @requested_folder = sort(keys(%requested_folder));
@h1_folders_wanted = @requested_folder; @h1_folders_wanted = @requested_folder;
#my $h1_namespace = $imap1->namespace() ;
#my $h2_namespace = $imap2->namespace() ;
#require Data::Dumper ;
#$debug and print "Host1 namespace:\n", Data::Dumper->Dump([$h1_namespace]) ;
#$debug and print "Host2 namespace:\n", Data::Dumper->Dump([$h2_namespace]) ;
my($h1_sep,$h2_sep); my($h1_sep,$h2_sep);
# what are the private folders separators for each server ? # what are the private folders separators for each server ?
@ -987,11 +1009,6 @@ $debug and print "Getting separators\n";
$h1_sep = get_separator($imap1, $sep1, "--sep1"); $h1_sep = get_separator($imap1, $sep1, "--sep1");
$h2_sep = get_separator($imap2, $sep2, "--sep2"); $h2_sep = get_separator($imap2, $sep2, "--sep2");
#my $h1_namespace = $imap1->namespace();
#my $h2_namespace = $imap2->namespace();
#$debug and print "Host1 namespace:\n", Data::Dumper->Dump([$h1_namespace]);
#$debug and print "Host2 namespace:\n", Data::Dumper->Dump([$h2_namespace]);
my($h1_prefix,$h2_prefix); my($h1_prefix,$h2_prefix);
$h1_prefix = get_prefix($imap1, $prefix1, "--prefix1"); $h1_prefix = get_prefix($imap1, $prefix1, "--prefix1");
$h2_prefix = get_prefix($imap2, $prefix2, "--prefix2"); $h2_prefix = get_prefix($imap2, $prefix2, "--prefix2");
@ -1372,8 +1389,8 @@ sub sync_flags {
return() if size_filtered_flag( $h1_size ) ; return() if size_filtered_flag( $h1_size ) ;
# used cached flag values for efficiency # used cached flag values for efficiency
my $h1_flags = $h1_fir_ref->{ $h1_msg }->{ "FLAGS" } ; my $h1_flags = $h1_fir_ref->{ $h1_msg }->{ "FLAGS" } || '' ;
my $h2_flags = $h2_fir_ref->{ $h2_msg }->{ "FLAGS" } ; my $h2_flags = $h2_fir_ref->{ $h2_msg }->{ "FLAGS" } || '' ;
# RFC 2060: This flag can not be altered by any client # RFC 2060: This flag can not be altered by any client
$h1_flags =~ s@\\Recent\s?@@gi ; $h1_flags =~ s@\\Recent\s?@@gi ;
@ -1805,8 +1822,8 @@ sub banner_imapsync {
my @argv_copy = @_; my @argv_copy = @_;
my $banner_imapsync = join("", my $banner_imapsync = join("",
'$RCSfile: imapsync,v $ ', '$RCSfile: imapsync,v $ ',
'$Revision: 1.452 $ ', '$Revision: 1.456 $ ',
'$Date: 2011/07/11 00:29:06 $ ', '$Date: 2011/08/24 04:21:30 $ ',
"\n",localhost_info(), "\n", "\n",localhost_info(), "\n",
"Command line used:\n", "Command line used:\n",
"$0 ", command_line_nopassword(@argv_copy), "\n", "$0 ", command_line_nopassword(@argv_copy), "\n",
@ -2061,7 +2078,7 @@ sub get_separator {
my($sep_out); my($sep_out);
if ($sep_in) { if ( defined( $sep_in ) ) {
print "Using [$sep_in] given by $sep_opt\n"; print "Using [$sep_in] given by $sep_opt\n";
$sep_out = $sep_in; $sep_out = $sep_in;
return($sep_out); return($sep_out);
@ -2072,7 +2089,8 @@ sub get_separator {
return($sep_out) if defined $sep_out; return($sep_out) if defined $sep_out;
print print
"NAMESPACE request failed for ", "NAMESPACE request failed for ",
$imap->Server(), ": ", $imap->LastError, "\n"; $imap->Server(), ": ", $imap->LastError, "\n",
help_to_guess_sep( $imap, $sep_opt ) ;
exit_clean(1); exit_clean(1);
} }
else{ else{
@ -3562,7 +3580,7 @@ sub check_last_release {
} }
sub imapsync_version { sub imapsync_version {
my $rcs = '$Id: imapsync,v 1.452 2011/07/11 00:29:06 gilles Exp gilles $ '; my $rcs = '$Id: imapsync,v 1.456 2011/08/24 04:21:30 gilles Exp gilles $ ';
$rcs =~ m/,v (\d+\.\d+)/; $rcs =~ m/,v (\d+\.\d+)/;
my $VERSION = ($1) ? $1: "UNKNOWN"; my $VERSION = ($1) ? $1: "UNKNOWN";
return($VERSION); return($VERSION);

View file

@ -5,7 +5,7 @@
<title>Imapsync: an IMAP migration tool ( release <!--#exec cmd="cat VERSION"--> )</title> <title>Imapsync: an IMAP migration tool ( release <!--#exec cmd="cat VERSION"--> )</title>
<meta name="generator" content="Bluefish 1.0.7"/> <meta name="generator" content="Bluefish 1.0.7"/>
<meta name="author" content="Gilles LAMIRAL"/> <meta name="author" content="Gilles LAMIRAL"/>
<meta name="date" content="2011-07-11T03:40:56+0200"/> <meta name="date" content="2011-08-03T03:25:16+0200"/>
<meta name="copyright" content="None"/> <meta name="copyright" content="None"/>
<meta name="keywords" content="imap, transfert, migration"/> <meta name="keywords" content="imap, transfert, migration"/>
<meta name="description" content="imap migration tool"/> <meta name="description" content="imap migration tool"/>
@ -28,8 +28,6 @@
</head> </head>
<body> <body>
<ul class="none"> <ul class="none">
<li>Buy <a href="#buy_source">imapsync <b>source code</b></a> (any OS)</li> <li>Buy <a href="#buy_source">imapsync <b>source code</b></a> (any OS)</li>
<li>Buy <a href="#buy_exe"><b>standalone win32</b></a> imapsync.exe</li> <li>Buy <a href="#buy_exe"><b>standalone win32</b></a> imapsync.exe</li>
@ -38,9 +36,11 @@
</ul> </ul>
<div class="center"> <div class="center">
<a href="http://www.linux-france.org/prj/imapsync/"><img src="logo_imapsync.png" width="486" height="309" alt="imapsync logo"/></a> <a href="http://ks.lamiral.info/imapsync/"><img src="logo_imapsync.png" width="486" height="309" alt="imapsync logo"/></a>
<h1>Welcome to the imapsync web site!</h1> <h1>Welcome to the imapsync web site!</h1>
<span style="font-size:300%;">Ten years old since release 1.1!</span><br/>
(on Friday 29 July 2011)
</div> </div>
@ -59,6 +59,16 @@ where the user plays independently on both sides. Use <b>offlineimap</b>
(written by John Goerzen) for this purpose. (written by John Goerzen) for this purpose.
</p> </p>
<h2><a id="NUMBERS"></a>Some numbers</h2>
<ul>
<li>Number of <b>imapsync users</b> per month: between <b>2 and 3 thousands </b>users</li>
<li>Number of <b>imapsync transfers</b> per month: between <b>3 and 8 millions </b>transfers</li>
<li>Pourcentage of <b>Windows</b> users : <b>10%</b></li>
<li><b>Biggest user</b> usage: <b>5 millions</b> of IMAP mailbox transfers <b>in a month</b> (one every 2 seconds)</li>
</ul>
<h2><a id="latest"></a>Latest release is imapsync <h2><a id="latest"></a>Latest release is imapsync
<!--#exec cmd="cat VERSION" --> <!--#exec cmd="cat VERSION" -->
@ -73,11 +83,11 @@ where the user plays independently on both sides. Use <b>offlineimap</b>
<ul> <ul>
<li><b>1.452</b></li> <li><b>1.452</b></li>
<li><b>New feature</b>: Added <b>--search</b> option allowing to <b>select messages</b> with the <b>powerful IMAP SEARCH</b> command. <li><b>New feature</b>: Added <b>--search</b> option allowing to <b>select messages</b> with the <b>powerful IMAP SEARCH</b> command.</li>
<li><b>Bugfix</b>: Date reference to select messages with --maxdate --mindate is the beginning of imapsync run now. <li><b>Bugfix</b>: Date reference to select messages with --maxdate --mindate is the beginning of imapsync run now.</li>
<li>Bugfix: Fixed ps call to work with Solaris 10. Thanks to Daniel Rohde. <li>Bugfix: Fixed ps call to work with Solaris 10. Thanks to Daniel Rohde.</li>
<li>Success: <b>Kerio 7.2.0P1</b> success story. <li>Success: <b>Kerio 7.2.0P1</b> success story.</li>
<li>Success: <b>MDaemon 12.0.3</b> success story. <li>Success: <b>MDaemon 12.0.3</b> success story.</li>
<li><b>1.446</b></li> <li><b>1.446</b></li>
@ -110,15 +120,6 @@ where the user plays independently on both sides. Use <b>offlineimap</b>
</ul> </ul>
--> -->
<h2><a id="NUMBERS"></a>Some numbers</h2>
<ul>
<li>Number of <b>imapsync users</b> per month: between <b>2 and 3 thousands </b>users</li>
<li>Number of <b>imapsync transfers</b> per month: between <b>3 and 8 millions </b>transfers</li>
<li>Pourcentage of <b>MSWin32</b> users : <b>10%</b></li>
<li><b>Biggest user</b> usage: <b>5 millions</b> of transfers in a month (one every 2 seconds)</li>
</ul>
<h2><a id="AUTHOR"></a>Who is the author?</h2> <h2><a id="AUTHOR"></a>Who is the author?</h2>
<p>Gilles LAMIRAL<br/> <p>Gilles LAMIRAL<br/>
@ -148,66 +149,30 @@ The Perl <b>imapsync</b> source code will run anywhere a <b>Perl interpreter can
<form action="https://www.paypal.com/cgi-bin/webscr" method="post"> <form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<p> <p>
<input type="hidden" name="cmd" value="_s-xclick"/> <input type="hidden" name="cmd" value="_s-xclick"/>
<input type="hidden" name="hosted_button_id" value="GD9PKVDZ53AKW"/>
<input type="hidden" name="on0" value="imapsync usage"/>imapsync usage <input type="hidden" name="on0" value="imapsync usage"/>imapsync usage
<select name="os0"> <select name="os0">
<option value="professional">professional </option> <option value="professional">professional </option>
<option value="individual">individual </option> <option value="individual">individual </option>
</select><br/> </select><br/>
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_buynowCC_LG.gif"
<input type="hidden" name="encrypted" value="-----BEGIN PKCS7-----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-----END PKCS7-----
"/>
<input type="image" src="https://www.paypal.com/en_US/i/btn/btn_buynowCC_LG.gif" name="submit" alt="PayPal - The safer, easier way to pay online!"/>
<img alt="" src="https://www.paypal.com/fr_FR/i/scr/pixel.gif" width="1" height="1"/>
</p>
</form>
<p>You will receive a download link <b>just after</b> the payment.<br/>
<b>One year</b> of imapsync <b>updates</b> without extra payment.<br/>
<b>30 days money-back guarantee!</b></p>
<h2><a id="buy_exe"></a>Buy standalone imapsync.exe for win32</h2>
<p>Struggle free from source code and Perl installation by<br/>
buying the latest win32 <b>standalone imapsync.exe</b> for <b>30 EUR</b></p>
<p>
30 EUR is equal to around <b>45 USD</b>, no problem to pay in USD (or any currency) with paypal:
</p>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<p>
<input type="hidden" name="cmd" value="_s-xclick"/>
<input type="hidden" name="on0" value="imapsync usage"/>imapsync usage
<select name="os0">
<option value="professional">professional </option>
<option value="individual">individual </option>
</select><br/>
<input type="hidden" name="encrypted"
value="-----BEGIN PKCS7-----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-----END PKCS7-----
"/>
<input type="image" src="https://www.paypal.com/en_US/i/btn/btn_buynowCC_LG.gif"
name="submit" alt="PayPal - The safer, easier way to pay online!"/> name="submit" alt="PayPal - The safer, easier way to pay online!"/>
<img alt="" src="https://www.paypal.com/fr_FR/i/scr/pixel.gif" width="1" height="1"/> <img alt="" src="https://www.paypalobjects.com/fr_FR/i/scr/pixel.gif" width="1" height="1"/>
</p> </p>
</form> </form>
<p>You will receive a download link <b>just after</b> the payment.<br/> <p>You will receive a download link <b>just after</b> the payment.<br/>
<b>One year</b> of imapsync <b>updates</b> without extra payment.<br/> <b>One year</b> of imapsync <b>updates</b> without extra payment.<br/>
<b>30 days money-back guarantee!</b></p> <b>30 days money-back guarantee!</b></p>
<!--
<p>
thanks to Strawberry Perl 5.12 and Par::Packer module.<br/>
The build system for imapsync.exe is XP Pro SP2 on a Intel Celeron 400 MHz 256 Mo RAM. </p>
-->
<h2><a id="buy_support"></a>Buy professional support for imapsync</h2> <h2><a id="buy_support"></a>Buy professional support for imapsync</h2>
<p>For <b>90 EUR</b> buy imapsync <b>support</b> by the developper who wrote and maintains imapsync. <p>For <b>180 EUR</b> buy imapsync <b>support</b> by the developper who wrote and maintains imapsync.
</p> </p>
<p> <p>
90 EUR is equal to around <b>130 USD</b>, no problem to pay in USD (or any currency) with paypal: 180 EUR is equal to around <b>260 USD</b>, no problem to pay in USD (or any currency) with paypal:
</p> </p>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post"> <form action="https://www.paypal.com/cgi-bin/webscr" method="post">
@ -219,16 +184,48 @@ The build system for imapsync.exe is XP Pro SP2 on a Intel Celeron 400 MHz 256 M
name="submit" name="submit"
alt="PayPal - The safer, easier way to pay online!" /> alt="PayPal - The safer, easier way to pay online!" />
<img alt="" src="https://www.paypalobjects.com/WEBSCR-640-20110401-1/fr_FR/i/scr/pixel.gif" width="1" height="1" /> <img alt="" src="https://www.paypalobjects.com/WEBSCR-640-20110401-1/fr_FR/i/scr/pixel.gif" width="1" height="1" />
<input name="return" type="hidden" value="http://www.linux-france.org/prj/imapsync/paypal_return_support.shtml?utm_nooverride=1" /> <input name="return" type="hidden" value="http://ks.lamiral.info/imapsync/paypal_return_support.shtml?utm_nooverride=1" />
</p> </p>
</form> </form>
<p>Then you will be able to expose your issues by email or phone and to converse until your issues are solved. <p>Then you will be able to expose your issues by email or phone and to converse until your issues are solved.
</p> </p>
<h2><a id="buy_exe"></a>Buy standalone imapsync.exe for win32</h2>
<p>Struggle free from source code and Perl installation by<br/>
buying the latest win32 <b>standalone imapsync.exe</b> for <b>10</b> EUR</p>
<p>
30 EUR is equal to around <b>45 USD</b>, no problem to pay in USD (or any currency) with paypal:
</p>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<p>
<input type="hidden" name="cmd" value="_s-xclick"/>
<input type="hidden" name="hosted_button_id" value="6ZFX739JYCCUU"/>
<input type="hidden" name="on0" value="imapsync usage"/>imapsync usage
<select name="os0">
<option value="professional">professional </option>
<option value="individual">individual </option>
</select> <br/>
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_buynowCC_LG.gif"
name="submit" alt="PayPal - The safer, easier way to pay online!"/>
<img alt="" src="https://www.paypalobjects.com/fr_FR/i/scr/pixel.gif" width="1" height="1"/>
</p>
</form>
<p>You will receive a download link <b>just after</b> the payment.<br/>
<b>One year</b> of imapsync <b>updates</b> without extra payment.<br/>
<b>30 days money-back guarantee!</b></p>
<!--
<p>
thanks to Strawberry Perl 5.12 and Par::Packer module.<br/>
The build system for imapsync.exe is XP Pro SP2 on a Intel Celeron 400 MHz 256 Mo RAM. </p>
-->
<h2>Documentation</h2> <h2>Documentation</h2>
<p>Read the <a href="INSTALL">INSTALL</a> file to know how to install imapsync on your system. <p>Read the <a href="INSTALL">INSTALL</a> file to know how to install imapsync on your system.
@ -323,19 +320,19 @@ will be to code it or fix it.<br/>
<p>Some features and their time/money to be done evaluation:</p> <p>Some features and their time/money to be done evaluation:</p>
<table cellpadding="10" cellspacing="0" border="1"> <table cellpadding="10" cellspacing="0" border="1">
<tr align="right"><th>DONE</th><th>Feature </th><th>Time guessed</th><th>Time spent</th><th>Money received</th><th>Money needed</th></tr> <tr align="right"><th>DONE</th><th>Feature </th><th>Time guessed</th><th>Time spent</th><th>Money received</th><th>Money still needed</th></tr>
<tr align="right"><td> No</td><td>Backup to files </td><td>20 hours </td><td> 60 min </td><td> 0 $ </td><td>800 $ </td></tr> <tr align="right"><td> <b>No</b></td><td>Backup to files </td><td>20 hours </td><td> 60 min </td><td> 0 $ </td><td>800 $ </td></tr>
<tr align="right"><td> No</td><td>Efficient Gmail backup </td><td>20 hours </td><td> 80 min </td><td> 0 $ </td><td>800 $ </td></tr> <tr align="right"><td> <b>No</b></td><td>Efficient Gmail backup </td><td>20 hours </td><td> 80 min </td><td> 0 $ </td><td>800 $ </td></tr>
<tr align="right"><td> No</td><td>Better error reporting </td><td> 5 hours </td><td> 0 min </td><td> 0 $ </td><td>200 $ </td></tr> <tr align="right"><td> <b>No</b></td><td>Better error reporting </td><td> 5 hours </td><td> 0 min </td><td> 0 $ </td><td>200 $ </td></tr>
<tr align="right"><td> Yes</td><td>Add cache </td><td>10 hours </td><td>1310 min </td><td>400 $ </td><td>400 $ </td></tr> <tr align="right"><td> Yes</td><td>Add cache </td><td>10 hours </td><td>1310 min </td><td>400 $ </td><td> 0 $ </td></tr>
<tr align="right"><td> Yes</td><td>Speedup 50% </td><td>10 hours </td><td> 80 min </td><td> 10 $ </td><td>400 $ </td></tr> <tr align="right"><td> Yes</td><td>Speedup 50% </td><td>10 hours </td><td> 80 min </td><td> 10 $ </td><td> 0 $ </td></tr>
<tr align="right"><td> Yes</td><td>--delete2folders </td><td> 3 hours </td><td> 270 min </td><td> 90 $ </td><td> 0 $ </td></tr> <tr align="right"><td> Yes</td><td>--delete2folders </td><td> 3 hours </td><td> 270 min </td><td> 90 $ </td><td> 0 $ </td></tr>
<tr align="right"><td> Yes</td><td>NTLM auth </td><td> 3 hours </td><td> 300 min </td><td> 15 $ </td><td>150 $ </td></tr> <tr align="right"><td> Yes</td><td>NTLM auth </td><td> 3 hours </td><td> 300 min </td><td> 15 $ </td><td> 0 $ </td></tr>
<tr align="right"><td> Yes</td><td>Win32 imapsync.exe </td><td> 8 hours </td><td> 520 min </td><td> 45 $ </td><td>240 $ </td></tr> <tr align="right"><td> Yes</td><td>Win32 imapsync.exe </td><td> 8 hours </td><td> 520 min </td><td> 45 $ </td><td> 0 $ </td></tr>
<tr align="right"><td> Yes</td><td>Win32 bug fixes </td><td> various </td><td> 370 min </td><td>100 $ </td><td> 85 $ </td></tr> <tr align="right"><td> Yes</td><td>Win32 bug fixes </td><td> various </td><td> 370 min </td><td>100 $ </td><td> 0 $ </td></tr>
<tr align="right"><td> Yes</td><td>Fix capability changes </td><td> 1 hour </td><td> 80 min </td><td> 0 $ </td><td> 40 $ </td></tr> <tr align="right"><td> Yes</td><td>Fix capability changes </td><td> 1 hour </td><td> 80 min </td><td> 0 $ </td><td> 0 $ </td></tr>
<tr align="right"><td> Yes</td><td>Large mailbox --maxage </td><td> 4 hours </td><td> 270 min </td><td> 0 $ </td><td>160 $ </td></tr> <tr align="right"><td> Yes</td><td>Large mailbox --maxage </td><td> 4 hours </td><td> 270 min </td><td> 0 $ </td><td> 0 $ </td></tr>
<tr align="right"><td> Yes</td><td>dkimap support </td><td> 3 hours </td><td> 120 min </td><td> 0 $ </td><td>120 $ </td></tr> <tr align="right"><td> Yes</td><td>dkimap support </td><td> 3 hours </td><td> 120 min </td><td> 0 $ </td><td> 0 $ </td></tr>
<tr align="right"><td> No</td><td>gratis from here </td><td> 4 hours </td><td> 0 min </td><td> 0 $ </td><td>60000 $ </td></tr> <tr align="right"><td> No</td><td>gratis from here </td><td> 4 hours </td><td> 0 min </td><td> 0 $ </td><td>60000 $ </td></tr>
</table> </table>
@ -350,6 +347,7 @@ Don't hesitate to have a try, I will help you and make efforts to switch them to
<li>DBMail 0.9, 2.0.7 (GPL). But most other DBMail releases are supported (see below)</li> <li>DBMail 0.9, 2.0.7 (GPL). But most other DBMail releases are supported (see below)</li>
<li>Imail 7.04 (maybe).</li> <li>Imail 7.04 (maybe).</li>
<li>MailEnable 1.54 (Proprietary) but MailEnable 4.23 is supported. </li> <li>MailEnable 1.54 (Proprietary) but MailEnable 4.23 is supported. </li>
<li>(2011) <b>MDaemon 12.0.3</b> as <b>host2</b> but MDaemon is <b>supported as host1</b>. MDaemon is simply buggy with the APPEND IMAP command with any IMAP email client.</li>
</ul> </ul>
<p>Now the long reported <b>success stories</b> list: <b>44 different imap server softwares supported!</b><br/> <p>Now the long reported <b>success stories</b> list: <b>44 different imap server softwares supported!</b><br/>
@ -451,7 +449,7 @@ alt="Viewable With Any Browser" />
<!--#config timefmt="%D" --> <!--#config timefmt="%D" -->
<!--#config timefmt="%A %B %d, %Y" --> <!--#config timefmt="%A %B %d, %Y" -->
<b>This document last modified on <!--#echo var="LAST_MODIFIED" --></b> <b>This document last modified on <!--#echo var="LAST_MODIFIED" --></b>
($Id: index.shtml,v 1.75 2011/07/11 01:42:17 gilles Exp gilles $) ($Id: index.shtml,v 1.86 2011/08/03 01:26:05 gilles Exp gilles $)
</p> </p>
</body> </body>

53
learn/append Executable file
View file

@ -0,0 +1,53 @@
#!/usr/bin/perl
use warnings;
use strict;
use English;
use Mail::IMAPClient;
my $rcs = '$Id: append,v 1.1 2011/07/14 16:49:02 gilles Exp gilles $ ';
$ARGV[3] or die "usage: $0 host user password folder uid\n";
my $host = $ARGV[0];
my $user = $ARGV[1];
my $password = $ARGV[2];
my $folder = $ARGV[3];
my $uid = $ARGV[4];
my $imap = Mail::IMAPClient->new();
$imap->Debug(1);
$imap->Server($host);
$imap->connect() or die;
$imap->User($user);
$imap->Password($password);
$imap->login() or die;
$imap->Uid(1);
$imap->Peek(1);
$imap->Clear(0);
#print map {"$_\n"} $imap->folders();
$imap->select($folder) or die;
my @msgs = $imap->messages ;
print "LIST: @msgs\n";
my $msgtext = "Subject: 9
??
" ;
my $flags = '\Seen' ;
my $date = "16-Mar-2011 11:07:11 +0000" ;
my $new_id_1b = $imap->append_string( $folder, $msgtext ) ;
print "==== OK 1b $new_id_1b\n" if $new_id_1b ;
$imap->noop ;
@msgs = $imap->messages ;
print "LIST: @msgs\n";#my $new_id_1 = $imap->append_string( $folder, $msgtext, $flags, $date ) ;
#print "==== OK 1 $new_id_1\n" if $new_id_1 ;
#my $new_id_2 = $imap->append_string( $folder, $msgtext, $flags, $date ) ;
#print "==== OK 2 $new_id_2\n" if $new_id_2 ;
$imap->close();

View file

@ -1,2 +0,0 @@
user0001;password0001;user0002;password0002
user0011;password0011;user0012;password0012
1 user0001 password0001 user0002 password0002
2 user0011 password0011 user0012 password0012

View file

@ -1,4 +1,4 @@
#!/bin/sh #!/bin/sh
perl -I../Mail-IMAPClient-3.25/lib "$@" perl -I../Mail-IMAPClient-3.28/lib "$@"

107
memo
View file

@ -1,6 +1,6 @@
#!/bin/sh #!/bin/sh
# $Id: memo,v 1.32 2011/07/11 01:06:49 gilles Exp gilles $ # $Id: memo,v 1.35 2011/08/22 00:31:14 gilles Exp gilles $
software_version() { software_version() {
@ -13,33 +13,32 @@ statistics_lfo() {
#grep prj/imapsync/VERSION /usr/local/apache/logs/access_log | sort -n | cut -d ' ' -f 1,12,13|uniq -c | sort -n # list ip #grep prj/imapsync/VERSION /usr/local/apache/logs/access_log | sort -n | cut -d ' ' -f 1,12,13|uniq -c | sort -n # list ip
cat <<EOFF cat <<EOFF
ssh glamiral@linux-france.org "grep -h prj/imapsync/VERSION /usr/local/apache/logs/access_log*|cut -d ' ' -f 1,12,13,18,19|sort -n|uniq -c|sort -n" # list ip ssh glamiral@linux-france.org "grep -h prj/imapsync/VERSION /usr/local/apache/logs/access_log.bak|cut -d ' ' -f 1,12,13,18,19|sort -n|uniq -c|sort -n" # list ip
ssh glamiral@linux-france.org "grep -h prj/imapsync/VERSION /usr/local/apache/logs/access_log*|cut -d ' ' -f 1,12,13,18,19|sort -n|uniq -c|sort -n |grep MSWin32" # Win32 ssh glamiral@linux-france.org "grep -h prj/imapsync/VERSION /usr/local/apache/logs/access_log.bak|cut -d ' ' -f 1,12,13,18,19|sort -n|uniq -c|sort -n|wc" # count ip
ssh glamiral@linux-france.org "grep -h prj/imapsync/VERSION /usr/local/apache/logs/access_log.bak|cut -d ' ' -f 1,12,13,18,19|sort -n|uniq -c|sort -n |grep MSWin32" # Win32
ssh glamiral@linux-france.org "grep -h prj/imapsync/VERSION /usr/local/apache/logs/access_log*|cut -d ' ' -f 13,18,19 |sort -n|uniq -c| sort -n" # OS usage+basename ssh glamiral@linux-france.org "grep -h prj/imapsync/VERSION /usr/local/apache/logs/access_log.bak|cut -d ' ' -f 13,18,19 |sort -n|uniq -c| sort -n" # OS usage+basename
ssh glamiral@linux-france.org "grep -h prj/imapsync/VERSION /usr/local/apache/logs/access_log*|cut -d ' ' -f 12 |sort -n|uniq -c| sort -n" # imapsync release ssh glamiral@linux-france.org "grep -h prj/imapsync/VERSION /usr/local/apache/logs/access_log.bak|cut -d ' ' -f 12 |sort -n|uniq -c| sort -n" # imapsync release
tail -f /usr/local/apache/logs/access_log|cat -n|grep prj/imapsync/VERSION|cat -n |grep VERSION # lfo frequency' tail -f /usr/local/apache/logs/access_log|cat -n|grep prj/imapsync/VERSION|cat -n |grep VERSION # lfo frequency
EOFF EOFF
} }
statistics_ks() { statistics_ks() {
cat <<EOFF cat <<EOFF
ssh root@ks "grep -h prj/imapsync/VERSION /var/log/apache2/access.log|cut -d ' ' -f 1,12,13,18,19|sort -n|uniq -c|sort -n" # list ip ssh root@ks "cd /var/log/apache2/;grep -h prj/imapsync/VERSION access.log access.log_????????|cut -d ' ' -f 1,12,13,18,19|sort -n|uniq -c|sort -n" # list ip
ssh root@ks "grep -h prj/imapsync/VERSION /var/log/apache2/access.log|cut -d ' ' -f 1,12,13,18,19|sort -n|uniq -c|sort -n|wc" # count ip ssh root@ks "cd /var/log/apache2/;grep -h prj/imapsync/VERSION access.log access.log_????????|cut -d ' ' -f 1,12,13,18,19|sort -n|uniq -c|sort -n|wc" # count ip
ssh root@ks "grep -h prj/imapsync/VERSION /var/log/apache2/access.log|cut -d ' ' -f 1,12,13,18,19|sort -n|uniq -c|sort -n |grep MSWin32" # Win32 ssh root@ks "cd /var/log/apache2/;grep -h prj/imapsync/VERSION access.log access.log_????????|cut -d ' ' -f 1,12,13,18,19|sort -n|uniq -c|sort -n |grep MSWin32" # Win32
ssh root@ks "grep -h prj/imapsync/VERSION /var/log/apache2/access.log|cut -d ' ' -f 13,18,19 |sort -n|uniq -c| sort -n" # OS usage+basename ssh root@ks "cd /var/log/apache2/;grep -h prj/imapsync/VERSION access.log access.log_????????|cut -d ' ' -f 13,18,19 |sort -n|uniq -c| sort -n" # OS usage+basename
ssh root@ks "grep -h prj/imapsync/VERSION /var/log/apache2/access.log|cut -d ' ' -f 12 |sort -n|uniq -c| sort -n" # imapsync release ssh root@ks "cd /var/log/apache2/;grep -h prj/imapsync/VERSION access.log access.log_????????|cut -d ' ' -f 12 |sort -n|uniq -c| sort -n" # imapsync release
tail -f /usr/local/apache/logs/access_log|cat -n|grep prj/imapsync/VERSION|cat -n |grep VERSION # lfo frequency' tail -f /var/log/apache2/access.log |cat -n|grep prj/imapsync/VERSION|cat -n |grep VERSION # ks frequency
EOFF EOFF
} }
statistics_VERSION_lfo() { statistics_VERSION_lfo() {
TMPDIR=. TMPDIR=.
@ -49,32 +48,56 @@ echo statistics_VERSION_getstats
statistics_VERSION_getstats() { statistics_VERSION_getstats() {
for f in /home/lf/backuplog/linux-france.org.??-??-2011.bz2; do for f in /home/lf/backuplog/linux-france.org.??-??-2011.bz2; do
b=`basename "$f" .bz2` b=`basename "$f" .bz2`
echo "$b" #echo "$b"
test -f ${b}.imapsync_VERSION && continue test -f ${b}.imapsync_VERSION && continue
echo NOT DONE ${b}.imapsync_VERSION echo NOT DONE ${b}.imapsync_VERSION
bzip2 -dc "$f" | grep -h /prj/imapsync/VERSION > ${b}.imapsync_VERSION bzip2 -dc "$f" | grep -h /prj/imapsync/VERSION > ${b}.imapsync_VERSION
done done
} }
echo statistics_VERSION_monthly_ip echo statistics_VERSION_monthly_ip 08
statistics_VERSION_monthly_ip() { statistics_VERSION_monthly_ip() {
month=$1 month=${1:-`date '+%m'`}
cut -d ' ' -f 1,12,13,18,19 linux-france.org.??-${month}-2011.imapsync_VERSION |sort -n |uniq -c|sort -n > stats_imapsync_2011_${month}.ip cut -d ' ' -f 1,12,13,18,19 linux-france.org.??-${month}-2011.imapsync_VERSION |sort -n |uniq -c|sort -n > stats_imapsync_2011_${month}.ip
} }
echo statistics_VERSION_monthly_ip_wc echo statistics_VERSION_monthly_ip_wc 08
statistics_VERSION_monthly_ip_wc() { statistics_VERSION_monthly_ip_wc() {
month=$1 month=${1:-`date '+%m'`}
test -f stats_imapsync_2011_${month}.ip || statistics_VERSION_monthly_ip $month test -f stats_imapsync_2011_${month}.ip || statistics_VERSION_monthly_ip $month
wc -l stats_imapsync_2011_${month}.ip wc -l stats_imapsync_2011_${month}.ip
} }
echo statistics_VERSION_monthly_runs echo statistics_VERSION_monthly_runs 08
statistics_VERSION_monthly_runs() { statistics_VERSION_monthly_runs() {
month=$1 month=${1:-`date '+%m'`}
test -f stats_imapsync_2011_${month}.runs || wc -l linux-france.org.??-${month}-2011.imapsync_VERSION > stats_imapsync_2011_${month}.runs test -f stats_imapsync_2011_${month}.runs || wc -l linux-france.org.??-${month}-2011.imapsync_VERSION > stats_imapsync_2011_${month}.runs
cat stats_imapsync_2011_${month}.runs cat stats_imapsync_2011_${month}.runs
} }
echo statistics_VERSION_monthly 08
statistics_VERSION_monthly() {
month=${1:-`date '+%m'`}
(
statistics_VERSION_getstats
statistics_VERSION_monthly_ip $month
statistics_VERSION_monthly_runs $month
statistics_VERSION_monthly_ip_wc $month
)
}
echo statistics_VERSION_synthesis
statistics_VERSION_synthesis() {
(
cd /home/lf/glamiral/imapsync_stats
echo Nb users each month
wc -l *.ip
echo Nb runs each month
tail -n 1 *.runs
)
}
} }
statistics_VERSION_ks() { statistics_VERSION_ks() {
@ -88,7 +111,7 @@ statistics_VERSION_getstats() {
cd /home/imapsync/imapsync_stats cd /home/imapsync/imapsync_stats
for f in /var/log/apache2/access.log_????????.gz ; do for f in /var/log/apache2/access.log_????????.gz ; do
b=`basename "$f" .gz` b=`basename "$f" .gz`
echo "$b" #echo "$b"
test -f ${b}.imapsync_VERSION && continue test -f ${b}.imapsync_VERSION && continue
echo NOT DONE ${b}.imapsync_VERSION echo NOT DONE ${b}.imapsync_VERSION
zgrep -h /prj/imapsync/VERSION "$f" > ${b}.imapsync_VERSION zgrep -h /prj/imapsync/VERSION "$f" > ${b}.imapsync_VERSION
@ -96,18 +119,26 @@ statistics_VERSION_getstats() {
) )
} }
echo statistics_VERSION_monthly_ip echo statistics_VERSION_monthly_ip 08
statistics_VERSION_monthly_ip() { statistics_VERSION_monthly_ip() {
month=$1 month=${1:-`date '+%m'`}
( (
cd /home/imapsync/imapsync_stats cd /home/imapsync/imapsync_stats
cut -d ' ' -f 1,12,13,18,19 access.log_2011${month}??.imapsync_VERSION |sort -n |uniq -c|sort -n > stats_imapsync_2011_${month}.ip cut -d ' ' -f 1,12,13,18,19 access.log_2011${month}??.imapsync_VERSION |sort -n |uniq -c|sort -n > stats_imapsync_2011_${month}.ip
) )
} }
echo statistics_VERSION_yearly_ip
statistics_VERSION_yearly_ip() {
(
cd /home/imapsync/imapsync_stats
cut -d ' ' -f 1,12,13,18,19 access.log_2011????.imapsync_VERSION |sort -n |uniq -c|sort -n > stats_imapsync_2011.ip
)
}
echo statistics_VERSION_monthly_ip_wc echo statistics_VERSION_monthly_ip_wc
statistics_VERSION_monthly_ip_wc() { statistics_VERSION_monthly_ip_wc() {
month=$1 month=${1:-`date '+%m'`}
( (
cd /home/imapsync/imapsync_stats cd /home/imapsync/imapsync_stats
test -f stats_imapsync_2011_${month}.ip || statistics_VERSION_monthly_ip $month test -f stats_imapsync_2011_${month}.ip || statistics_VERSION_monthly_ip $month
@ -117,7 +148,7 @@ statistics_VERSION_monthly_ip_wc() {
echo statistics_VERSION_monthly_runs echo statistics_VERSION_monthly_runs
statistics_VERSION_monthly_runs() { statistics_VERSION_monthly_runs() {
month=$1 month=${1:-`date '+%m'`}
( (
cd /home/imapsync/imapsync_stats cd /home/imapsync/imapsync_stats
# test -f stats_imapsync_2011_${month}.runs || # test -f stats_imapsync_2011_${month}.runs ||
@ -125,6 +156,30 @@ statistics_VERSION_monthly_runs() {
cat stats_imapsync_2011_${month}.runs cat stats_imapsync_2011_${month}.runs
) )
} }
echo statistics_VERSION_monthly 08
statistics_VERSION_monthly() {
month=${1:-`date '+%m'`}
(
statistics_VERSION_getstats
statistics_VERSION_monthly_ip $month
statistics_VERSION_monthly_runs $month
statistics_VERSION_monthly_ip_wc $month
)
}
echo statistics_VERSION_synthesis
statistics_VERSION_synthesis() {
(
cd /home/imapsync/imapsync_stats
echo Nb users each month
wc -l *.ip
echo Nb runs each month
tail -n 1 *.runs
)
}
} }

View file

@ -5,7 +5,7 @@
<title>imapsync download</title> <title>imapsync download</title>
<meta name="generator" content="Bluefish 1.0.7"/> <meta name="generator" content="Bluefish 1.0.7"/>
<meta name="author" content="Gilles LAMIRAL"/> <meta name="author" content="Gilles LAMIRAL"/>
<meta name="date" content="2011-05-31T08:34:56+0200"/> <meta name="date" content="2011-07-28T22:44:42+0200"/>
<meta name="copyright" content=""/> <meta name="copyright" content=""/>
<meta name="keywords" content=""/> <meta name="keywords" content=""/>
<meta name="description" content=""/> <meta name="description" content=""/>
@ -81,7 +81,7 @@ gilles.lamiral@laposte.net</p>
<!--#config timefmt="%D" --> <!--#config timefmt="%D" -->
<!--#config timefmt="%A %B %d, %Y" --> <!--#config timefmt="%A %B %d, %Y" -->
<b>This document last modified on <!--#echo var="LAST_MODIFIED" --></b><br/> <b>This document last modified on <!--#echo var="LAST_MODIFIED" --></b><br/>
($Id: paypal_return.shtml,v 1.9 2011/05/31 08:28:00 gilles Exp gilles $) ($Id: paypal_return.shtml,v 1.10 2011/08/24 06:49:22 gilles Exp gilles $)
</p> </p>
<!-- Google Code for Achat imapsync Conversion Page --> <!-- Google Code for Achat imapsync Conversion Page -->

View file

@ -78,7 +78,7 @@ gilles.lamiral@laposte.net</p>
<!--#config timefmt="%D" --> <!--#config timefmt="%D" -->
<!--#config timefmt="%A %B %d, %Y" --> <!--#config timefmt="%A %B %d, %Y" -->
<b>This document last modified on <!--#echo var="LAST_MODIFIED" --></b><br/> <b>This document last modified on <!--#echo var="LAST_MODIFIED" --></b><br/>
($Id: paypal_return_support.shtml,v 1.3 2011/05/20 12:32:25 gilles Exp gilles $) ($Id: paypal_return_support.shtml,v 1.5 2011/08/03 00:57:39 gilles Exp gilles $)
</p> </p>
<!-- Google Code for Achat imapsync Conversion Page --> <!-- Google Code for Achat imapsync Conversion Page -->
@ -90,8 +90,8 @@ var google_conversion_format = "2";
var google_conversion_color = "ffffff"; var google_conversion_color = "ffffff";
var google_conversion_label = "hVVWCKzApQIQvOe62QM"; var google_conversion_label = "hVVWCKzApQIQvOe62QM";
var google_conversion_value = 0; var google_conversion_value = 0;
if (30) { if (90) {
google_conversion_value = 30; google_conversion_value = 90;
} }
/* ]]> */ /* ]]> */
</script> </script>
@ -99,7 +99,7 @@ if (30) {
</script> </script>
<noscript> <noscript>
<div style="display:inline;"> <div style="display:inline;">
<img height="1" width="1" style="border-style:none;" alt="" src="http://www.googleadservices.com/pagead/conversion/992916412/?value=30&amp;label=hVVWCKzApQIQvOe62QM&amp;guid=ON&amp;script=0"/> <img height="1" width="1" style="border-style:none;" alt="" src="http://www.googleadservices.com/pagead/conversion/992916412/?value=90&amp;label=hVVWCKzApQIQvOe62QM&amp;guid=ON&amp;script=0"/>
</div> </div>
</noscript> </noscript>

View file

@ -1,13 +1,10 @@
REM $Id: test2.bat,v 1.3 2011/05/30 21:58:08 gilles Exp gilles $ REM $Id: test2.bat,v 1.5 2011/08/24 06:48:44 gilles Exp gilles $
cd C:\msys\1.0\home\Admin\imapsync cd C:\msys\1.0\home\Admin\imapsync
REM perl ./imapsync --host1 p --user1 tata --passfile1 secret.tata --host2 p --user2 titi --passfile2 secret.titi --delete2 --expunge2 --folder INBOX REM perl ./imapsync --host1 p --user1 tata --passfile1 secret.tata --host2 p --user2 titi --passfile2 secret.titi --delete2 --expunge2 --folder INBOX
REM perl ./imapsync --host1 p --user1 tata --passfile1 secret.tata --host2 p --user2 titi --passfile2 secret.titi --delete2 --expunge1 --expunge2 --folder INBOX --usecache REM perl ./imapsync --host1 p --user1 tata --passfile1 secret.tata --host2 p --user2 titi --passfile2 secret.titi --delete2 --expunge1 --expunge2 --folder INBOX --usecache
REM imapsync --host1 p --user1 tata --passfile1 secret.tata --host2 p --user2 titi --passfile2 secret.titi --justfolders --nofoldersize --folder INBOX.yop.yap --sep1 / --regextrans2 "s,/,_," REM imapsync --host1 p --user1 tata --passfile1 secret.tata --host2 p --user2 titi --passfile2 secret.titi --justfolders --nofoldersize --folder INBOX.yop.yap --sep1 / --regextrans2 "s,/,_,"
REM imapsync --host1 p --user1 tata --passfile1 secret.tata --host2 p --user2 titi --passfile2 secret.titi --nofoldersize --folder INBOX.yop.yap --regexflag 's/\\Answered//g' --debug > out.txt REM imapsync --host1 p --user1 tata --passfile1 secret.tata --host2 p --user2 titi --passfile2 secret.titi --nofoldersize --folder INBOX.yop.yap --regexflag 's/\\Answered//g' --debug > out.txt
@ -19,4 +16,9 @@ REM --host1 p --user1 big1 --passfile1 secret.big1 ^
REM --host2 p --user2 big2 --passfile2 secret.big2 ^ REM --host2 p --user2 big2 --passfile2 secret.big2 ^
REM --folder INBOX.bigmail REM --folder INBOX.bigmail
perl imapsync REM perl imapsync
REM perl imapsync --host1 p --user1 tata --passfile1 secret.tata --host2 p --user2 titi --passfile2 secret.titi --nofoldersize --folder INBOX.yop.yap --regexflag "s/\\ /\\/g" --debugflags
FOR /F "tokens=1,2,3,4 delims=; eol=#" %%G IN (file.csv) DO imapsync ^
--host1 imap.side1.org --user1 %%G --password1 %%H ^
--host2 imap.side2.org --user2 %%I --password2 %%J

141
tests.sh
View file

@ -1,6 +1,6 @@
#!/bin/sh #!/bin/sh
# $Id: tests.sh,v 1.170 2011/07/11 01:03:48 gilles Exp gilles $ # $Id: tests.sh,v 1.174 2011/08/24 06:48:23 gilles Exp gilles $
# Example 1: # Example 1:
# CMD_PERL='perl -I./Mail-IMAPClient-3.25/lib' sh -x tests.sh # CMD_PERL='perl -I./Mail-IMAPClient-3.25/lib' sh -x tests.sh
@ -450,7 +450,7 @@ ll_delete2foldersbutnot() {
--host2 $HOST2 --user2 titi \ --host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \ --passfile2 ../../var/pass/secret.titi \
--justfolders --nofoldersizes \ --justfolders --nofoldersizes \
--delete2foldersbutnot '/NEW_2/' \ --delete2foldersbutnot '/NEW_2|NEW_3/' \
--dry --dry
} }
@ -475,11 +475,29 @@ ll_bug_folder_name_with_blank() {
--passfile1 ../../var/pass/secret.tata \ --passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \ --host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \ --passfile2 ../../var/pass/secret.titi \
--justfolders --justfolders --fast
echo "rm -rf /home/vmail/titi/.bugs/" echo "rm -rf /home/vmail/titi/.bugs/"
} }
ll_bug_folder_name_with_backslash() {
# Bug with Mail-IMAPClient-2.2.9
# Fixed using Mail-IMAPClient-3.28
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--fast
# --folder "INBOX.yop.jj\\kk"
# --folder '"INBOX.yop.jj\kk"' --debug --debugimap --regextrans2 's,\\,_,g'
# --folder "INBOX.yop.jj\\kk" --debug --debugimap1
echo "sudo rm -rf '/home/vmail/titi/.yop.jj\\kk'"
}
ll_prefix12() { ll_prefix12() {
$CMD_PERL ./imapsync \ $CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \ --host1 $HOST1 --user1 tata \
@ -1645,6 +1663,38 @@ gmail() {
--regextrans2 's/\[Gmail\]/Gmail/' --regextrans2 's/\[Gmail\]/Gmail/'
} }
gmail_justfolders() {
! ping -c1 imap.gmail.com || $CMD_PERL ./imapsync \
--host1 imap.gmail.com \
--ssl1 \
--user1 gilles.lamiral@gmail.com \
--passfile1 ../../var/pass/secret.gilles_gmail \
--host2 $HOST2 \
--user2 tata \
--passfile2 ../../var/pass/secret.tata \
--useheader 'Message-Id' \
--useheader="X-Gmail-Received" \
--regextrans2 's/\[Gmail\]/Gmail/' \
--justfolders
}
gmail_via_stunnel_ks() {
! ping -c1 imap.gmail.com || $CMD_PERL ./imapsync \
--host1 ks.lamiral.info \
--port1 243 --nossl1 \
--user1 gilles.lamiral@gmail.com \
--passfile1 ../../var/pass/secret.gilles_gmail \
--host2 $HOST2 \
--user2 tata \
--passfile2 ../../var/pass/secret.tata \
--useheader 'Message-Id' \
--useheader="X-Gmail-Received" \
--debug --justfolders
}
gmail_gmail() { gmail_gmail() {
! ping -c1 imap.gmail.com || $CMD_PERL ./imapsync \ ! ping -c1 imap.gmail.com || $CMD_PERL ./imapsync \
@ -1680,6 +1730,34 @@ gmail_gmail2() {
} }
yahoo_xxxx_login() {
! ping -c1 imap.mail.yahoo.com || $CMD_PERL ./imapsync \
--host1 imap.mail.yahoo.com \
--ssl1 \
--user1 glamiral \
--passfile1 ../../var/pass/secret.gilles_yahoo \
--host2 $HOST2 \
--user2 titi \
--passfile2 ../../var/pass/secret.titi \
--justlogin
}
yahoo_xxxx() {
! ping -c1 imap.mail.yahoo.com || $CMD_PERL ./imapsync \
--host1 imap.mail.yahoo.com \
--user1 glamiral \
--passfile1 ../../var/pass/secret.gilles_yahoo \
--host2 $HOST2 \
--user2 titi \
--passfile2 ../../var/pass/secret.titi \
--sep1 '.'
# Yahoo works also with ssl
# --ssl1 \
}
allow3xx() { allow3xx() {
$CMD_PERL ./imapsync \ $CMD_PERL ./imapsync \
@ -1907,6 +1985,48 @@ ll_useuid_nousecache()
# specific tests # specific tests
########################## ##########################
b2btech_1() {
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 pod51008.outlook.com \
--user2 TestGilles@uncc.edu \
--passfile2 ../../var/pass/secret.b2btech --tls2 \
--useheader Message-Id --useheader Message-ID --fast --delete2 --expunge2 \
--folder INBOX.oneemail --folder INBOX.few_emails --folder INBOX.Junk
}
Otilio() {
$CMD_PERL ./imapsync \
--host1 imap.gmail.com --ssl1 --user1 jacarmona@eurotyre.es \
--passfile1 ../../var/pass/secret.Otilio1 \
--host2 mail.eurotyre.es --user2 josedemo@eurotyre.es \
--passfile2 ../../var/pass/secret.Otilio2 \
--folder INBOX --nofoldersizes
}
Otilio2() {
$CMD_PERL ./imapsync \
--host1 imap.gmail.com --ssl1 --user1 jacarmona@eurotyre.es \
--passfile1 ../../var/pass/secret.Otilio1 \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--useuid --folder INBOX --nofoldersizes
}
Otilio3() {
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 mail.eurotyre.es --user2 josedemo@eurotyre.es \
--passfile2 ../../var/pass/secret.Otilio2 \
--folder INBOX --nofoldersizes --regextrans2 's,INBOX,INBOX/delete_me,g'
}
Giancarlo_1() { Giancarlo_1() {
$CMD_PERL ./imapsync \ $CMD_PERL ./imapsync \
--host1 87.241.29.226 --user1 "Diego@studiobdp.local" \ --host1 87.241.29.226 --user1 "Diego@studiobdp.local" \
@ -1917,7 +2037,7 @@ Giancarlo_1() {
--nofoldersizes --useuid --nofoldersizes --useuid
} }
godaddy_1_justlogin() { godaddy_1() {
$CMD_PERL ./imapsync \ $CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \ --host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \ --passfile1 ../../var/pass/secret.tata \
@ -1926,6 +2046,18 @@ godaddy_1_justlogin() {
--folder INBOX.oneemail --folder INBOX.few_emails --folder INBOX.oneemail --folder INBOX.few_emails
} }
godaddy_2() {
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 imap.secureserver.net --user2 migrationtest@overnightmac.com \
--passfile2 ../../var/pass/secret.overnightmac --tls2 \
--folder INBOX.Junk --debug
}
mailenable_1() { mailenable_1() {
$CMD_PERL ./imapsync \ $CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \ --host1 $HOST1 --user1 tata \
@ -2264,6 +2396,7 @@ gmail_xxxxx
gmail gmail
gmail_gmail gmail_gmail
gmail_gmail2 gmail_gmail2
yahoo_xxxx
ll_ask_password ll_ask_password
ll_bug_folder_name_with_blank ll_bug_folder_name_with_blank
ll_timeout ll_timeout