This commit is contained in:
Nick Bebout 2012-12-28 18:43:39 -06:00
parent 0df034010b
commit fea424594f
26 changed files with 2959 additions and 239 deletions

View file

@ -1,17 +1,26 @@
RCS file: RCS/imapsync,v RCS file: RCS/imapsync,v
Working file: imapsync Working file: imapsync
head: 1.516 head: 1.518
branch: branch:
locks: strict locks: strict
gilles: 1.516 gilles: 1.518
access list: access list:
symbolic names: symbolic names:
keyword substitution: kv keyword substitution: kv
total revisions: 516; selected revisions: 516 total revisions: 518; selected revisions: 518
description: description:
---------------------------- ----------------------------
revision 1.516 locked by: gilles; revision 1.518 locked by: gilles;
date: 2012/12/24 00:27:34; author: gilles; state: Exp; lines: +9 -6
Bugfix. When identtifying with header, change tabulations to spaces (Gmail bug on with "Received:" on multilines).
----------------------------
revision 1.517
date: 2012/12/11 07:13:04; author: gilles; state: Exp; lines: +17 -10
Added Deerfield VisNetic MailServer 5.8.6
Bugfix. Automatic --nocheckmessageexists when --noabletosearch is set.
----------------------------
revision 1.516
date: 2012/11/02 22:15:04; author: gilles; state: Exp; lines: +43 -38 date: 2012/11/02 22:15:04; author: gilles; state: Exp; lines: +43 -38
Added current date at the beginning of the run, useful when imapsync doesn't end properly or hasn't finished yet. Added current date at the beginning of the run, useful when imapsync doesn't end properly or hasn't finished yet.
Better output for diff statistics. Better output for diff statistics.

42
FAQ
View file

@ -1,5 +1,5 @@
#!/bin/cat #!/bin/cat
# $Id: FAQ,v 1.117 2012/11/03 00:44:30 gilles Exp gilles $ # $Id: FAQ,v 1.120 2012/12/15 00:05:42 gilles Exp gilles $
+------------------+ +------------------+
| FAQ for imapsync | | FAQ for imapsync |
@ -1190,7 +1190,7 @@ Maybe add other --regextrans2 to change folder names and see the result.
When satisfied, run without --dry --justfolders When satisfied, run without --dry --justfolders
======================================================================= =======================================================================
Q. Synchronizing from XXX to Gmail Q. Synchronizing from XXX to Gmail
R. There are some details to get the special [Gmail] sub-folders R. There are some details to get the special [Gmail] sub-folders
right. Here's an example of migrating an old "Sent" folder to right. Here's an example of migrating an old "Sent" folder to
@ -1202,16 +1202,37 @@ imapsync --host1 mail.oldhost.com \
--host2 imap.gmail.com --ssl2 \ --host2 imap.gmail.com --ssl2 \
--user2 my_email@gmail.com \ --user2 my_email@gmail.com \
--password2 password \ --password2 password \
--exitwhenover 500000000 \
--folder "INBOX.Sent" \ --folder "INBOX.Sent" \
--regextrans2 "s/Sent/Sent Mail/" \ --regextrans2 "s,^Sent$,[Gmail]/Sent Mail," \
--exitwhenover 500000000 --addheader
The same goes for the "All Mail" archive pseudo-folder.
If you're using a different language in Gmail you might adapt
this example with the folder name translated, an example in French:
imapsync ...
--folder 'INBOX.Messages envoy&AOk-s' \
--regextrans2 "s,^Messages envoy&AOk-s$,[Gmail]/Messages envoy&AOk-s," \
The --addheader option is there because Sent folder messages
sometimes lack the "Message-Id" header needed by imapsync
when --useuid is not used. So option --addheader adds a "Message-Id" header.
You can remove --folder "INBOX.Sent" in the example in case
you want to sync all folders, the --regextrans2 option will
still apply only on "INBOX.Sent" folder.
The "All Mail" archive pseudo-folder should be updated automaticaly.
--exitwhenover option is here to avoid locking when transfers --exitwhenover option is here to avoid locking when transfers
exceed maximum limit. exceed maximum limit.
See http://support.google.com/a/bin/answer.py?hl=en&answer=1071518 See http://support.google.com/a/bin/answer.py?hl=en&answer=1071518
You can select folders exported to imap within the gmail preferences,
unselect all "System labels".
======================================================================= =======================================================================
Q. Synchronizing from Gmail to XXX Q. Synchronizing from Gmail to XXX
@ -1473,6 +1494,17 @@ Q. From Microsoft Exchange 2000 IMAP4rev1 server version 6.0.6487.0.
R. imapsync ... \ R. imapsync ... \
--prefix1 INBOX. --prefix1 INBOX.
======================================================================
Q. From Softalk Workgroup Mail 7.6.4
R. Old Softalk releases don't support the IMAP SEARCH command.
Here are the options to get it working.
imapsync ... --sep1 '.' --prefix1 '' \
--noabletosearch --nocheckmessageexists --addheader
(Thanks to Andrew Tucker)
====================================================================== ======================================================================
Q: How can I write an .rpm with imapsync Q: How can I write an .rpm with imapsync

View file

@ -1,5 +1,5 @@
# $Id: Makefile,v 1.110 2012/11/03 01:38:12 gilles Exp gilles $ # $Id: Makefile,v 1.113 2012/12/24 02:24:40 gilles Exp gilles $
.PHONY: help usage all .PHONY: help usage all
@ -108,11 +108,11 @@ test_quick_229: imapsync tests.sh
test_quick_3xx: imapsync tests.sh test_quick_3xx: imapsync tests.sh
CMD_PERL='perl -I./$(IMAPClient_3xx)' /usr/bin/time sh -x tests.sh locallocal CMD_PERL='perl -I./$(IMAPClient_3xx)' /usr/bin/time sh -x tests.sh locallocal
testv2: testv2: imapsync tests.sh
CMD_PERL='perl -I./$(IMAPClient_2xx)' /usr/bin/time sh tests.sh CMD_PERL='perl -I./$(IMAPClient_2xx)' /usr/bin/time sh tests.sh
touch .test_229 touch .test_229
testv3: testv3: imapsync tests.sh
CMD_PERL='perl -I./$(IMAPClient_3xx)' /usr/bin/time sh tests.sh CMD_PERL='perl -I./$(IMAPClient_3xx)' /usr/bin/time sh tests.sh
touch .test_3xx touch .test_3xx
@ -138,8 +138,8 @@ testf: clean_test test
.PHONY: lfo upload_lfo niouze_lfo niouze_fm public imapsync_cidone .PHONY: lfo upload_lfo niouze_lfo niouze_fm public imapsync_cidone
.dosify_bat: W/build_exe.bat W/test_exe.bat W/test.bat W/test2.bat examples/imapsync_example.bat.txt .dosify_bat: W/*.bat examples/*.bat
unix2dos W/build_exe.bat W/test.bat W/test_exe.bat W/test2.bat examples/imapsync_example.bat.txt examples/file.txt unix2dos W/*.bat examples/*.bat
touch .dosify_bat touch .dosify_bat
dosify_bat: .dosify_bat dosify_bat: .dosify_bat
@ -213,8 +213,14 @@ imapsync_elf_x86.bin: imapsync
lfo: cidone niouze_lfo upload_lfo lfo: cidone niouze_lfo upload_lfo
tarball: cidone all tarball: .tarball
.tarball: imapsync
echo making tarball $(DIST_FILE) echo making tarball $(DIST_FILE)
rcsdiff RCS/*
cd W && rcsdiff RCS/*
cd examples && rcsdiff RCS/*
mkdir -p dist mkdir -p dist
mkdir -p ../prepa_dist/$(DIST_NAME) mkdir -p ../prepa_dist/$(DIST_NAME)
rsync -aCv --delete --omit-dir-times --exclude dist/ --exclude imapsync.exe ./ ../prepa_dist/$(DIST_NAME)/ rsync -aCv --delete --omit-dir-times --exclude dist/ --exclude imapsync.exe ./ ../prepa_dist/$(DIST_NAME)/
@ -224,6 +230,7 @@ tarball: cidone all
cd ../prepa_dist && md5sum $(DIST_FILE) > $(DIST_FILE).md5.txt cd ../prepa_dist && md5sum $(DIST_FILE) > $(DIST_FILE).md5.txt
cd ../prepa_dist && md5sum -c $(DIST_FILE).md5.txt cd ../prepa_dist && md5sum -c $(DIST_FILE).md5.txt
ls -l ../prepa_dist/$(DIST_FILE) ls -l ../prepa_dist/$(DIST_FILE)
touch .tarball
DO_IT := $(shell test -f ./dist/path_$(VERSION).txt || makepasswd --chars 4 > ./dist/path_$(VERSION).txt) DO_IT := $(shell test -f ./dist/path_$(VERSION).txt || makepasswd --chars 4 > ./dist/path_$(VERSION).txt)
@ -282,7 +289,7 @@ PUBLIC_FILES_W = ./W/style.css \
PUBLIC_FILES_IMAGES = ./W/images/logo_imapsync.png ./W/images/logo_imapsync_s.png PUBLIC_FILES_IMAGES = ./W/images/logo_imapsync.png ./W/images/logo_imapsync_s.png
ml: ml: dist_dir
m4 -P W/ml_announce.in | mutt -H- m4 -P W/ml_announce.in | mutt -H-
mailq mailq
@ -311,10 +318,12 @@ upload_lfo:
/home/gilles/public_html/www.linux-france.org/html/prj/imapsync/.htaccess /home/gilles/public_html/www.linux-france.org/html/prj/imapsync/.htaccess
sh ~/memo/lfo-rsync sh ~/memo/lfo-rsync
upload_index: index.shtml FAQ COPYING CREDITS upload_index: FAQ COPYING CREDITS W/*.bat examples/*.bat examples/sync_loop_unix.sh index.shtml
rcsdiff index.shtml FAQ COPYING CREDITS W/*.bat examples/*.bat index.shtml
validate --verbose index.shtml validate --verbose index.shtml
rcsdiff index.shtml FAQ COPYING CREDITS
rsync -avH index.shtml FAQ COPYING CREDITS root@ks.lamiral.info:/var/www/imapsync/ rsync -avH index.shtml FAQ COPYING CREDITS root@ks.lamiral.info:/var/www/imapsync/
rsync -avH W/*.bat root@ks.lamiral.info:/var/www/imapsync/W/
rsync -avH examples/*.bat examples/sync_loop_unix.sh root@ks.lamiral.info:/var/www/imapsync/examples/
niouze_lfo : niouze_lfo :
echo "CORRECT ME: . ./memo && lfo_announce" echo "CORRECT ME: . ./memo && lfo_announce"

8
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 44 different IMAP server softwares supported with success. More than 44 different IMAP server softwares supported with success.
$Revision: 1.516 $ $Revision: 1.518 $
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
@ -301,7 +301,7 @@ IMAP SERVERS
MDaemon is simply buggy with the APPEND IMAP command with MDaemon is simply buggy with the APPEND IMAP command with
any IMAP email client. any IMAP email client.
Success stories reported with the following 44 imap servers (software Success stories reported with the following 48 imap servers (software
names are in alphabetic order): names are in alphabetic order):
- 1und1 H mimap1 84498 [host1] - 1und1 H mimap1 84498 [host1]
@ -320,6 +320,7 @@ IMAP SERVERS
2.3-alpha (OSI Approved), 2.3.1, 2.3.7, 2.3.16 2.3-alpha (OSI Approved), 2.3.1, 2.3.7, 2.3.16
(http://asg.web.cmu.edu/cyrus/) (http://asg.web.cmu.edu/cyrus/)
- David Tobit V8 (proprietary Message system). - David Tobit V8 (proprietary Message system).
- Deerfield VisNetic MailServer 5.8.6 [host1] (http://www.deerfield.net/products/visnetic-mailserver/)
- DBMail 1.2.1, 2.0.4, 2.0.9, 2.2rc1 (GPL) (http://www.dbmail.org/). - DBMail 1.2.1, 2.0.4, 2.0.9, 2.2rc1 (GPL) (http://www.dbmail.org/).
2.0.7 seems buggy. 2.0.7 seems buggy.
- Deerfield VisNetic MailServer 5.8.6 [host1] - Deerfield VisNetic MailServer 5.8.6 [host1]
@ -356,6 +357,7 @@ IMAP SERVERS
- Samsung Contact IMAP server 8.5.0 - Samsung Contact IMAP server 8.5.0
- Scalix v10.1, 10.0.1.3, 11.0.0.431, 11.4.6 - Scalix v10.1, 10.0.1.3, 11.0.0.431, 11.4.6
- SmarterMail, Smarter Mail 5.0 Enterprise, Smarter Mail 5.5 [host1]. - SmarterMail, Smarter Mail 5.0 Enterprise, Smarter Mail 5.5 [host1].
- Softalk Workgroup Mail 7.6.4 [host1].
- SunONE Messaging server 5.2, 6.0 (SUN JES - Java Enterprise System) - SunONE Messaging server 5.2, 6.0 (SUN JES - Java Enterprise System)
- Sun Java(tm) System Messaging Server 6.2-2.05, 6.2-7.05, 6.3 - Sun Java(tm) System Messaging Server 6.2-2.05, 6.2-7.05, 6.3
- Surgemail 3.6f5-5 - Surgemail 3.6f5-5
@ -440,5 +442,5 @@ SIMILAR SOFTWARES
Feedback (good or bad) will often be welcome. Feedback (good or bad) will often be welcome.
$Id: imapsync,v 1.516 2012/11/02 22:15:04 gilles Exp gilles $ $Id: imapsync,v 1.518 2012/12/24 00:27:34 gilles Exp gilles $

View file

@ -1 +1 @@
1.516 1.518

View file

@ -1 +1 @@
1.516 1.518

View file

@ -160,3 +160,7 @@
1351689817 END 1.515 : mercredi 31 octobre 2012, 14:23:37 (UTC+0100) 1351689817 END 1.515 : mercredi 31 octobre 2012, 14:23:37 (UTC+0100)
1351894814 BEGIN 1.516 : vendredi 2 novembre 2012, 23:20:14 (UTC+0100) 1351894814 BEGIN 1.516 : vendredi 2 novembre 2012, 23:20:14 (UTC+0100)
1351896296 END 1.516 : vendredi 2 novembre 2012, 23:44:56 (UTC+0100) 1351896296 END 1.516 : vendredi 2 novembre 2012, 23:44:56 (UTC+0100)
1356314808 BEGIN 1.518 : lundi 24 décembre 2012, 03:06:48 (UTC+0100)
1356315575 END 1.518 : lundi 24 décembre 2012, 03:19:35 (UTC+0100)
1356340377 BEGIN 1.518 : lundi 24 décembre 2012, 10:12:57 (UTC+0100)
1356341221 END 1.518 : lundi 24 décembre 2012, 10:27:01 (UTC+0100)

View file

@ -1,5 +1,6 @@
REM $Id: build_exe.bat,v 1.9 2011/05/31 08:28:29 gilles Exp gilles $ REM $Id: build_exe.bat,v 1.11 2012/12/24 02:25:55 gilles Exp gilles $
REM
echo Building imapsync.exe echo Building imapsync.exe
cd C:\msys\1.0\home\Admin\imapsync cd C:\msys\1.0\home\Admin\imapsync

160
W/memo
View file

@ -1,6 +1,6 @@
#!/bin/sh #!/bin/sh
# $Id: memo,v 1.41 2012/02/04 23:55:37 gilles Exp gilles $ # $Id: memo,v 1.43 2012/12/24 02:25:00 gilles Exp gilles $
software_version() { software_version() {
@ -8,20 +8,8 @@ software_version() {
} }
statistics_lfo() { statistics_lfo_frequency() {
# 62.147.165.21 - - [31/Oct/2010:23:45:28 +0100] "GET /prj/imapsync/VERSION HTTP/1.0" 200 6 "-" "imapsync/1.368 (linux system, perl 5.8.8, Mail::IMAPClient 2.2.9 imapsync)"
#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.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.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.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.bak|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 1,12,13,18,19|sort -n|uniq -c|sort -n|wc -l" # count ip
ssh glamiral@linux-france.org "grep -h prj/imapsync/VERSION /usr/local/apache/logs/access_log.bak|wc -l" # imapsync runs
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
} }
@ -46,17 +34,9 @@ date
} }
statistics_ks() { statistics_ks_frequency() {
cat <<EOFF cat <<EOFF
ssh root@ks "cd /var/log/apache2/;grep -h prj/imapsync/VERSION 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_????????|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_????????|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_????????|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_????????|cut -d ' ' -f 1,12,13,18,19|sort -n|uniq -c|sort -n|wc -l" # count ip
ssh root@ks "cd /var/log/apache2/;grep -h prj/imapsync/VERSION access.log_????????|wc -l" # imapsync runs
tail -f /var/log/apache2/access.log |cat -n|grep prj/imapsync/VERSION|cat -n |grep VERSION # ks frequency tail -f /var/log/apache2/access.log |cat -n|grep prj/imapsync/VERSION|cat -n |grep VERSION # ks frequency
EOFF EOFF
} }
@ -95,14 +75,14 @@ statistics_VERSION_getstats() {
done done
} }
echo statistics_VERSION_monthly_ip 02 2012 echo "statistics_VERSION_monthly_ip 02 2012 # long"
statistics_VERSION_monthly_ip() { statistics_VERSION_monthly_ip() {
month=${1:-`date '+%m'`} month=${1:-`date '+%m'`}
year=${2:-`date '+%Y'`} year=${2:-`date '+%Y'`}
cut -d ' ' -f 1,12,13,18,19 linux-france.org.??-${month}-${year}.imapsync_VERSION |sort -n |uniq -c|sort -n > stats_imapsync_${year}_${month}.ip cut -d ' ' -f 1,12,13,18,19 linux-france.org.??-${month}-${year}.imapsync_VERSION |sort -n |uniq -c|sort -n > stats_imapsync_${year}_${month}.ip
} }
echo statistics_VERSION_monthly_ip_wc 02 2012 echo "statistics_VERSION_monthly_ip_wc 02 2012 # short"
statistics_VERSION_monthly_ip_wc() { statistics_VERSION_monthly_ip_wc() {
month=${1:-`date '+%m'`} month=${1:-`date '+%m'`}
year=${2:-`date '+%Y'`} year=${2:-`date '+%Y'`}
@ -110,7 +90,7 @@ statistics_VERSION_monthly_ip_wc() {
wc -l stats_imapsync_${year}_${month}.ip wc -l stats_imapsync_${year}_${month}.ip
} }
echo statistics_VERSION_monthly_runs 02 2012 echo "statistics_VERSION_monthly_runs 02 2012 # short"
statistics_VERSION_monthly_runs() { statistics_VERSION_monthly_runs() {
month=${1:-`date '+%m'`} month=${1:-`date '+%m'`}
year=${2:-`date '+%Y'`} year=${2:-`date '+%Y'`}
@ -118,7 +98,30 @@ statistics_VERSION_monthly_runs() {
cat stats_imapsync_${year}_${month}.runs cat stats_imapsync_${year}_${month}.runs
} }
echo statistics_VERSION_monthly 02 2012 echo "statistics_VERSION_yearly_os 2012 # short"
statistics_VERSION_yearly_os() {
year=${1:-`date '+%Y'`}
(
cd /home/lf/glamiral/imapsync_stats
Linux=`grep -i linux stats_imapsync_${year}.ip | wc -l`
Win32=`grep -i MSWin32 stats_imapsync_${year}.ip | wc -l`
Darwin=`grep -i darwin stats_imapsync_${year}.ip | wc -l`
FreeBSD=`grep -i freebsd stats_imapsync_${year}.ip | wc -l`
Solaris=`grep -i solaris stats_imapsync_${year}.ip | wc -l`
OpenBSD=`grep -i openbsd stats_imapsync_${year}.ip | wc -l`
Other=`egrep -i -v 'linux|MSWin32|darwin|freebsd|solaris|openbsd' stats_imapsync_${year}.ip |wc -l`
Nb_All=`cat stats_imapsync_${year}.ip | wc -l`
for OS in Linux Win32 Darwin FreeBSD Solaris OpenBSD Other; do
#echo $OS `eval "echo \\$$OS"` / $Nb_All
Nb_OS=`eval "echo \\$$OS"`
PerCent=`echo "scale=2; 100*$Nb_OS/$Nb_All" | bc -l`
echo $OS $PerCent %
done
)
}
echo
echo "statistics_VERSION_monthly 02 2012 # long, good choice"
statistics_VERSION_monthly() { statistics_VERSION_monthly() {
month=${1:-`date '+%m'`} month=${1:-`date '+%m'`}
year=${2:-`date '+%Y'`} year=${2:-`date '+%Y'`}
@ -131,38 +134,18 @@ statistics_VERSION_monthly() {
} }
echo statistics_VERSION_yearly_ip 2012 echo "statistics_VERSION_yearly_ip 2012 # very long"
statistics_VERSION_yearly_ip() { statistics_VERSION_yearly_ip() {
year=${1:-`date '+%Y'`} year=${1:-`date '+%Y'`}
( (
statistics_VERSION_getstats
cd /home/lf/glamiral/imapsync_stats cd /home/lf/glamiral/imapsync_stats
cut -d ' ' -f 1,12,13,18,19 linux-france.org.??-??-${year}.imapsync_VERSION |sort -n |uniq -c|sort -n > stats_imapsync_${year}.ip cut -d ' ' -f 1,12,13,18,19 linux-france.org.??-??-${year}.imapsync_VERSION |sort -n |uniq -c|sort -n > stats_imapsync_${year}.ip
) )
} }
echo statistics_VERSION_yearly_os 2012
statistics_VERSION_yearly_os() {
year=${1:-`date '+%Y'`}
(
cd /home/lf/glamiral/imapsync_stats
Linux=`grep linux stats_imapsync_${year}.ip | wc -l`
Win32=`grep MSWin32 stats_imapsync_${year}.ip | wc -l`
Darwin=`grep darwin stats_imapsync_${year}.ip | wc -l`
FreeBSD=`grep freebsd stats_imapsync_${year}.ip | wc -l`
Solaris=`grep solaris stats_imapsync_${year}.ip | wc -l`
OpenBSD=`grep openbsd stats_imapsync_${year}.ip | wc -l`
Nb_All=`cat stats_imapsync_${year}.ip | wc -l`
for OS in Linux Win32 Darwin FreeBSD Solaris OpenBSD; do
#echo $OS `eval "echo \\$$OS"` / $Nb_All
Nb_OS=`eval "echo \\$$OS"`
PerCent=`echo "scale=2; 100*$Nb_OS/$Nb_All" | bc -l`
echo $OS $PerCent %
done
)
}
echo "statistics_VERSION_synthesis 2012 # short"
echo statistics_VERSION_synthesis 2012
statistics_VERSION_synthesis() { statistics_VERSION_synthesis() {
year=${1:-`date '+%Y'`} year=${1:-`date '+%Y'`}
( (
@ -177,6 +160,8 @@ statistics_VERSION_synthesis() {
statistics_VERSION_yearly_os $year statistics_VERSION_yearly_os $year
echo Biggest users echo Biggest users
tail -n 5 stats_imapsync_${year}.ip tail -n 5 stats_imapsync_${year}.ip
echo -n "Nb runs each year : "
cat stats_imapsync_${year}.ip | awk '{ sum+=$1 } END {print sum}'
) )
} }
@ -202,7 +187,7 @@ statistics_VERSION_getstats() {
) )
} }
echo statistics_VERSION_monthly_ip 08 echo "statistics_VERSION_monthly_ip 02 2012 # long"
statistics_VERSION_monthly_ip() { statistics_VERSION_monthly_ip() {
month=${1:-`date '+%m'`} month=${1:-`date '+%m'`}
year=${2:-`date '+%Y'`} year=${2:-`date '+%Y'`}
@ -212,20 +197,21 @@ statistics_VERSION_monthly_ip() {
) )
} }
echo statistics_VERSION_monthly_os 08 echo "statistics_VERSION_monthly_os 08 2012 # short"
statistics_VERSION_monthly_os() { statistics_VERSION_monthly_os() {
month=${1:-`date '+%m'`} month=${1:-`date '+%m'`}
year=${2:-`date '+%Y'`} year=${2:-`date '+%Y'`}
( (
cd /home/imapsync/imapsync_stats cd /home/imapsync/imapsync_stats
Linux=`grep linux stats_imapsync_${year}_${month}.ip | wc -l` Linux=`grep -i linux stats_imapsync_${year}_${month}.ip | wc -l`
Win32=`grep MSWin32 stats_imapsync_${year}_${month}.ip | wc -l` Win32=`grep -i MSWin32 stats_imapsync_${year}_${month}.ip | wc -l`
Darwin=`grep darwin stats_imapsync_${year}_${month}.ip | wc -l` Darwin=`grep -i darwin stats_imapsync_${year}_${month}.ip | wc -l`
FreeBSD=`grep freebsd stats_imapsync_${year}_${month}.ip | wc -l` FreeBSD=`grep -i freebsd stats_imapsync_${year}_${month}.ip | wc -l`
Solaris=`grep solaris stats_imapsync_${year}_${month}.ip | wc -l` Solaris=`grep -i solaris stats_imapsync_${year}_${month}.ip | wc -l`
OpenBSD=`grep openbsd stats_imapsync_${year}_${month}.ip | wc -l` OpenBSD=`grep -i openbsd stats_imapsync_${year}_${month}.ip | wc -l`
Nb_All=`cat stats_imapsync_${year}_${month}.ip | wc -l ` Other=`egrep -i -v 'linux|MSWin32|darwin|freebsd|solaris|openbsd' stats_imapsync_${year}.ip |wc -l`
for OS in Linux Win32 Darwin FreeBSD Solaris OpenBSD; do Nb_All=`cat stats_imapsync_${year}.ip | wc -l`
for OS in Linux Win32 Darwin FreeBSD Solaris OpenBSD Other; do
#echo $OS `eval "echo \\$$OS"` / $Nb_All #echo $OS `eval "echo \\$$OS"` / $Nb_All
Nb_OS=`eval "echo \\$$OS"` Nb_OS=`eval "echo \\$$OS"`
PerCent=`echo "scale=2; 100*$Nb_OS/$Nb_All" | bc -l` PerCent=`echo "scale=2; 100*$Nb_OS/$Nb_All" | bc -l`
@ -234,19 +220,20 @@ statistics_VERSION_monthly_os() {
) )
} }
echo statistics_VERSION_yearly_os echo "statistics_VERSION_yearly_os 2012 # short"
statistics_VERSION_yearly_os() { statistics_VERSION_yearly_os() {
year=${1:-`date '+%Y'`} year=${1:-`date '+%Y'`}
( (
cd /home/imapsync/imapsync_stats cd /home/imapsync/imapsync_stats
Linux=`grep linux stats_imapsync_${year}.ip | wc -l` Linux=`grep -i linux stats_imapsync_${year}.ip | wc -l`
Win32=`grep MSWin32 stats_imapsync_${year}.ip | wc -l` Win32=`grep -i MSWin32 stats_imapsync_${year}.ip | wc -l`
Darwin=`grep darwin stats_imapsync_${year}.ip | wc -l` Darwin=`grep -i darwin stats_imapsync_${year}.ip | wc -l`
FreeBSD=`grep freebsd stats_imapsync_${year}.ip | wc -l` FreeBSD=`grep -i freebsd stats_imapsync_${year}.ip | wc -l`
Solaris=`grep solaris stats_imapsync_${year}.ip | wc -l` Solaris=`grep -i solaris stats_imapsync_${year}.ip | wc -l`
OpenBSD=`grep openbsd stats_imapsync_${year}.ip | wc -l` OpenBSD=`grep -i openbsd stats_imapsync_${year}.ip | wc -l`
Other=`egrep -i -v 'linux|MSWin32|darwin|freebsd|solaris|openbsd' stats_imapsync_${year}.ip |wc -l`
Nb_All=`cat stats_imapsync_${year}.ip | wc -l` Nb_All=`cat stats_imapsync_${year}.ip | wc -l`
for OS in Linux Win32 Darwin FreeBSD Solaris OpenBSD; do for OS in Linux Win32 Darwin FreeBSD Solaris OpenBSD Other; do
#echo $OS `eval "echo \\$$OS"` / $Nb_All #echo $OS `eval "echo \\$$OS"` / $Nb_All
Nb_OS=`eval "echo \\$$OS"` Nb_OS=`eval "echo \\$$OS"`
PerCent=`echo "scale=2; 100*$Nb_OS/$Nb_All" | bc -l` PerCent=`echo "scale=2; 100*$Nb_OS/$Nb_All" | bc -l`
@ -256,18 +243,7 @@ statistics_VERSION_yearly_os() {
} }
echo "statistics_VERSION_monthly_ip_wc 02 2012 # short"
echo statistics_VERSION_yearly_ip
statistics_VERSION_yearly_ip() {
year=${1:-`date '+%Y'`}
(
cd /home/imapsync/imapsync_stats
cut -d ' ' -f 1,12,13,18,19 access.log_${year}????.imapsync_VERSION |sort -n |uniq -c|sort -n > stats_imapsync_${year}.ip
)
}
echo statistics_VERSION_monthly_ip_wc 01 2012
statistics_VERSION_monthly_ip_wc() { statistics_VERSION_monthly_ip_wc() {
month=${1:-`date '+%m'`} month=${1:-`date '+%m'`}
year=${2:-`date '+%Y'`} year=${2:-`date '+%Y'`}
@ -278,7 +254,7 @@ statistics_VERSION_monthly_ip_wc() {
) )
} }
echo statistics_VERSION_monthly_runs 01 2012 echo "statistics_VERSION_monthly_runs 02 2012 # short"
statistics_VERSION_monthly_runs() { statistics_VERSION_monthly_runs() {
month=${1:-`date '+%m'`} month=${1:-`date '+%m'`}
year=${2:-`date '+%Y'`} year=${2:-`date '+%Y'`}
@ -289,7 +265,8 @@ statistics_VERSION_monthly_runs() {
) )
} }
echo statistics_VERSION_monthly 01 2012 echo
echo "statistics_VERSION_monthly 02 2012 # long, good choice"
statistics_VERSION_monthly() { statistics_VERSION_monthly() {
month=${1:-`date '+%m'`} month=${1:-`date '+%m'`}
year=${2:-`date '+%Y'`} year=${2:-`date '+%Y'`}
@ -301,7 +278,18 @@ statistics_VERSION_monthly() {
) )
} }
echo statistics_VERSION_synthesis 2012
echo "statistics_VERSION_yearly_ip 2012 # very long"
statistics_VERSION_yearly_ip() {
year=${1:-`date '+%Y'`}
(
statistics_VERSION_getstats
cd /home/imapsync/imapsync_stats
cut -d ' ' -f 1,12,13,18,19 access.log_${year}????.imapsync_VERSION |sort -n |uniq -c|sort -n > stats_imapsync_${year}.ip
)
}
echo "statistics_VERSION_synthesis 2012 # short"
statistics_VERSION_synthesis() { statistics_VERSION_synthesis() {
year=${1:-`date '+%Y'`} year=${1:-`date '+%Y'`}
( (
@ -316,8 +304,14 @@ statistics_VERSION_synthesis() {
statistics_VERSION_yearly_os $year statistics_VERSION_yearly_os $year
echo Biggest users echo Biggest users
tail -n 5 stats_imapsync_${year}.ip tail -n 5 stats_imapsync_${year}.ip
echo -n "Nb runs each year : "
cat stats_imapsync_${year}.ip | awk '{ sum+=$1 } END {print sum}'
) )
} }
} }

View file

@ -28,18 +28,40 @@ Europe a un autre assujetti : Article 262 ter => Exoneration
EOF EOF
} }
echo paypal_bilan_Avant_commission
paypal_bilan_Avant_commission() { echo paypal_bilan_invoice_00000
# DID output diff between paypal_bilan_1.60 and 1.61 paypal_bilan_invoice_00000() {
# DID output diff between paypal_bilan_1.62 and 1.63
( (
#set -x #set -x
/g/public_html/imapsync/W/paypal_reply/paypal_bilan_1.60 --bnc --debug --debug_invoice --first_in 147 \ /g/public_html/imapsync/W/paypal_reply/paypal_bilan_1.62 --bnc --debug --debug_invoice --first_in 147 \
--avoid_numbers '292 293 643 644 731 732 1093 1330 1331 1332 1333 1334 1652 1653' \ --avoid_numbers '292 293 643 644 731 732 1093 1330 1331 1332 1333 1334 1652 1653 2131 2132' \
/g/paypal/paypal_201?_??_complet.csv \
> /g/var/paypal_bilan/tests/paypal_invoice.out1 2>&1
/g/public_html/imapsync/W/paypal_reply/paypal_bilan --dry --write_invoices --exportbnc paypal_bnc.txt --bnc --debug --debug_invoice --first_in 147 \
--avoid_numbers '292 293 643 644 731 732 1093 1330 1331 1332 1333 1334 1652 1653 2131 2132' \
/g/paypal/paypal_201?_??_complet.csv \
> /g/var/paypal_bilan/tests/paypal_invoice.out2 2>&1
echo diff /g/var/paypal_bilan/tests/paypal_invoice.out1 /g/var/paypal_bilan/tests/paypal_invoice.out2
diff /g/var/paypal_bilan/tests/paypal_invoice.out1 /g/var/paypal_bilan/tests/paypal_invoice.out2
)
}
#echo paypal_bilan_Avant_commission
paypal_bilan_Avant_commission() {
# DID output diff between paypal_bilan_1.61 and 1.62
(
#set -x
/g/public_html/imapsync/W/paypal_reply/paypal_bilan_1.61 --bnc --debug --debug_invoice --first_in 147 \
--avoid_numbers '292 293 643 644 731 732 1093 1330 1331 1332 1333 1334 1652 1653 2131 2132' \
/g/paypal/paypal_201?_??_complet.csv \ /g/paypal/paypal_201?_??_complet.csv \
> /g/var/paypal_bilan/tests/paypal_invoice.out1 2>&1 > /g/var/paypal_bilan/tests/paypal_invoice.out1 2>&1
/g/public_html/imapsync/W/paypal_reply/paypal_bilan --exportbnc paypal_bnc.txt --bnc --debug --debug_invoice --first_in 147 \ /g/public_html/imapsync/W/paypal_reply/paypal_bilan --exportbnc paypal_bnc.txt --bnc --debug --debug_invoice --first_in 147 \
--avoid_numbers '292 293 643 644 731 732 1093 1330 1331 1332 1333 1334 1652 1653' \ --avoid_numbers '292 293 643 644 731 732 1093 1330 1331 1332 1333 1334 1652 1653 2131 2132' \
/g/paypal/paypal_201?_??_complet.csv \ /g/paypal/paypal_201?_??_complet.csv \
> /g/var/paypal_bilan/tests/paypal_invoice.out2 2>&1 > /g/var/paypal_bilan/tests/paypal_invoice.out2 2>&1

View file

@ -1,6 +1,6 @@
#!/usr/bin/perl #!/usr/bin/perl
# $Id: paypal_bilan,v 1.61 2012/11/02 01:31:58 gilles Exp gilles $ # $Id: paypal_bilan,v 1.62 2012/12/06 18:45:02 gilles Exp gilles $
use strict; use strict;
use warnings; use warnings;
@ -13,7 +13,7 @@ use Test::More 'no_plan' ;
die unless (utf8_supported_charset('ISO-8859-1')); die unless (utf8_supported_charset('ISO-8859-1'));
my $rcs = '$Id: paypal_bilan,v 1.61 2012/11/02 01:31:58 gilles Exp gilles $ ' ; my $rcs = '$Id: paypal_bilan,v 1.62 2012/12/06 18:45:02 gilles Exp gilles $ ' ;
$rcs =~ m/,v (\d+\.\d+)/ ; $rcs =~ m/,v (\d+\.\d+)/ ;
my $VERSION = ($1) ? $1: "UNKNOWN" ; my $VERSION = ($1) ? $1: "UNKNOWN" ;
@ -35,6 +35,7 @@ my $nb_invoice_suspended = 0 ;
my $nb_invoice_canceled = 0 ; my $nb_invoice_canceled = 0 ;
my ( $tests, $testeur ) ; my ( $tests, $testeur ) ;
my $dry ;
my $debug ; my $debug ;
my $debug_csv ; my $debug_csv ;
my $debug_dev ; my $debug_dev ;
@ -58,6 +59,7 @@ my $dir_invoices = '/g/var/paypal_invoices' ;
my $option_ret = GetOptions ( my $option_ret = GetOptions (
'tests' => \$tests, 'tests' => \$tests,
'dry' => \$dry,
'debug' => \$debug, 'debug' => \$debug,
'debug_csv' => \$debug_csv, 'debug_csv' => \$debug_csv,
'debug_dev' => \$debug_dev, 'debug_dev' => \$debug_dev,
@ -342,6 +344,19 @@ sub keyval {
} }
sub invoice_00000 {
my $invoice = shift ;
return( sprintf( "%04d", $invoice ) ) ;
}
sub tests_invoice_00000 {
ok( '0000' eq invoice_00000( 0 ), 'invoice_00000: 0 -> 0000' ) ;
ok( '0147' eq invoice_00000( 147 ), 'invoice_00000: 147 -> 0147' ) ;
ok( '99999' eq invoice_00000( 99999 ), 'invoice_00000: 99999 -> 99999' ) ;
}
sub tests_next_invoice { sub tests_next_invoice {
ok( 1 == next_invoice( ), 'next_invoice: 1' ) ; ok( 1 == next_invoice( ), 'next_invoice: 1' ) ;
ok( 2 == next_invoice( ), 'next_invoice: 2' ) ; ok( 2 == next_invoice( ), 'next_invoice: 2' ) ;
@ -359,6 +374,7 @@ sub tests {
tests_next_invoice( ) ; tests_next_invoice( ) ;
#tests_half( ) ; #tests_half( ) ;
tests_cut( ) ; tests_cut( ) ;
tests_invoice_00000( ) ;
} }
sub compute_line { sub compute_line {
@ -659,8 +675,8 @@ sub build_invoice {
my $tex_variables_utf8 = to_utf8( { -string => $tex_variables, -charset => 'ISO-8859-1' } ) ; my $tex_variables_utf8 = to_utf8( { -string => $tex_variables, -charset => 'ISO-8859-1' } ) ;
print $tex_variables_utf8 if $debug_invoice_utf8 ; $debug_invoice_utf8 and print $tex_variables_utf8 ;
print $tex_variables if $debug_invoice ; $debug_invoice and print $tex_variables ;
#print "$invoice ", invoice_sent( $dir_invoices, $invoice, $De_l_adresse_email ), "\n" ; #print "$invoice ", invoice_sent( $dir_invoices, $invoice, $De_l_adresse_email ), "\n" ;
if ( $write_invoices and ! invoice_sent( $dir_invoices, $invoice, $De_l_adresse_email ) ) { if ( $write_invoices and ! invoice_sent( $dir_invoices, $invoice, $De_l_adresse_email ) ) {
@ -849,7 +865,11 @@ sub write_csv_info {
my( $dir_invoices, $invoice, $file_csv, $line_number, $line_csv ) = @_ ; my( $dir_invoices, $invoice, $file_csv, $line_number, $line_csv ) = @_ ;
open( CSVINFO, "> $dir_invoices/$invoice/csv_info.txt") or die ; my $invoice_00000 = invoice_00000( $invoice ) ;
$debug and print "Writing $dir_invoices/$invoice_00000/csv_info.txt\n" ;
$dry and return( ) ;
open( CSVINFO, "> $dir_invoices/$invoice_00000/csv_info.txt") or die ;
print CSVINFO join( "\n", $file_csv, $line_number, $line_csv ) ; print CSVINFO join( "\n", $file_csv, $line_number, $line_csv ) ;
close( CSVINFO ) ; close( CSVINFO ) ;
@ -858,8 +878,8 @@ sub write_csv_info {
sub invoice_sent { sub invoice_sent {
my ( $dir_invoices, $invoice, $email_address ) = @_ ; my ( $dir_invoices, $invoice, $email_address ) = @_ ;
my $invoice_00000 = invoice_00000( $invoice ) ;
return( 1 ) if ( -f "$dir_invoices/$invoice/SENT_TO_$email_address" ) ; return( 1 ) if ( -f "$dir_invoices/$invoice_00000/SENT_TO_$email_address" ) ;
return( 0 ) ; return( 0 ) ;
} }
@ -869,17 +889,24 @@ sub write_email_message {
my $message_body_utf8 = to_utf8({ -string => $message_body, -charset => 'ISO-8859-1' }); my $message_body_utf8 = to_utf8({ -string => $message_body, -charset => 'ISO-8859-1' });
mkdir( "$dir_invoices/$invoice" ) or die if ! -d "$dir_invoices/$invoice" ; my $invoice_00000 = invoice_00000( $invoice ) ;
open( HEADER, "> $dir_invoices/$invoice/facture_message_header.txt") or die ; if ( ! -d "$dir_invoices/$invoice_00000" ) {
$debug and print "mkdir $dir_invoices/$invoice_00000\n" ;
$dry or mkdir( "$dir_invoices/$invoice_00000" ) or die ;
}
$dry and return( ) ;
open( HEADER, "> $dir_invoices/$invoice_00000/facture_message_header.txt") or die ;
print HEADER $message_header ; print HEADER $message_header ;
close( HEADER ) ; close( HEADER ) ;
open( BODY, "> $dir_invoices/$invoice/facture_message_body.txt") or die ; open( BODY, "> $dir_invoices/$invoice_00000/facture_message_body.txt") or die ;
print BODY $message_body_utf8 ; print BODY $message_body_utf8 ;
close( BODY ) ; close( BODY ) ;
open( ADDRESS, "> $dir_invoices/$invoice/email_address.txt") or die ; open( ADDRESS, "> $dir_invoices/$invoice_00000/email_address.txt") or die ;
print ADDRESS "$email_address\n" ; print ADDRESS "$email_address\n" ;
close( ADDRESS ) ; close( ADDRESS ) ;
} }
@ -888,14 +915,23 @@ sub write_email_message {
sub write_tex_variables_file { sub write_tex_variables_file {
my ( $dir_invoices, $invoice, $date_jjSmmSaaaa, $tex_variables_utf8 ) = @_ ; my ( $dir_invoices, $invoice, $date_jjSmmSaaaa, $tex_variables_utf8 ) = @_ ;
mkdir( "$dir_invoices/$invoice" ) or die if ! -d "$dir_invoices/$invoice" ; my $invoice_00000 = invoice_00000( $invoice ) ;
open( FILE, "> $dir_invoices/$invoice/imapsync_var.tex") or die ;
if ( ! -d "$dir_invoices/$invoice_00000" ) {
$debug and print "mkdir $dir_invoices/$invoice_00000\n" ;
$dry or mkdir( "$dir_invoices/$invoice_00000" ) or die ;
}
$debug and print "Writing imapsync_var.tex $dir_invoices/$invoice_00000/imapsync_var.tex\n" ;
$dry and return( ) ;
open( FILE, "> $dir_invoices/$invoice_00000/imapsync_var.tex") or die ;
print FILE $tex_variables_utf8 ; print FILE $tex_variables_utf8 ;
close( FILE ) ; close( FILE ) ;
if ( ! -f "$dir_invoices/$invoice/imapsync_var_manual.tex" ) { if ( ! -f "$dir_invoices/$invoice_00000/imapsync_var_manual.tex" ) {
open( FILE, "> $dir_invoices/$invoice/imapsync_var_manual.tex") or die ; open( FILE, "> $dir_invoices/$invoice_00000/imapsync_var_manual.tex") or die ;
print FILE "%% $0 created file print FILE "%% $0 created this file
%% Can be used to override imapsync_var.tex definitions\n" ; %% Can be used to override imapsync_var.tex definitions\n" ;
print FILE $tex_variables_utf8 ; print FILE $tex_variables_utf8 ;
close( FILE ) ; close( FILE ) ;

1171
W/paypal_reply/paypal_bilan_1.61 Executable file

File diff suppressed because it is too large Load diff

1185
W/paypal_reply/paypal_bilan_1.62 Executable file

File diff suppressed because it is too large Load diff

View file

@ -1,6 +1,6 @@
#!/bin/sh #!/bin/sh
# $Id: paypal_build_invoices,v 1.40 2012/10/03 14:29:07 gilles Exp gilles $ # $Id: paypal_build_invoices,v 1.43 2012/12/15 00:15:56 gilles Exp gilles $
# usage: sh paypal_build_invoices /g/var/paypal_invoices/???? # usage: sh paypal_build_invoices /g/var/paypal_invoices/????
@ -30,7 +30,9 @@ cp /home/gilles/public_html/AGIL/factures/000/facture_imapsync-000.tex /g/var/pa
#/g/public_html/imapsync/W/paypal_reply/paypal_bilan --write_invoices --first_in 1824 /g/paypal/paypal_2012_07_complet.csv #/g/public_html/imapsync/W/paypal_reply/paypal_bilan --write_invoices --first_in 1824 /g/paypal/paypal_2012_07_complet.csv
#/g/public_html/imapsync/W/paypal_reply/paypal_bilan --write_invoices --first_in 1891 /g/paypal/paypal_2012_08_complet.csv #/g/public_html/imapsync/W/paypal_reply/paypal_bilan --write_invoices --first_in 1891 /g/paypal/paypal_2012_08_complet.csv
#/g/public_html/imapsync/W/paypal_reply/paypal_bilan --write_invoices --first_in 1963 /g/paypal/paypal_2012_09_complet.csv #/g/public_html/imapsync/W/paypal_reply/paypal_bilan --write_invoices --first_in 1963 /g/paypal/paypal_2012_09_complet.csv
/g/public_html/imapsync/W/paypal_reply/paypal_bilan --write_invoices --first_in 2047 /g/paypal/paypal_2012_10_complet.csv #/g/public_html/imapsync/W/paypal_reply/paypal_bilan --write_invoices --first_in 2047 /g/paypal/paypal_2012_10_complet.csv
#/g/public_html/imapsync/W/paypal_reply/paypal_bilan --write_invoices --first_in 2133 /g/paypal/paypal_2012_11_complet.csv
/g/public_html/imapsync/W/paypal_reply/paypal_bilan --write_invoices --first_in 2224 /g/paypal/paypal_2012_12_complet.csv
: /g/public_html/imapsync/W/paypal_reply/paypal_bilan --first_in 147 /g/paypal/paypal_2010_11_complet.csv : /g/public_html/imapsync/W/paypal_reply/paypal_bilan --first_in 147 /g/paypal/paypal_2010_11_complet.csv
@ -56,22 +58,23 @@ cp /home/gilles/public_html/AGIL/factures/000/facture_imapsync-000.tex /g/var/pa
: /g/public_html/imapsync/W/paypal_reply/paypal_bilan --first_in 1824 /g/paypal/paypal_2012_07_complet.csv : /g/public_html/imapsync/W/paypal_reply/paypal_bilan --first_in 1824 /g/paypal/paypal_2012_07_complet.csv
: /g/public_html/imapsync/W/paypal_reply/paypal_bilan --first_in 1891 /g/paypal/paypal_2012_08_complet.csv : /g/public_html/imapsync/W/paypal_reply/paypal_bilan --first_in 1891 /g/paypal/paypal_2012_08_complet.csv
: /g/public_html/imapsync/W/paypal_reply/paypal_bilan --first_in 1963 /g/paypal/paypal_2012_09_complet.csv : /g/public_html/imapsync/W/paypal_reply/paypal_bilan --first_in 1963 /g/paypal/paypal_2012_09_complet.csv
set -x
: /g/public_html/imapsync/W/paypal_reply/paypal_bilan --first_in 2047 /g/paypal/paypal_2012_10_complet.csv : /g/public_html/imapsync/W/paypal_reply/paypal_bilan --first_in 2047 /g/paypal/paypal_2012_10_complet.csv
set -x
: /g/public_html/imapsync/W/paypal_reply/paypal_bilan --first_in 2133 /g/paypal/paypal_2012_11_complet.csv
: /g/public_html/imapsync/W/paypal_reply/paypal_bilan --first_in 2224 /g/paypal/paypal_2012_12_complet.csv
set +x set +x
# La totale # La totale
: || /g/public_html/imapsync/W/paypal_reply/paypal_bilan --bnc --debug \ : || /g/public_html/imapsync/W/paypal_reply/paypal_bilan --bnc --debug \
--first_in 147 --avoid_numbers '292 293 643 644 731 732 1093 1330 1331 1332 1333 1334 1652 1653' \ --first_in 147 --avoid_numbers '292 293 643 644 731 732 1093 1330 1331 1332 1333 1334 1652 1653 2131 2132' \
/g/paypal/paypal_201?_??_complet.csv /g/paypal/paypal_201?_??_complet.csv
: || /g/public_html/imapsync/W/paypal_reply/paypal_bilan \ : || /g/public_html/imapsync/W/paypal_reply/paypal_bilan \
--first_in 147 --avoid_numbers '292 293 643 644 731 732 1093 1330 1331 1332 1333 1334 1652 1653' \ --first_in 147 --avoid_numbers '292 293 643 644 731 732 1093 1330 1331 1332 1333 1334 1652 1653 2131 2132' \
/g/paypal/paypal_201?_??_complet.csv /g/paypal/paypal_201?_??_complet.csv
echo 'sh paypal_build_invoices /g/var/paypal_invoices/1???' echo 'sh paypal_build_invoices /g/var/paypal_invoices/2???'
# USD de 147 à 340 # USD de 147 à 340
# EUR de 341 à ... # EUR de 341 à ...

View file

@ -47,8 +47,13 @@ send_invoice() {
} }
} }
echo $0 '/g/var/paypal_invoices/99?' echo $0 '/g/var/paypal_invoices/2???'
for d in "$@"; do for d in "$@"; do
( send_invoice "$d" ) ( send_invoice "$d" )
done done
echo ==== Saving to ks
rsync -avHz -P /g/var/paypal_invoices/ \
imapsync@ks.lamiral.info:var/paypal_invoices

View file

@ -1,10 +1,10 @@
REM $Id: test.bat,v 1.9 2011/02/21 02:14:35 gilles Exp gilles $ REM $Id: test.bat,v 1.10 2012/12/22 20:00:12 gilles Exp gilles $
cd C:\msys\1.0\home\Admin\imapsync cd C:\msys\1.0\home\Admin\imapsync
perl -mMail::IMAPClient -mDigest::MD5 -mTerm::ReadKey -mIO::Socket::SSL -mDate::Manip -mFile::Spec -mDigest::HMAC_MD5 -e '' perl -mMail::IMAPClient -mDigest::MD5 -mTerm::ReadKey -mIO::Socket::SSL -mDate::Manip -mFile::Spec -mDigest::HMAC_MD5 -e ''
perl ./imapsync perl ./imapsync
perl ./imapsync --host1 p --user1 tata --passfile1 secret.tata --host2 p --user2 titi --passfile2 secret.titi --delete2 --expunge2 perl ./imapsync --host1 p --user1 tata --passfile1 secret.tata --host2 p --user2 titi --passfile2 secret.titi --delete2 --expunge2
perl ./imapsync --host1 p --user1 tata --passfile1 secret.tata --host2 p --user2 titi --passfile2 secret.titi --delete2 --expunge2 --folder INBOX --nofoldersizes perl ./imapsync --host1 p --user1 tata --passfile1 secret.tata --host2 p --user2 titi --passfile2 secret.titi --delete2 --expunge2 --folder INBOX --nofoldersizes
perl ./imapsync --host1 p --user1 tata --passfile1 secret.tata --host2 p --user2 titi --passfile2 secret.titi --delete2 --expunge2 --folder INBOX --nofoldersizes --usecache perl ./imapsync --host1 p --user1 tata --passfile1 secret.tata --host2 p --user2 titi --passfile2 secret.titi --delete2 --expunge2 --folder INBOX --nofoldersizes --usecache

View file

@ -1,5 +1,6 @@
REM $Id: test2.bat,v 1.11 2012/10/05 09:15:55 gilles Exp gilles $ REM $Id: test2.bat,v 1.14 2012/12/24 02:25:34 gilles Exp gilles $
REM
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
@ -38,6 +39,25 @@ REM perl ./imapsync --host1 p --user1 tata --passfile1 secret.tata ^
REM --host2 imap.gmail.com --ssl2 --user2 gilles.lamiral@gmail.com --passfile2 secret.gilles_gmail ^ REM --host2 imap.gmail.com --ssl2 --user2 gilles.lamiral@gmail.com --passfile2 secret.gilles_gmail ^
REM --usecache --nofoldersizes --folder INBOX --regextrans2 "s(INBOX)([Gmail]/te*st)" REM --usecache --nofoldersizes --folder INBOX --regextrans2 "s(INBOX)([Gmail]/te*st)"
perl ./imapsync --host1 imap.gmail.com --port1 993 --ssl1 --host2 imap.bigs.dk --justconnect REM perl ./imapsync --host1 imap.gmail.com --port1 993 --ssl1 --host2 imap.bigs.dk --justconnect
imapsync.exe --host1 imap.gmail.com --port1 993 --ssl1 --host2 imap.bigs.dk --justconnect REM imapsync.exe --host1 imap.gmail.com --port1 993 --ssl1 --host2 imap.bigs.dk --justconnect
REM @echo off
DATE /t
TIME /t
FOR /f "tokens=1-4 delims=-/: " %%a IN ('DATE /t') DO (SET mydate=%%c_%%a_%%b_%%d)
FOR /f "tokens=1-2 delims=-/: " %%a IN ('TIME /t') DO (SET mytime=%%a_%%b)
ECHO %mydate%_%mytime%
if not exist LOG mkdir LOG
FOR /F "tokens=1,2,3,4 delims=; eol=#" %%G IN (file.txt) DO ECHO syncing to user %%I & imapsync ^
--host1 imap.side1.org --user1 %%G --password1 %%H ^
--host2 imap.side2.org --user2 %%I --password2 %%J ^
> LOG\log_%%I_%mydate%_%mytime%.txt 2>&1
ECHO Loop finished
ECHO log files are in LOG directory
PAUSE

View file

@ -1,6 +1,6 @@
REM REM
cd C:\msys\1.0\home\Admin\imapsync cd C:\msys\1.0\home\Admin\imapsync
REM imapsync.exe \ --host1 p --user1 toto --passfile1 secret.toto \ --host2 p --user2 titi --passfile2 secret.titi REM imapsync.exe \ --host1 p --user1 toto --passfile1 secret.toto \ --host2 p --user2 titi --passfile2 secret.titi
.\imapsync.exe \ --host1 p --user1 tata --passfile1 secret.tata \ --host2 p --user2 titi --passfile2 secret.titi .\imapsync.exe \ --host1 p --user1 tata --passfile1 secret.tata \ --host2 p --user2 titi --passfile2 secret.titi

4
examples/.htaccess Normal file
View file

@ -0,0 +1,4 @@
AddType text/plain .bat .sh

View file

@ -1,22 +1,9 @@
# Example file.txt for imapsync massive migration. # Example file.txt for imapsync massive migration.
# #
# ==== Windows ====
# Thanks to http://ss64.com/nt/for_f.html for
# the Windows example of a for loop
#
# 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.txt) DO imapsync --host1 imap.truc.org --user1 %%G --password1 %%H --host2 imap.trac.org --user2 %%I --password2 %%J
#
# A line beginning with # is a comment thanks to option Win32 eol=#
# Separator is character ; it can be changed by any character changing delims=;
# Each line contains 4 columns, columns are parameters for --user1 --password1 --user2 --password2 # Each line contains 4 columns, columns are parameters for --user1 --password1 --user2 --password2
# Windows: see the script examples/sync_loop_windows.bat
# Unix: see the script examples/sync_loop_unix.sh
# #
# ==== Unix ====
# 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.txt
#
# Separator is character ; it can be changed by any character changing IFS=';'
# Each line contains 4 columns, columns are parameters for --user1 --password1 --user2 --password2
# #
# Now the data example # Now the data example
user001_1;password001_1;user001_2;password001_2 user001_1;password001_1;user001_2;password001_2

View file

@ -0,0 +1,30 @@
#!/bin/sh
#
# $Id: sync_loop_unix.sh,v 1.2 2012/12/23 08:02:46 gilles Exp gilles $
# Example for imapsync massive migration on Unix systems.
#
# Data is supposed to be in file.txt in the following format
#user001_1;password001_1;user001_2;password001_2
#...
# Separator is character semi-colon ; it can be changed by any character changing IFS=';'
# Each data line contains 4 columns, columns are parameters for --user1 --password1 --user2 --password2
#
# Replace "imap.side1.org" and "imap.side2.org" with your own hostname values
# This loop will also create a log file called LOG/log_${u2}_$NOW.txt for each account transfer
# where u2 is just a variable containing the user2 account name, and NOW is the current date_time
mkdir -p LOG
{ while IFS=';' read u1 p1 u2 p2
do
{ echo "$u1" | egrep "^#" ; } > /dev/null && continue
NOW=`date +%Y_%m_%d_%H_%M_%S`
echo syncing to user "$u2"
imapsync --host1 imap.side1.org --user1 "$u1" --password1 "$p1" \
--host2 imap.side2.org --user2 "$u2" --password2 "$p2" \
> LOG/log_${u2}_$NOW.txt 2>&1
done
} < file.txt

View file

@ -0,0 +1,36 @@
REM
REM $Id: sync_loop_windows.bat,v 1.4 2012/12/23 08:02:34 gilles Exp gilles $
REM
REM imapsync massive sync example batch for Windows users
REM lines beginning with REM are just comments
REM
REM You have to rename this file from sync_loop_windows.bat.txt to sync_loop_windows.bat
REM in order to make it a batch command file that your system will recognize and execute.
REM
REM Replace "imap.side1.org" and "imap.side2.org" with your own values
REM
REM This loop will also create a log file called log_%%I.txt for each account transfer
REM where %%I is just a variable containing the user2 account name.
REM and %mydate%_%mytime% is date and time formatted for a filename.
REM Since "date /t" is localy dependent you may have to adapt mydate=%%c_%%a_%%b_%%d
REM @echo off
DATE /t
TIME /t
FOR /f "tokens=1-4 delims=-/: " %%a IN ('DATE /t') DO (SET mydate=%%c_%%a_%%b_%%d)
FOR /f "tokens=1-2 delims=-/: " %%a IN ('TIME /t') DO (SET mytime=%%a_%%b)
ECHO %mydate%_%mytime%
if not exist LOG mkdir LOG
FOR /F "tokens=1,2,3,4 delims=; eol=#" %%G IN (file.txt) DO ECHO syncing to user %%I & imapsync ^
--host1 imap.side1.org --user1 %%G --password1 %%H ^
--host2 imap.side2.org --user2 %%I --password2 %%J ^
> LOG\log_%%I_%mydate%_%mytime%.txt 2>&1
ECHO Loop finished
ECHO log files are in LOG directory
PAUSE

View file

@ -20,7 +20,7 @@ Synchronise mailboxes between two imap servers.
Good at IMAP migration. More than 44 different IMAP server softwares Good at IMAP migration. More than 44 different IMAP server softwares
supported with success. supported with success.
$Revision: 1.516 $ $Revision: 1.518 $
=head1 SYNOPSIS =head1 SYNOPSIS
@ -350,7 +350,7 @@ Failure stories reported with the following 3 imap servers:
any IMAP email client. any IMAP email client.
Success stories reported with the following 44 imap servers Success stories reported with the following 48 imap servers
(software names are in alphabetic order): (software names are in alphabetic order):
- 1und1 H mimap1 84498 [host1] - 1und1 H mimap1 84498 [host1]
@ -369,6 +369,7 @@ Success stories reported with the following 44 imap servers
2.3-alpha (OSI Approved), 2.3.1, 2.3.7, 2.3.16 2.3-alpha (OSI Approved), 2.3.1, 2.3.7, 2.3.16
(http://asg.web.cmu.edu/cyrus/) (http://asg.web.cmu.edu/cyrus/)
- David Tobit V8 (proprietary Message system). - David Tobit V8 (proprietary Message system).
- Deerfield VisNetic MailServer 5.8.6 [host1] (http://www.deerfield.net/products/visnetic-mailserver/)
- DBMail 1.2.1, 2.0.4, 2.0.9, 2.2rc1 (GPL) (http://www.dbmail.org/). - DBMail 1.2.1, 2.0.4, 2.0.9, 2.2rc1 (GPL) (http://www.dbmail.org/).
2.0.7 seems buggy. 2.0.7 seems buggy.
- Deerfield VisNetic MailServer 5.8.6 [host1] - Deerfield VisNetic MailServer 5.8.6 [host1]
@ -405,6 +406,7 @@ Success stories reported with the following 44 imap servers
- Samsung Contact IMAP server 8.5.0 - Samsung Contact IMAP server 8.5.0
- Scalix v10.1, 10.0.1.3, 11.0.0.431, 11.4.6 - Scalix v10.1, 10.0.1.3, 11.0.0.431, 11.4.6
- SmarterMail, Smarter Mail 5.0 Enterprise, Smarter Mail 5.5 [host1]. - SmarterMail, Smarter Mail 5.0 Enterprise, Smarter Mail 5.5 [host1].
- Softalk Workgroup Mail 7.6.4 [host1].
- SunONE Messaging server 5.2, 6.0 (SUN JES - Java Enterprise System) - SunONE Messaging server 5.2, 6.0 (SUN JES - Java Enterprise System)
- Sun Java(tm) System Messaging Server 6.2-2.05, 6.2-7.05, 6.3 - Sun Java(tm) System Messaging Server 6.2-2.05, 6.2-7.05, 6.3
- Surgemail 3.6f5-5 - Surgemail 3.6f5-5
@ -515,7 +517,7 @@ Entries for imapsync:
Feedback (good or bad) will often be welcome. Feedback (good or bad) will often be welcome.
$Id: imapsync,v 1.516 2012/11/02 22:15:04 gilles Exp gilles $ $Id: imapsync,v 1.518 2012/12/24 00:27:34 gilles Exp gilles $
=cut =cut
@ -646,7 +648,7 @@ my(
# global variables initialisation # global variables initialisation
$rcs = '$Id: imapsync,v 1.516 2012/11/02 22:15:04 gilles Exp gilles $ '; $rcs = '$Id: imapsync,v 1.518 2012/12/24 00:27:34 gilles Exp gilles $ ';
$total_bytes_transferred = 0; $total_bytes_transferred = 0;
$total_bytes_skipped = 0; $total_bytes_skipped = 0;
@ -735,8 +737,8 @@ $relogin2 = defined( $relogin2 ) ? $relogin2 : 5 ;
if ( $fast ) { if ( $fast ) {
# $useuid = 1 ; # $useuid = 1 ;
$foldersizes = 0 ; # $foldersizes = 0 ;
$foldersizesatend = 0 ; # $foldersizesatend = 0 ;
} }
# Activate --usecache if --useuid is set and no --nousecache # Activate --usecache if --useuid is set and no --nousecache
@ -747,6 +749,7 @@ $checkselectable = defined( $checkselectable ) ? $checkselectable : 1 ;
$checkmessageexists = defined( $checkmessageexists ) ? $checkmessageexists : 1 ; $checkmessageexists = defined( $checkmessageexists ) ? $checkmessageexists : 1 ;
$expungeaftereach = defined( $expungeaftereach ) ? $expungeaftereach : 1 ; $expungeaftereach = defined( $expungeaftereach ) ? $expungeaftereach : 1 ;
$abletosearch = defined( $abletosearch ) ? $abletosearch : 1 ; $abletosearch = defined( $abletosearch ) ? $abletosearch : 1 ;
$checkmessageexists = 0 if ( not $abletosearch ) ;
$showpasswords = defined( $showpasswords ) ? $showpasswords : 0 ; $showpasswords = defined( $showpasswords ) ? $showpasswords : 0 ;
$fixslash2 = defined( $fixslash2 ) ? $fixslash2 : 1 ; $fixslash2 = defined( $fixslash2 ) ? $fixslash2 : 1 ;
@ -1088,7 +1091,7 @@ foreach my $h1_fold (@h1_folders_all) {
if ( $foldersizes ) { if ( $foldersizes ) {
( $h1_nb_msg_start, $h1_bytes_start ) = foldersizes( "Host1", $imap1, @h1_folders_wanted ) ; ( $h1_nb_msg_start, $h1_bytes_start ) = foldersizes( "Host1", $imap1, @h1_folders_wanted ) ;
( $h2_nb_msg_start, $h2_bytes_start ) = foldersizes( "Host2", $imap2, @h2_folders_from_1_wanted ) ; ( $h2_nb_msg_start, $h2_bytes_start ) = foldersizes( "Host2", $imap2, @h2_folders_from_1_wanted ) ;
sleep( 2 ) ; $fast or sleep( 2 ) ;
} }
@ -1555,9 +1558,13 @@ sub sync_flags {
} }
print "++++ End looping on each folder\n"; print "++++ End looping on each folder\n";
$debug and print "Time: ", timenext(), " s\n";
#print memory_consumption(); #print memory_consumption();
if ( $foldersizesatend ) { if ( $foldersizesatend ) {
timenext() ;
( $h1_nb_msg_end, $h1_bytes_end ) = foldersizes( "Host1", $imap1, @h1_folders_wanted ) ; ( $h1_nb_msg_end, $h1_bytes_end ) = foldersizes( "Host1", $imap1, @h1_folders_wanted ) ;
( $h2_nb_msg_end, $h2_bytes_end ) = foldersizes( "Host2", $imap2, @h2_folders_from_1_wanted ) ; ( $h2_nb_msg_end, $h2_bytes_end ) = foldersizes( "Host2", $imap2, @h2_folders_from_1_wanted ) ;
} }
@ -1983,8 +1990,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.516 $ ', '$Revision: 1.518 $ ',
'$Date: 2012/11/02 22:15:04 $ ', '$Date: 2012/12/24 00:27:34 $ ',
"\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",
@ -3866,6 +3873,9 @@ sub parse_header_msg {
# remove the first blanks (dbmail bug ?) # remove the first blanks (dbmail bug ?)
$val =~ s/^\s*(.+)$/$1/; $val =~ s/^\s*(.+)$/$1/;
# change tabulations to space (Gmail bug on with "Received:" on multilines)
$val =~ s/\t/ /g ;
# and uppercase header line # and uppercase header line
# (dbmail and dovecot) # (dbmail and dovecot)
@ -3976,7 +3986,7 @@ sub check_last_release {
} }
sub imapsync_version { sub imapsync_version {
my $rcs = '$Id: imapsync,v 1.516 2012/11/02 22:15:04 gilles Exp gilles $ '; my $rcs = '$Id: imapsync,v 1.518 2012/12/24 00:27:34 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="2012-11-02T19:33:22+0100"/> <meta name="date" content="2012-12-24T01:58:51+0100"/>
<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"/>
@ -68,17 +68,22 @@ for <b>2 ways synchronizations</b>.
<h2><a id="NUMBERS"></a>Some numbers for 2011 and 2012</h2> <h2><a id="NUMBERS"></a>Some numbers for 2011 and 2012</h2>
<ul> <ul>
<li>Number of <b>imapsync users</b> per month: between <b>2 and 3 thousands </b>users</li> <li>Number of <b>imapsync users</b> per month: between <b>3000 and 4000 </b>users
<li>Number of <b>imapsync transfers</b> between <b>3 and 25 millions mailboxes </b>transfers per month, (34000 users a year)</li>
total is 93 millions for 2011</li>
<li>Number of <b>imapsync transfers</b> between
<b>5 and 25 millions mailboxes </b>transfers per month,
total is 93 millions for 2011, 90 millions for 2012.</li>
<li>Percentage between <b>operating systems</b> users running imapsync: <li>Percentage between <b>operating systems</b> users running imapsync:
<ul> <ul>
<li><b>Linux: 65 %</b></li> <li><b>Linux: 67 %</b></li>
<li><b>Win32: 18 %</b></li> <li><b>Win32: 16 %</b></li>
<li><b>Darwin: 11 %</b></li> <li><b>Darwin: 9 %</b></li>
<li>FreeBSD: 6 %</li> <li>FreeBSD: 7 %</li>
<li>Solaris: 0.4 %</li> <li>Solaris: 0.3 %</li>
<li>OpenBSD: 0.05 %</li> <li>OpenBSD: 0.03 %</li>
<li>Other: 0.67 %</li>
</ul> </ul>
</li> </li>
<li><b>Biggest user usage</b>: about <b>21 millions</b> of IMAP mailbox transfers (in one month)</li> <li><b>Biggest user usage</b>: about <b>21 millions</b> of IMAP mailbox transfers (in one month)</li>
@ -97,7 +102,7 @@ total is 93 millions for 2011</li>
<p>New features or bugfixes since previous releases:</p> <p>New features or bugfixes since previous releases:</p>
<!-- <ul> <!-- <ul>
<li><b>1.515</b></li> <li><b>1.518</b></li>
<li><b>Enhancement</b>: </li> <li><b>Enhancement</b>: </li>
<li><b>Enhancement</b>: </li> <li><b>Enhancement</b>: </li>
<li><b>Enhancement</b>: </li> <li><b>Enhancement</b>: </li>
@ -113,6 +118,15 @@ total is 93 millions for 2011</li>
</ul> </ul>
--> -->
<ul>
<li><b>1.518</b></li>
<li><b>Bug fix</b>: When identtifying with header, change tabulations to spaces
(Gmail bug on with "Received:" on multilines).</li>
<li><b>Bug fix</b>: Bugfix. Automatic --nocheckmessageexists when --noabletosearch is set.</li>
</ul>
<ul> <ul>
<li><b>1.516</b></li> <li><b>1.516</b></li>
@ -121,42 +135,57 @@ One difference at the start and one at the end.
Useful to <b>detect quickly a difference between host2 and host1</b>. Useful to <b>detect quickly a difference between host2 and host1</b>.
Need both --foldersizes and --foldersizesatend options (which are on by default).</li> Need both --foldersizes and --foldersizesatend options (which are on by default).</li>
<li><b>Usability</b>: Added <b>--foldersizesatend</b>. It gets the folders sizes at the end of the whole transfer. <li><b>Usability</b>: Added <b>--foldersizesatend</b>.
It gets the folders sizes at the end of the whole transfer.
Turned on by default (use --nofoldersizesatend to turn it off).</li> Turned on by default (use --nofoldersizesatend to turn it off).</li>
<li><b>Enhancement</b>: Added option <b>--delete2duplicates</b>; it deletes messages in host2 that are duplicates. <li><b>Enhancement</b>: Added option <b>--delete2duplicates</b>;
it deletes messages in host2 that are duplicates.
--delete2duplicates is on when --delete2 is set unless --nodelete2duplicates is set too. --delete2duplicates is on when --delete2 is set unless --nodelete2duplicates is set too.
</li> </li>
<li><b>Usability</b>: Added <b>current date at the beginning</b> of the run, <li><b>Usability</b>: Added <b>current date at the beginning</b> of the run,
useful when imapsync doesn't end properly or hasn't finished yet.</li> useful when imapsync doesn't end properly or hasn't finished yet.</li>
<li><b>Enhancement</b>: Added option <b>--pidfilelocking</b>; it aborts imapsync, when just launched, <li><b>Enhancement</b>: Added option <b>--pidfilelocking</b>;
it aborts imapsync, when just launched,
in case another imapsync may be running. in case another imapsync may be running.
Turned off by default</li> Turned off by default</li>
<li><b>Usability</b>: Added option <b>--showpasswords</b>. it shows passwords on output instead of "MASKED". <li><b>Usability</b>: Added option <b>--showpasswords</b>.
it shows passwords on output instead of "MASKED".
Turned off by default. Turned off by default.
Useful to restart a run by reading the log or to see what happen with special characters. Useful to restart a run by reading the log
or to see what happen with special characters.
</li> </li>
<li><b>Bug fix</b>: Added option <b>--fixslash2</b> to avoid the '<b>Invalid mailbox name</b>' error. <li><b>Bug fix</b>: Added option <b>--fixslash2</b>
It acts when --sep2 is not character / and --sep1 is character / and host1 folder name contains --sep2 characters. to avoid the '<b>Invalid mailbox name</b>' error.
It acts when --sep1 is character / and --sep2 is not character /
and host1 folder name contains --sep2 characters.
Turned on by default (--nofixslash2 to unable it).</li> Turned on by default (--nofixslash2 to unable it).</li>
<li><b>Enhancement</b>: Added option <b>--noabletosearch</b> to allow the listing of messages without the imap "SEARCH ALL" command. <li><b>Enhancement</b>: Added option <b>--noabletosearch</b>
It's useful for playing with poor imap servers like <b>Softalk 7.6.4</b> (8.6 is fine with SEARCH ALL).</li> to allow the listing of messages without the imap "SEARCH ALL" command.
It's useful for playing with poor imap servers like <b>Softalk 7.6.4</b>
(8.6 is fine with SEARCH ALL).</li>
</ul> </ul>
<ul> <ul>
<li><b>1.508</b></li> <li><b>1.508</b></li>
<li><b>Usability</b>: imapsync guesses and <b>prints when it'll finish</b> the transfer; added <b>ETA</b> after each copy (Estimated Time of Arrival)</li> <li><b>Usability</b>: imapsync guesses and <b>prints when it'll finish</b> the transfer;
<li><b>Enhancement</b>: Added <b>--noexpungeaftereach</b> to speedup --delete --expunge from Gmail.</li> added <b>ETA</b> after each copy (Estimated Time of Arrival)</li>
<li><b>Usability</b>: Added Host1 or Host2 before "Nb messages" "Total size" with --foldersiszes (to facilitate parsing)</li>
<li><b>Bug fix</b>: Previous fix about characters <kbd>*|?:"&lt;&gt;</kbd> to <kbd>_</kbd> in cache path was not complete.</li> <li><b>Enhancement</b>: Added <b>--noexpungeaftereach</b>
to speedup --delete --expunge from Gmail.</li>
<li><b>Usability</b>: Added Host1 or Host2 before "Nb messages" "Total size"
with --foldersiszes (to facilitate parsing)</li>
<li><b>Bug fix</b>: Previous fix about characters <kbd>*|?:"&lt;&gt;</kbd> to <kbd>_</kbd>
in cache path was not complete.</li>
</ul> </ul>
@ -171,6 +200,7 @@ It's useful for playing with poor imap servers like <b>Softalk 7.6.4</b> (8.6 is
<ul> <ul>
<li><b>1.500</b></li> <li><b>1.500</b></li>
<li><b>Enhancement</b>: Added option <b>--nocheckselectable</b> to fix INBOX issue with Jana-server.</li> <li><b>Enhancement</b>: Added option <b>--nocheckselectable</b> to fix INBOX issue with Jana-server.</li>
<li><b>Bug fix</b>: The cache system didn't work in Win32 (problem with \ transformation).</li> <li><b>Bug fix</b>: The cache system didn't work in Win32 (problem with \ transformation).</li>
<li><b>Bug fix</b>: Check the return of touch calls for the cache. </li> <li><b>Bug fix</b>: Check the return of touch calls for the cache. </li>
@ -180,8 +210,12 @@ It's useful for playing with poor imap servers like <b>Softalk 7.6.4</b> (8.6 is
<ul> <ul>
<li><b>1.484</b></li> <li><b>1.484</b></li>
<li><b>Bug fix</b>: Back to select() (read-write mode) instead of examine() (read-only mode in 1.468) on host1. <b>Needed with --delete</b></li>
<li><b>Enhancement</b>: Added option --exitwhenover option <b>to avoid locking</b> when transfers exceed maximum limit. <li><b>Bug fix</b>: Back to select() (read-write mode) instead of examine()
(read-only mode in 1.468) on host1. <b>Needed with --delete</b></li>
<li><b>Enhancement</b>: Added option --exitwhenover option <b>to avoid locking</b>
when transfers exceed maximum limit.
See for example <a href="http://support.google.com/a/bin/answer.py?hl=en&amp;answer=1071518">this Gmail constraint</a> See for example <a href="http://support.google.com/a/bin/answer.py?hl=en&amp;answer=1071518">this Gmail constraint</a>
<ul> <ul>
<li>imapsync ... --exitwhenover 2500000000 # 2.5GB if <b>host1 is Gmail</b></li> <li>imapsync ... --exitwhenover 2500000000 # 2.5GB if <b>host1 is Gmail</b></li>
@ -196,11 +230,17 @@ See for example <a href="http://support.google.com/a/bin/answer.py?hl=en&amp;ans
<ul> <ul>
<li><b>1.476</b></li> <li><b>1.476</b></li>
<li><b>Usability</b>: Default headers used to identify a message are now "Message-Id" and "Received" (<b>Exchange compatibility</b> bu default).</li>
<li><b>Usability</b>: Default headers used to identify a message are now "Message-Id" and "Received"
(<b>Exchange compatibility</b> bu default).</li>
<li><b>Enhancement</b>: Added option --addheader to fix the issue <li><b>Enhancement</b>: Added option --addheader to fix the issue
"ignored (no header so we ignore this message)" (on <b>Sent</b> folder usually). "ignored (no header so we ignore this message)" (on <b>Sent</b> folder usually).
Thanks to Ameir Abdeldayem</li> Thanks to Ameir Abdeldayem</li>
<li><b>Enhancement</b>: Added --nofilterflags to check any STORE flags by ignoring PERMANENTFLAGS (Exchange tests)</li>
<li><b>Enhancement</b>: Added --nofilterflags to check any STORE flags
by ignoring PERMANENTFLAGS (Exchange tests)</li>
</ul> </ul>
@ -214,16 +254,24 @@ See for example <a href="http://support.google.com/a/bin/answer.py?hl=en&amp;ans
<h2><a id="DOC_BASIC"></a>Simple transfer on Windows</h2> <h2><a id="DOC_BASIC"></a>Simple transfer on Windows</h2>
<p> <p>
See <b><a href="./examples/imapsync_example.bat.txt">imapsync_example.bat.txt</a></b> batch file example See <b><a href="./examples/imapsync_example.bat">imapsync_example.bat</a></b>
that you can easily adapt with your parameters (remove .txt extension in order to run it). batch file example that you can easily adapt with your parameters.
</p> </p>
<h2><a id="DOC_MASS"></a>Massive transfers</h2> <h2><a id="DOC_MASS"></a>Massive transfers (many mailboxes)</h2>
<p> <p>
See <b><a href="./examples/file.txt">file.txt</a></b> example for <b>batch massive migration</b> In order to migrate many mailboxes a good way is to use a loop over a csv
(many mailboxes) on Windows or Unix. file containing only the data credentials.
A example of this file is <b><a href="./examples/file.txt">file.txt</a></b>,
it can be used by the two following command scripts.<br/>
On Windows, see <b><a href="./examples/sync_loop_windows.bat">sync_loop_windows.bat</a></b>
batch example.<br/>
On Unix, see <b><a href="./examples/sync_loop_unix.sh">sync_loop_unix.sh</a></b>
example.
</p> </p>
@ -259,7 +307,8 @@ any Unix, Linux, Windows, or Mac OS operating system.
<p> <p>
Payment by Paypal account and credit card accepted. <br/> Payment by Paypal account and credit card accepted. <br/>
Price <b>42 EUR</b> is equal to around <b>50 USD</b>, no problem to pay in USD (or any currency) via paypal: Price <b>42 EUR</b> is equal to around <b>50 USD</b>,
no problem to pay in USD (or any currency) via paypal:
</p> </p>
@ -274,7 +323,9 @@ Price <b>42 EUR</b> is equal to around <b>50 USD</b>, no problem to pay in USD (
</select> </select>
<br/> <br/>
<input type="hidden" name="on1" value="VAT if professional in Europe"/> <input type="hidden" name="on1" value="VAT if professional in Europe"/>
Enter your <b>VAT</b> <input type="text" name="os1" size="17" maxlength="17"/> <b> if you're a European professional</b> (for accounting). It's 2 letters followed by 11 digits, for example mine is FR74429303332. Enter your <b>VAT</b> <input type="text" name="os1" size="17" maxlength="17"/> <b>
if you're a European professional</b> (for accounting).
It's 2 letters followed by 11 digits, for example mine is FR74429303332.
<br/> <br/>
<input type="hidden" name="currency_code" value="EUR"/> <input type="hidden" name="currency_code" value="EUR"/>
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_buynowCC_LG.gif" <input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_buynowCC_LG.gif"
@ -285,8 +336,8 @@ name="submit" alt="PayPal - The safer, easier way to pay online!"/>
<p>You will receive a <b>download link just after</b> the payment.<br/> <p>You will receive a <b>download link just after</b> the payment.<br/>
You will also receive a gpg signed <b>invoice</b> within <b>a few days by email</b>.<br/> You will also receive a gpg signed <b>invoice</b> within <b>a few days by email</b>.<br/>
Please give a <b>delivery postal address where the invoice will be needed</b> (your company for example), Please give a <b>delivery postal address where the invoice will be needed</b>
since reedit is not easy (and forbidden by law). (your company for example), since reedit is not easy (and forbidden by law).
</p> </p>
@ -305,7 +356,8 @@ buying the latest win32 <b>standalone imapsync.exe</b> for <b>42 EUR</b>
<p> <p>
Payment by Paypal account and credit card accepted. <br/> Payment by Paypal account and credit card accepted. <br/>
Price <b>42 EUR</b> is equal to around <b>50 USD</b>, no problem to pay in USD (or any currency) via paypal: Price <b>42 EUR</b> is equal to around <b>50 USD</b>,
no problem to pay in USD (or any currency) via 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">
@ -319,7 +371,9 @@ Price <b>42 EUR</b> is equal to around <b>50 USD</b>, no problem to pay in USD (
</select> </select>
<br/> <br/>
<input type="hidden" name="on1" value="VAT if professional in Europe"/> <input type="hidden" name="on1" value="VAT if professional in Europe"/>
Enter your <b>VAT</b> <input type="text" name="os1" size="17" maxlength="17"/> <b> if you're a European professional</b> (for accounting). It's 2 letters followed by 11 digits, for example mine is FR74429303332. Enter your <b>VAT</b> <input type="text" name="os1" size="17" maxlength="17"/> <b>
if you're a European professional</b> (for accounting).
It's 2 letters followed by 11 digits, for example mine is FR74429303332.
<br/> <br/>
<input type="hidden" name="currency_code" value="EUR"/> <input type="hidden" name="currency_code" value="EUR"/>
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_buynowCC_LG.gif" <input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_buynowCC_LG.gif"
@ -330,8 +384,8 @@ name="submit" alt="PayPal - The safer, easier way to pay online!"/>
<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/>
You will also receive a gpg signed <b>invoice</b> within <b>a few days by email</b>.<br/> You will also receive a gpg signed <b>invoice</b> within <b>a few days by email</b>.<br/>
Please give a <b>delivery postal address where the invoice will be needed</b> (your company for example), Please give a <b>delivery postal address where the invoice will be needed</b>
since reedit is not easy (and forbidden by law). (your company for example), since reedit is not easy (and forbidden by law).
</p> </p>
@ -343,14 +397,17 @@ The build system for imapsync.exe is XP Pro SP2 on a Intel Celeron 400 MHz 256 M
<h2><a id="buy_support"></a>Buy full professional support for imapsync</h2> <h2><a id="buy_support"></a>Buy full professional support for imapsync</h2>
<p>You will be able to expose your issues by email or phone and we'll work together until complete success. <p>You will be able to expose your issues by email
or phone and we'll work together until complete success.
</p> </p>
<p>For <b>90 EUR</b> buy imapsync <b>full support</b> done by the imapsync designer/developper. <p>For <b>90 EUR</b> buy imapsync <b>full support</b>
done by the imapsync designer/developper.
</p> </p>
<p> <p>
Payment by Paypal account and credit card accepted. <br/> Payment by Paypal account and credit card accepted. <br/>
90 EUR is equal to around <b>110 USD</b>, no problem to pay in USD (or any currency) with paypal: 90 EUR is equal to around <b>110 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">
@ -364,7 +421,9 @@ Payment by Paypal account and credit card accepted. <br/>
</select> </select>
<br/> <br/>
<input type="hidden" name="on1" value="VAT if professional in Europe"/> <input type="hidden" name="on1" value="VAT if professional in Europe"/>
Enter your <b>VAT</b> <input type="text" name="os1" size="17" maxlength="17"/> <b> if you're a European professional</b> (for accounting). It's 2 letters followed by 11 digits, for example mine is FR74429303332. Enter your <b>VAT</b> <input type="text" name="os1" size="17" maxlength="17"/> <b>
if you're a European professional</b> (for accounting).
It's 2 letters followed by 11 digits, for example mine is FR74429303332.
<br/> <br/>
<input type="hidden" name="currency_code" value="EUR"/> <input type="hidden" name="currency_code" value="EUR"/>
<input type="image" <input type="image"
@ -377,27 +436,33 @@ Enter your <b>VAT</b> <input type="text" name="os1" size="17" maxlength="17"/> <
</form> </form>
<p>You will also receive a gpg signed <b>invoice</b> within <b>a few days by email</b>.<br/> <p>You will also receive a gpg signed <b>invoice</b> within <b>a few days by email</b>.<br/>
Please give a <b>delivery postal address where the invoice will be needed</b> (your company for example), Please give a <b>delivery postal address where the invoice will be needed</b>
since reedit is not easy (and forbidden by law). (your company for example), since reedit is not easy (and forbidden by law).
</p> </p>
<h2><a id="doc"></a>Documentation</h2> <h2><a id="doc"></a>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.
</p> </p>
<p>The <a href="README">README</a> file has many tips to understand imapsync and succeed in your migration or backup. <p>The <a href="README">README</a> file has many tips
to understand imapsync and succeed in your migration or backup.
</p> </p>
<p>The <a href="FAQ">FAQ</a> file presents Frequently Asked Questions (and not so frequently asked ones). <p>The <a href="FAQ">FAQ</a> file presents Frequently Asked Questions
(and not so frequently asked ones).
</p> </p>
<p>The <a href="ChangeLog">ChangeLog</a> to read what changed in details since 2001.</p> <p>The <a href="ChangeLog">ChangeLog</a>
to read what changed in details since 2001.</p>
<p>The <a href="TODO">TODO</a> file list what may be coded or done in the future. <p>The <a href="TODO">TODO</a> file
lists what may be coded or done in the future.
</p> </p>
<p>All the people I thank are in the <a href="CREDITS">CREDITS</a> file. <p>All the people I thank are in the
<a href="CREDITS">CREDITS</a> file.
</p> </p>
<p>What you can do with imapsync is listed in <a href="COPYING">COPYING</a>. <p>What you can do with imapsync is listed in <a href="COPYING">COPYING</a>.
@ -464,10 +529,14 @@ 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> <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>46 different imap server softwares supported!</b><br/> <p>Now the long reported <b>success stories</b> list: <b>
48 different imap server softwares supported!</b><br/>
[host1] means "source server" and [host2] means "destination server": [host1] means "source server" and [host2] means "destination server":
</p> </p>
@ -539,6 +608,7 @@ Don't hesitate to have a try, I will help you and make efforts to switch them to
<li>Samsung Contact IMAP server 8.5.0 </li> <li>Samsung Contact IMAP server 8.5.0 </li>
<li>Scalix v10.1, 10.0.1.3, 11.0.0.431, 11.4.6 (<a href="http://www.scalix.com/">http://www.scalix.com/</a>) </li> <li>Scalix v10.1, 10.0.1.3, 11.0.0.431, 11.4.6 (<a href="http://www.scalix.com/">http://www.scalix.com/</a>) </li>
<li>SmarterMail, Smarter Mail 5.0 Enterprise, Smarter Mail 5.5 [host1]. (<a href="http://www.smartertools.com/">http://www.smartertools.com/</a>) </li> <li>SmarterMail, Smarter Mail 5.0 Enterprise, Smarter Mail 5.5 [host1]. (<a href="http://www.smartertools.com/">http://www.smartertools.com/</a>) </li>
<li>Softalk Workgroup Mail 7.6.4 [host1] (<a href="http://www.softalkltd.com/products/download_wm_v7.asp">http://www.softalkltd.com/products/download_wm_v7.asp</a>).</li>
<li>SunONE Messaging server 5.2, 6.0 (SUN JES - Java Enterprise System) (<a href="http://www.oracle.com/">http://www.oracle.com/</a>) </li> <li>SunONE Messaging server 5.2, 6.0 (SUN JES - Java Enterprise System) (<a href="http://www.oracle.com/">http://www.oracle.com/</a>) </li>
<li>Sun Java(tm) System Messaging Server 6.2-2.05, 6.2-7.05, 6.3 (<a href="http://www.oracle.com/">http://www.oracle.com/</a>) </li> <li>Sun Java(tm) System Messaging Server 6.2-2.05, 6.2-7.05, 6.3 (<a href="http://www.oracle.com/">http://www.oracle.com/</a>) </li>
<li>Surgemail 3.6f5-5 (<a href="http://netwinsite.com/surgemail/">http://netwinsite.com/surgemail/</a>) </li> <li>Surgemail 3.6f5-5 (<a href="http://netwinsite.com/surgemail/">http://netwinsite.com/surgemail/</a>) </li>
@ -548,13 +618,12 @@ Don't hesitate to have a try, I will help you and make efforts to switch them to
<li>VMS, Imap part of TCP/IP suite of VMS 7.3.2 (<a href="http://h71000.www7.hp.com/openvms/">http://h71000.www7.hp.com/openvms/</a>) </li> <li>VMS, Imap part of TCP/IP suite of VMS 7.3.2 (<a href="http://h71000.www7.hp.com/openvms/">http://h71000.www7.hp.com/openvms/</a>) </li>
<li><b>Yahoo</b> [host1] (<a href="http://www.yahoo.com/">http://www.yahoo.com/</a>) </li> <li><b>Yahoo</b> [host1] (<a href="http://www.yahoo.com/">http://www.yahoo.com/</a>) </li>
<li><b>Zimbra-IMAP</b> 3.0.1 GA 160, 3.1.0 Build 279, 4.0.5, 4.5.2, 4.5.6, <li><b>Zimbra-IMAP</b> 3.0.1 GA 160, 3.1.0 Build 279, 4.0.5, 4.5.2, 4.5.6,
Zimbra 5.0.24_GA_3356.RHEL4 [host1], 5.5, 6.x Zimbra 5.0.24_GA_3356.RHEL4 [host1], 5.5, 6.x
(<a href="http://www.zimbra.com/">http://www.zimbra.com/</a>) </li> (<a href="http://www.zimbra.com/">http://www.zimbra.com/</a>) </li>
</ul> </ul>
<h2><a id="similar"></a>Similar softwares</h2> <h2><a id="similar"></a>Similar softwares</h2>
<ul> <ul>
<li> imap_tools: <a href="http://www.athensfbc.com/imap_tools">http://www.athensfbc.com/imap_tools</a></li> <li> imap_tools: <a href="http://www.athensfbc.com/imap_tools">http://www.athensfbc.com/imap_tools</a></li>
<li> <b>offlineimap</b>: <a href="https://github.com/nicolas33/offlineimap">https://github.com/nicolas33/offlineimap</a></li> <li> <b>offlineimap</b>: <a href="https://github.com/nicolas33/offlineimap">https://github.com/nicolas33/offlineimap</a></li>
@ -616,7 +685,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.136 2012/11/03 00:46:00 gilles Exp gilles $) ($Id: index.shtml,v 1.141 2012/12/24 01:03:07 gilles Exp gilles $)
</p> </p>
</body> </body>

105
tests.sh
View file

@ -1,6 +1,6 @@
#!/bin/sh #!/bin/sh
# $Id: tests.sh,v 1.205 2012/11/03 00:38:15 gilles Exp gilles $ # $Id: tests.sh,v 1.209 2012/12/24 02:24:09 gilles Exp gilles $
# Example 1: # Example 1:
# CMD_PERL='perl -I./Mail-IMAPClient-3.32/lib' sh -x tests.sh # CMD_PERL='perl -I./Mail-IMAPClient-3.32/lib' sh -x tests.sh
@ -179,7 +179,6 @@ locallocal() {
ll_nofoldersizes() ll_nofoldersizes()
{ {
can_send && sendtestmessage
$CMD_PERL ./imapsync \ $CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \ --host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \ --passfile1 ../../var/pass/secret.tata \
@ -188,6 +187,15 @@ ll_nofoldersizes()
--nofoldersizes --folder INBOX --nofoldersizes --folder INBOX
} }
ll_nofoldersizes_nofoldersizesatend()
{
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--nofoldersizes --nofoldersizesatend --folder INBOX
}
pidfile() { pidfile() {
@ -260,6 +268,15 @@ ll_authmech_PREAUTH() {
ll_unknow_option() {
! $CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--folder INBOX --unknow_option
}
ll_timeout() { ll_timeout() {
@ -859,6 +876,18 @@ ll_search_FLAGGED()
--search 'FLAGGED' --folder INBOX --search 'FLAGGED' --folder INBOX
} }
ll_search_NOT_DELETED()
{
can_send && sendtestmessage
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--search 'NOT DELETED' --folder INBOX
}
ll_search_SENTSINCE() ll_search_SENTSINCE()
{ {
can_send && sendtestmessage can_send && sendtestmessage
@ -1434,6 +1463,46 @@ ll_regex_flag4()
echo 'sudo rm -f /home/vmail/titi/.yop.yap/cur/*' echo 'sudo rm -f /home/vmail/titi/.yop.yap/cur/*'
} }
ll_regex_flag5()
{
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--folder INBOX.yop.yap \
--debugflags --regexflag "s/Answered/Flagged/g"
echo 'rm -f /home/vmail/titi/.yop.yap/cur/*'
}
ll_regex_flag6_add_SEEN()
{
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--folder INBOX.yop.yap \
--debugflags --regexflag "s/(.*)/\$1 \\\\Seen/"
echo 'rm -f /home/vmail/titi/.yop.yap/cur/*'
}
ll_regex_flag7_add_SEEN()
{
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--folder INBOX.yop.yap \
--debugflags --regexflag 's/(.*)/$1 \\Seen/'
echo 'rm -f /home/vmail/titi/.yop.yap/cur/*'
}
ll_regex_flag_keep_only() ll_regex_flag_keep_only()
{ {
@ -1845,7 +1914,14 @@ xxxxx_gmail() {
--user2 gilles.lamiral@gmail.com \ --user2 gilles.lamiral@gmail.com \
--passfile2 ../../var/pass/secret.gilles_gmail \ --passfile2 ../../var/pass/secret.gilles_gmail \
--nofoldersizes \ --nofoldersizes \
--justfolders --regextrans2 's/ //g' --exclude 'INBOX.yop.YAP' --exclude Gmail --regextrans2 's/ +$//g' --regextrans2 's# +/#/#g' \
--exclude 'INBOX.yop.YAP' \
--regextrans2 "s,^Messages envoy&AOk-s$,[Gmail]/Messages envoy&AOk-s," \
--regextrans2 "s,^Sent$,[Gmail]/Sent Mail," \
--folder 'INBOX.Messages envoy&AOk-s' \
--folder 'INBOX.Sent'
# --exclude Gmail
} }
@ -1874,10 +1950,24 @@ xxxxx_gmail_3() {
--user2 gilles.lamiral@gmail.com \ --user2 gilles.lamiral@gmail.com \
--passfile2 ../../var/pass/secret.gilles_gmail \ --passfile2 ../../var/pass/secret.gilles_gmail \
--nofoldersizes \ --nofoldersizes \
--folder INBOX.few_emails --debug \ --folder INBOX.few_emails --debug --useheader Message-ID --delete2 --dry
--regextrans2 's,few_emails,Gmail/Messages envoyes,'
} }
xxxxx_gmail_3_Received() {
! ping -c1 imap.gmail.com || $CMD_PERL ./imapsync \
--host1 $HOST2 \
--user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 imap.gmail.com \
--ssl2 \
--user2 gilles.lamiral@gmail.com \
--passfile2 ../../var/pass/secret.gilles_gmail \
--nofoldersizes \
--folder INBOX.few_emails --debug --useheader Received --delete2 --dry
}
xxxxx_gmail_4_Sent() { xxxxx_gmail_4_Sent() {
! ping -c1 imap.gmail.com || $CMD_PERL ./imapsync \ ! ping -c1 imap.gmail.com || $CMD_PERL ./imapsync \
@ -2969,8 +3059,8 @@ dprof_bigmail()
mandatory_tests=' mandatory_tests='
no_args no_args
option_version option_version
option_tests option_tests
option_tests_debug option_tests_debug
option_bad_delete2 option_bad_delete2
passwords_masked passwords_masked
@ -2988,6 +3078,7 @@ gmail
gmail_gmail gmail_gmail
gmail_gmail2 gmail_gmail2
yahoo_xxxx yahoo_xxxx
ll_unknow_option
ll_ask_password ll_ask_password
ll_bug_folder_name_with_blank ll_bug_folder_name_with_blank
ll_timeout ll_timeout