1
0
mirror of https://github.com/imapsync/imapsync.git synced 2024-11-16 15:52:47 +01:00
This commit is contained in:
Nick Bebout 2014-02-13 11:34:20 -06:00
parent 6a0efa6bc8
commit 7d2043f95f
22 changed files with 1420 additions and 937 deletions

View File

@ -1,17 +1,37 @@
RCS file: RCS/imapsync,v
Working file: imapsync
head: 1.580
head: 1.584
branch:
locks: strict
gilles: 1.580
gilles: 1.584
access list:
symbolic names:
keyword substitution: kv
total revisions: 580; selected revisions: 580
total revisions: 584; selected revisions: 584
description:
----------------------------
revision 1.580 locked by: gilles;
revision 1.584 locked by: gilles;
date: 2014/02/05 00:40:59; author: gilles; state: Exp; lines: +77 -50
Debug. Print separator given by NAMESPACE even when --sep1 oe --sep2 is used.
Debug. Prints prefix given by NAMESPACE even when --prefix1 or --prefix2 is used.
(Preparation for advising not to use --prefix unless suggested)
----------------------------
revision 1.583
date: 2014/02/04 03:04:35; author: gilles; state: Exp; lines: +15 -11
Bug fix. --ssl1 --tls2 was buggy because of default SSL_VERIFY_PEER. "Can not go to tls encryption on [localhost]:Unable to start TLS: Cannot determine peer hostname for verificationerror:00000000:lib(0):func(0):reason(0)"
----------------------------
revision 1.582
date: 2014/01/24 01:43:19; author: gilles; state: Exp; lines: +20 -12
Bugfix. Check if going to tls is ok, exit otherwise with explicit error message.
Thanks to Dennis Schridde for reporting this ugly bug.
----------------------------
revision 1.581
date: 2014/01/15 02:42:06; author: gilles; state: Exp; lines: +41 -15
Added --debugmaxlinelength
Added --minmaxlinelength to select messages with long lines only.
----------------------------
revision 1.580
date: 2013/12/25 02:52:36; author: gilles; state: Exp; lines: +51 -27
Added --skipcrossduplicates to avoid copying messages that are already copied in another folder.
Added --debugcrossduplicates to print which messages (UIDs) are skipped with --skipcrossduplicates (and in what other folders they are).

205
FAQ
View File

@ -1,5 +1,5 @@
#!/bin/cat
# $Id: FAQ,v 1.161 2013/12/25 03:25:18 gilles Exp gilles $
# $Id: FAQ,v 1.166 2014/01/27 02:23:30 gilles Exp gilles $
+------------------+
| FAQ for imapsync |
@ -1601,11 +1601,15 @@ R. This error message comes from Exchange IMAP server when it
encounters any problem. Most of the time it is one of the following:
* Some messages are bigger than the size limit. 10 MB by default
on Exchange. It can be upped by configuration.
Or use option --maxsize 10000000 (for 10 MB, change it if needed)
to tell imapsync to skip those messages.
on Exchange. It can be upped by configuration for Exchange.
If you configure this limit then use option --maxsize 10000000
for 10 MB, change it if needed) to tell imapsync to skip those messages.
This value is 25 MB for Office365 --maxsize 25000000
imapsync ... --maxsize 10000000
imapsync ... --maxsize 10000000 # 10 MB for Exchange
imapsync ... --maxsize 25000000 # 25 MB for Office365
* Quota reached. The whole account is full.
It can be upped by configuration.
@ -1645,45 +1649,7 @@ Thanks to Dave Murray and Simon Savva for reporting and solving
this issue.
=======================================================================
Q. From Zimbra to XXX
imapsync ... \
--exclude "Conversation Action Settings" \
--exclude "Quick Step Settings" \
--exclude "News Feed"
=======================================================================
Q. From or to HMailServer version 4.4.1.
R. You have to add prefix and separator manually because 4.4.1 doesn't
honor the NAMESPACE imap command.
Example for host1:
imapsync ... \
--prefix1 "" --sep1 .
No specific option for HMailServer 5.3.3 since NAMESPACE is supported.
Maybe --subscribe_all will help you to see all migrated folders.
=======================================================================
Q. Synchronizing from SmarterMail to XXX
imapsync --host1 imap.d1.org --user1 joe --password1 secret1 --sep1 "/" \
--host2 imap.d2.org --user2 joe --password2 secret2 \
--noauthmd5 \
--prefix1 "" \
--regextrans2 's#^Inbox$#INBOX#' \
--regextrans2 's#Sent Items$#Sent#' \
--dry --justfolders
Maybe add other --regextrans2 to change folder names and see the result.
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
right. Here's an example of migrating an old "Sent" folder to
@ -1692,37 +1658,36 @@ R. There are some details to get the special [Gmail] sub-folders
imapsync --host1 mail.oldhost.com \
--user1 my_email@oldhost.com \
--password1 password \
--host2 imap.gmail.com --ssl2 \
--host2 imap.gmail.com \
--user2 my_email@gmail.com \
--password2 password \
--ssl2 \
--exitwhenover 500000000 \
--exclude "\[Gmail\]$" \
--addheader \
--regextrans2 "s,^Sent$,[Gmail]/Sent Mail," \
--regextrans2 "s/[ ]+/_/g" \
--regextrans2 "s/[\^]/_/g" \
--regextrans2 "s/['\"\\\\]/_/g"
--exclude "\[Gmail\]$" \
--regextrans2 "s/[ ]+/_/g" \
--regextrans2 "s/[\^]/_/g" \
--regextrans2 "s/['\"\\\\]/_/g" \
--regextrans2 "s,^Sent$,[Gmail]/Sent Mail,"
Explanations:
If you're using a different language in Gmail you might adapt
this example with the folder name translated, an example in French:
--ssl2 is mandatory since Gmail only supports imap ssl connections.
imapsync ...
--regextrans2 "s,^Messages envoy&AOk-s$,[Gmail]/Messages envoy&AOk-s," \
--exitwhenover 500000000 option is here to avoid locking when
transfers exceed maximum limit.
See http://support.google.com/a/bin/answer.py?hl=en&answer=1071518
--exitwhenover is not mandatory in the sense you may be able to
use an upper value than 500 MB without disconnections; I don't
know the hard value, it seems to vary, so just have some tries
and report me what you discover in case you detect something.
The --addheader option is there because "Sent" folder messages
sometimes lack the "Message-Id" header needed by imapsync
to identify messages (only when --useuid is not used).
So option --addheader adds a "Message-Id" header.
You can add --folder "INBOX.Sent" in the example in case
you want to sync only the "Sent" folder.
The "All Mail" archive pseudo-folder should be updated automaticaly.
--exitwhenover option is here to avoid locking when transfers
exceed maximum limit.
See http://support.google.com/a/bin/answer.py?hl=en&answer=1071518
sometimes lack the "Message-Id:" and "Received:" headers needed
by imapsync to identify messages (only when --useuid is not used).
So option --addheader adds a "Message-Id" header consiting fo
the imap UID of the message on the host1 folder, like
"Message-Id: 12345@imapsync".
--exclude "\[Gmail\]$" is there to avoid a small examine/select error:
"Could not examine: 43 NO [NONEXISTENT] Unknown Mailbox: [Gmail]
@ -1740,9 +1705,25 @@ not accepted by gmail, character ^ to character _ underscore.
--regextrans2 "s/['\"\\\\]/_/g" is optional. It converts
characters ' or " or \ to character _ underscore.
--regextrans2 "s,^Sent$,[Gmail]/Sent Mail," is to transform the
folder name "Sent" and adapt it to Gmail "Sent Mail" 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 ...
--regextrans2 "s,^Messages envoy&AOk-s$,[Gmail]/Messages envoy&AOk-s," \
You can add --folder "INBOX.Sent" in the example in case
you want to sync only the "Sent" folder.
You can select folders exported to imap within the gmail preferences,
unselect all "System labels" depending on your needs.
The "All Mail" archive pseudo-folder should be updated automaticaly.
=======================================================================
Q. Some of the folders are getting created with [IMAP] prefix on Google
side. How to stop creating folder with this prefix?
@ -1752,21 +1733,47 @@ R. No switch in imapsync since [IMAP]/ prefix is done by Gmail,
it might be configurable with Gmail parameters.
=======================================================================
Q. Synchronizing from Gmail to XXX
Q. Synchronizing from Gmail to XXX
R. Gmail needs SSL
./imapsync \
--host1 imap.gmail.com \
--ssl1 \
--user1 gilles.lamiral@gmail.com \
--password1 gmailsecret \
--exitwhenover 2500000000 \
--host2 localhost
--user2 tata \
--password2 tatasecret \
--ssl1 \
--exitwhenover 2500000000 \
--useheader="X-Gmail-Received" \
--useheader 'Message-Id'
--useheader "Message-Id" \
--skipcrossduplicates \
--folderfirst "Work" \
--folderfirst "Friends" \
--folderlast "CanWait" \
--folderlast "[Gmail]/All Mail"
Explanations:
--ssl1 is mandatory since Gmail only supports imap ssl connections.
--exitwhenover 2500000000 option is here to avoid locking when
transfers exceed maximum limit.
See http://support.google.com/a/bin/answer.py?hl=en&answer=1071518
--exitwhenover is not mandatory in the sense you may be able to
use an upper value than 2.5 GB without disconnections; I don't
know the hard value, it seems to vary, so just have some tries
and report me what you discover in case you detect something.
--useheader="X-Gmail-Received" --useheader "Message-Id" are not
mandatory. I use them because I found (several years ago, it may
have changed) that Gmail always adds a different header
"X-Gmail-Received:" to all messages it gets. So the identification
by imapsync can not fall using this header. "Message-Id" is there
for safety about this Gmail rule.
If your destination imap server doesn't like "[Gmail]" name, just add
option:
@ -1779,6 +1786,27 @@ unselect all "System labels".
exceed maximum limit.
See http://support.google.com/a/bin/answer.py?hl=en&answer=1071518
--skipcrossduplicates is optional but it can save Gigabytes of hard
disk memory. Within imap protocol, Gmail presents Gmail labels as
folders so a message labeled "Work" "ProjectX" "Urgent" ends up
in three different imap folders "Work" "ProjectX" and "Urgent"
after an imap sync. --skipcrossduplicates prevent this behavior.
An issue with --skipcrossduplicates is that the first label synced
by imapsync goes to its corresponding folder and other labels are
ignored. This way, at least you can choose what labels have the
priority by using the --folderfirst option. For example
--folderfirst "Work" will sync messages labeled "Work" before
messages labeled "CanWait" or "Urgent". By default imapsync
syncs folders (Gmail labels) using the classical alphanumeric order.
--folderlast "CanWait" will sync only messages that have the
label CanWait and only it.
--folderlast "[Gmail]/All Mail", in conjonction with option
--skipcrossduplicates, will only put in "[Gmail]/All Mail"
the messages that are not labeled at all.
=======================================================================
Q. How to use XOAUTH to globally authenticate gmail users?
@ -1826,6 +1854,43 @@ http://www.linux-france.org/prj/imapsync_list/msg00639.html
http://biasecurities.com/blog/2009/migrate-email-from-gmail-to-google-apps/
http://www.thamtech.com/blog/2008/03/29/gmail-to-google-apps-email-migration/
=======================================================================
Q. From Zimbra to XXX
imapsync ... \
--exclude "Conversation Action Settings" \
--exclude "Quick Step Settings" \
--exclude "News Feed"
=======================================================================
Q. From or to HMailServer version 4.4.1.
R. You have to add prefix and separator manually because 4.4.1 doesn't
honor the NAMESPACE imap command.
Example for host1:
imapsync ... \
--prefix1 "" --sep1 .
No specific option for HMailServer 5.3.3 since NAMESPACE is supported.
Maybe --subscribe_all will help you to see all migrated folders.
=======================================================================
Q. Synchronizing from SmarterMail to XXX
imapsync --host1 imap.d1.org --user1 joe --password1 secret1 --sep1 "/" \
--host2 imap.d2.org --user2 joe --password2 secret2 \
--prefix1 "" \
--regextrans2 "s#Sent Items$#Sent#" \
--dry --justfolders
Maybe add other --regextrans2 to change folder names and see the result.
When satisfied, run without --dry --justfolders
=======================================================================
Q. Synchronizing from Yahoo to XXX

View File

@ -1,5 +1,5 @@
# $Id: Makefile,v 1.139 2013/12/25 11:36:53 gilles Exp gilles $
# $Id: Makefile,v 1.141 2014/02/13 03:18:50 gilles Exp gilles $
.PHONY: help usage all
@ -8,6 +8,10 @@ help: usage
usage:
@echo " imapsync $(VERSION), You can do :"
@echo "make install # as root"
@echo "make install_dependencies # it installs needed Perl modules from CPAN"
@echo ""
@echo "All other goals are for the upstream developper"
@echo "make testf # run tests"
@echo "make testv # run tests verbosely"
@echo "make test_quick # few tests verbosely"
@ -92,6 +96,9 @@ install: testp imapsync.1
install imapsync.1 $(DESTDIR)$(PREFIX)/share/man/man1/imapsync.1
chmod 644 $(DESTDIR)$(PREFIX)/share/man/man1/imapsync.1
install_dependencies:
sh examples/install_modules_linux.sh
.PHONY: cidone ci
ci: cidone
@ -345,6 +352,7 @@ upload_lfo:
.valid.index.shtml: index.shtml
tidy -q index.shtml> /dev/null
validate --verbose index.shtml
touch .valid.index.shtml

7
README
View File

@ -4,7 +4,7 @@ NAME
More than 52 different IMAP server softwares supported with success, few
failures.
$Revision: 1.580 $
$Revision: 1.584 $
SYNOPSIS
To synchronize imap account "foo" on "imap.truc.org" to imap account
@ -383,7 +383,8 @@ IMAP SERVERS
- Samsung Contact IMAP server 8.5.0
- Scalix v10.1, 10.0.1.3, 11.0.0.431, 11.4.6
- Sendmail Mail Store IMAP4rev1 (5.5.6/mstore-5-5-build-1874 [host1].
- SmarterMail, Smarter Mail 5.0 Enterprise, Smarter Mail 5.5 [host1], SmarterMail Professional 10.2 [host1].
- SmarterMail, Smarter Mail 5.0 Enterprise, Smarter Mail 5.5 [host1],
SmarterMail Professional 10.2 [host1], Smarter Mail 11.7 [host1][host2].
- Softalk Workgroup Mail 7.6.4 [host1].
- 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
@ -471,5 +472,5 @@ SIMILAR SOFTWARES
Feedback (good or bad) will often be welcome.
$Id: imapsync,v 1.580 2013/12/25 02:52:36 gilles Exp gilles $
$Id: imapsync,v 1.584 2014/02/05 00:40:59 gilles Exp gilles $

View File

@ -1 +1 @@
1.580
1.584

View File

@ -1 +1 @@
1.580
1.584

View File

@ -263,3 +263,9 @@
1387941690 BEGIN 1.580 : mercredi 25 décembre 2013, 04:21:30 (UTC+0100)
1387967067 BEGIN 1.580 : mercredi 25 décembre 2013, 11:24:28 (UTC+0100)
1387967901 END 1.580 : mercredi 25 décembre 2013, 11:38:21 (UTC+0100)
1390615061 BEGIN 1.582 : samedi 25 janvier 2014, 02:57:41 (UTC+0100)
1390685504 END 1.582 : samedi 25 janvier 2014, 22:31:44 (UTC+0100)
1390874372 BEGIN 1.582 : mardi 28 janvier 2014, 02:59:33 (UTC+0100)
1390875240 END 1.582 : mardi 28 janvier 2014, 03:14:00 (UTC+0100)
1391561330 BEGIN 1.584 : mercredi 5 février 2014, 01:48:50 (UTC+0100)
1391562789 END 1.584 : mercredi 5 février 2014, 02:13:09 (UTC+0100)

Binary file not shown.

3
W/learn/imap_tcpdump Normal file
View File

@ -0,0 +1,3 @@
tcpdump -s0 -A -i lo port imap

10
W/learn/longline Executable file
View File

@ -0,0 +1,10 @@
#!/bin/sh
# Generate messages with line lenght of 10000 11000 ... up to 99000 characters
for M in `count 10 99`; do
echo $M
{ echo Hello Guys; echo ; perl -e "print 'L' x ${M}000" ; echo; echo END; } \
| mail.mailutils -s "line of ${M}000 char" tata@localhost.
done

12
W/learn/longline_10000_11000 Executable file
View File

@ -0,0 +1,12 @@
#!/bin/sh
# $Id: longline_10000_11000,v 1.2 2014/01/15 02:21:38 gilles Exp gilles $
# Test Exchange limit for maxlinelenght
# Generate messages with line lenght of 10000 10100 ... up to 10990 characters
for M in `count 10 99`; do
echo $M
{ echo Hello Guys; echo ; perl -e "print 'L' x 10${M}0" ; echo; echo END; } \
| mail.mailutils -s "line of 10${M}0 characters" tata@localhost.
done

View File

@ -28,7 +28,35 @@ Europe a un autre assujetti : Article 262 ter => Exoneration
EOF
}
echo paypal_bilan_bncexport2
echo paypal_bilan_tva_taux_20
paypal_bilan_tva_taux_20() {
# DID output diff between paypal_bilan_1.70 and 1.71
(
#set -x
perl -c /g/public_html/imapsync/W/paypal_reply/paypal_bilan || return 1
/g/public_html/imapsync/W/paypal_reply/paypal_bilan_1.70 --bnc --debug --details --debug_invoice --first_in 147 \
--avoid_numbers '292 293 643 644 731 732 1093
1330 1331 1332 1333 1334 1652 1653 2131 2132 2295 2296 2297 2298
2625 2626 2970 2971 2972 3093' \
/g/paypal/paypal_201[01234]_??_complet.csv \
> /g/var/paypal_bilan/tests/paypal_invoice.out1 2>&1
/g/public_html/imapsync/W/paypal_reply/paypal_bilan --bnc --debug --details --debug_invoice --first_in 147 \
--avoid_numbers '292 293 643 644 731 732 1093
1330 1331 1332 1333 1334 1652 1653 2131 2132 2295 2296 2297 2298
2625 2626 2970 2971 2972 3093' \
/g/paypal/paypal_201[01234]_??_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_bncexport2
paypal_bilan_bncexport2() {
# DID output diff between paypal_bilan_1.66 and 1.67
(
@ -54,7 +82,7 @@ echo diff /g/var/paypal_bilan/tests/paypal_invoice.out1 /g/var/paypal_bilan/test
}
echo paypal_bilan_bncexport
#echo paypal_bilan_bncexport
paypal_bilan_bncexport() {
# DID output diff between paypal_bilan_1.66 and 1.67
(

View File

@ -1,6 +1,6 @@
#!/usr/bin/perl
# $Id: paypal_bilan,v 1.68 2013/06/07 06:59:41 gilles Exp gilles $
# $Id: paypal_bilan,v 1.72 2014/01/18 01:38:35 gilles Exp gilles $
use strict;
use warnings;
@ -13,7 +13,7 @@ use Test::More 'no_plan' ;
die unless (utf8_supported_charset('ISO-8859-1'));
my $rcs = '$Id: paypal_bilan,v 1.68 2013/06/07 06:59:41 gilles Exp gilles $ ' ;
my $rcs = '$Id: paypal_bilan,v 1.72 2014/01/18 01:38:35 gilles Exp gilles $ ' ;
$rcs =~ m/,v (\d+\.\d+)/ ;
my $VERSION = ($1) ? $1: "UNKNOWN" ;
@ -140,7 +140,7 @@ foreach my $invoice ( @invoices_wanted ) {
if ( $invoice_sent ) {
$invoice_sent{ $invoice }++ ;
#build_invoice( $invoice ) ;
build_invoice( $invoice ) if ( $debug_invoice or $debug_invoice_utf8 ) ;
}elsif( not ( $invoice_canceled{ $invoice } or $invoice_refund{ $invoice } ) ) {
$invoice_not_sent{ $invoice }++ ;
build_invoice( $invoice ) ;
@ -371,10 +371,11 @@ sub tests_exportbnc {
sub tests {
tests_next_invoice( ) ;
#tests_half( ) ;
tests_cut( ) ;
tests_invoice_00000( ) ;
tests_exportbnc( ) ;
#tests_exportbnc( ) ;
tests_tva_rate( ) ;
tests_tva_rate_str( ) ;
}
sub compute_line {
@ -677,7 +678,7 @@ sub build_invoice {
$priceTTCusd,
$HTorTTC
)
= tva_stuff( $clientTypeEN, $Pays, $Hors_taxe, $Devise, $Titre_de_l_objet ) ;
= tva_stuff( $clientTypeEN, $Pays, $Hors_taxe, $Devise, $Titre_de_l_objet, $Date ) ;
my $object_type = object_type( $Titre_de_l_objet ) ;
@ -1058,6 +1059,62 @@ sub date_aaaa_mm_jj {
}
sub tva_rate {
my $date_aaaa_mm_jj = shift ;
if ( '2014_01_01' gt $date_aaaa_mm_jj ) {
#print "tva_rate 0.196\n" ;
#return( 0 ) ;
return( 0.196 ) ;
}
if ( '2014_01_01' le $date_aaaa_mm_jj ) {
#print "tva_rate 0.2\n" ;
return( 0.2 ) ;
}
#print "tva_rate 0\n" ;
return( 0 ) ;
}
sub tests_tva_rate {
ok( 0.196 == tva_rate( '2013_01_01' ), 'tva_rate: old 0.196' ) ;
ok( 0.196 == tva_rate( '2013_12_31' ), 'tva_rate: old 0.196' ) ;
ok( 0.2 == tva_rate( '2014_01_01' ), 'tva_rate: new 0.2' ) ;
ok( 0.2 == tva_rate( '2014_12_31' ), 'tva_rate: new 0.2' ) ;
ok( 0.2 == tva_rate( '2050_01_01' ), 'tva_rate: new 0.2' ) ;
ok( 0.2 == tva_rate( '2050_12_31' ), 'tva_rate: new 0.2' ) ;
return( 0 ) ;
}
sub tva_rate_str {
my $date_aaaa_mm_jj = shift ;
if ( '2014_01_01' gt $date_aaaa_mm_jj ) {
#print "tva_rate 0.196\n" ;
return( '19,60\%' ) ;
}
if ( '2014_01_01' le $date_aaaa_mm_jj ) {
return( '20\%' ) ;
}
#print "tva_rate 0\n" ;
return( '' ) ;
}
sub tests_tva_rate_str {
ok( '19,60\%' eq tva_rate_str( '2013_01_01' ), 'tva_rate_str: old 0.196' ) ;
ok( '19,60\%' eq tva_rate_str( '2013_12_31' ), 'tva_rate_str: old 0.196' ) ;
ok( '20,00\%' eq tva_rate_str( '2014_01_01' ), 'tva_rate_str: new 0.2' ) ;
ok( '20,00\%' eq tva_rate_str( '2014_12_31' ), 'tva_rate_str: new 0.2' ) ;
ok( '20,00\%' eq tva_rate_str( '2050_01_01' ), 'tva_rate_str: new 0.2' ) ;
ok( '20,00\%' eq tva_rate_str( '2050_12_31' ), 'tva_rate_str: new 0.2' ) ;
return( 0 ) ;
}
sub tva_line {
my( $Devise, $Montant2, $Pays, $Nom_Option_1, $Valeur_Option_1, $Titre_de_l_objet, $Date ) = @_ ;
my( $montant_HT_EUR_exo, $montant_HT_EUR_ass, $montant_TVA_EUR ) = ( 0, 0, 0 ) ;
@ -1080,8 +1137,8 @@ sub tva_line {
or
( 'France' eq $Pays )
) {
$montant_HT_EUR_ass = $Montant2 / 1.196 ;
$montant_TVA_EUR = $Montant2 / 1.196 * 0.196 ;
$montant_HT_EUR_ass = $Montant2 / ( 1 + tva_rate( $date_aaaa_mm_jj ) ) ;
$montant_TVA_EUR = $Montant2 / ( 1 + tva_rate( $date_aaaa_mm_jj ) ) * tva_rate( $date_aaaa_mm_jj ) ;
$debug_dev and print "$Montant2 $Pays $Valeur_Option_1\n" ;
}else{
$montant_HT_EUR_exo = $Montant2 ;
@ -1096,8 +1153,8 @@ sub tva_line {
or
( '2013_02_19' gt $date_aaaa_mm_jj )
) {
$montant_HT_EUR_sup = $Montant2 / 1.196 ;
$montant_TVA_EUR_sup = $Montant2 / 1.196 * 0.196 ;
$montant_HT_EUR_sup = $Montant2 / ( 1 + tva_rate( $date_aaaa_mm_jj ) ) ;
$montant_TVA_EUR_sup = $Montant2 / ( 1 + tva_rate( $date_aaaa_mm_jj ) ) * tva_rate( $date_aaaa_mm_jj ) ;
}else{
$montant_HT_EUR_sup_exo = $Montant2 ;
}
@ -1109,10 +1166,12 @@ sub tva_line {
sub tva_stuff {
my( $clientTypeEN, $Pays, $Hors_taxe, $Devise, $Titre_de_l_objet ) = @_ ;
my( $clientTypeEN, $Pays, $Hors_taxe, $Devise, $Titre_de_l_objet, $Date ) = @_ ;
my $priceTTCusd = '' ;
$Hors_taxe =~ s{,}{.} ;
my $date_aaaa_mm_jj = date_aaaa_mm_jj( $Date ) ;
if ( $Devise eq 'USD' ) {
$priceTTCusd = "(usd $Hors_taxe)" ;
@ -1134,10 +1193,10 @@ sub tva_stuff {
or
( 'France' eq $Pays )
) {
$priceHT = sprintf('%2.2f', $Hors_taxe/1.196) ;
$tvaFR = '19,60\%';
$tvaEN = '';
$priceTVA = sprintf('%2.2f', $Hors_taxe/1.196*0.196) ;
$priceHT = sprintf('%2.2f', $Hors_taxe / ( 1 + tva_rate( $date_aaaa_mm_jj ) ) ) ;
$tvaFR = tva_rate_str( $date_aaaa_mm_jj ) ;
$tvaEN = '' ;
$priceTVA = sprintf('%2.2f', $Hors_taxe / ( 1 + tva_rate( $date_aaaa_mm_jj ) ) * tva_rate( $date_aaaa_mm_jj ) ) ;
$priceTTC = sprintf('%2.2f', $Hors_taxe) ;
$HTorTTC = 'TTC' ;
$messageTVAFR = '' ;
@ -1246,19 +1305,6 @@ $addr = "
}
sub half {
my $string = shift ;
my $half = int( lenght( $string ) / 2 ) ;
# TO BE DONE
}
sub tests_half {
my( $aa, $bb ) = half( 'aa bb' ) ;
ok( 'aa' eq $aa, 'half: aa' ) ;
ok( 'bb' eq $bb, 'half: bb' ) ;
}
sub cut {
my $string = shift ;
my $offset = shift ;

View File

@ -1,6 +1,6 @@
#!/usr/bin/perl
# $Id: paypal_bilan,v 1.66 2013/03/26 19:50:20 gilles Exp gilles $
# $Id: paypal_bilan,v 1.70 2014/01/17 15:27:11 gilles Exp gilles $
use strict;
use warnings;
@ -13,7 +13,7 @@ use Test::More 'no_plan' ;
die unless (utf8_supported_charset('ISO-8859-1'));
my $rcs = '$Id: paypal_bilan,v 1.66 2013/03/26 19:50:20 gilles Exp gilles $ ' ;
my $rcs = '$Id: paypal_bilan,v 1.70 2014/01/17 15:27:11 gilles Exp gilles $ ' ;
$rcs =~ m/,v (\d+\.\d+)/ ;
my $VERSION = ($1) ? $1: "UNKNOWN" ;
@ -87,10 +87,9 @@ if ( $tests ) {
my @files = @ARGV ;
my %action_of_invoice ;
my %action_invoice ;
my %invoice_paypal ;
#$invoice_paypal{ $first_invoice } = 1 ;
my @invoices_wanted = split( /\s+/, $invoices ) if $invoices ;
@ -100,41 +99,24 @@ my %avoid_numbers ;
#print "@invoices\n" ;
my @actions ;
foreach my $file ( @files ) {
my @actions = parse_file( $file ) ;
foreach my $action (@actions) {
my %action = %$action ;
#print $action->{ Nom }, "\n" ;
my( $Date, $Heure, $Fuseau_horaire, $Nom, $Type, $Etat,
$Devise, $Montant, $Numero_davis_de_reception, $Solde,
$Pays, $Nom_Option_1, $Valeur_Option_1, $Hors_taxe, $Titre_de_l_objet, $Nom_Option_2, $Option_2_Valeur,
$Impact_sur_le_solde )
= @action{ ( 'Date', 'Heure', 'Fuseau horaire', 'Nom', 'Type', 'Etat',
'Devise', 'Montant', "Numéro d'avis de réception", 'Solde',
'Pays', 'Nom Option 1', 'Valeur Option 1', 'Hors taxe', "Titre de l'objet", 'Nom Option 2', 'Option 2 Valeur',
'Impact sur le solde') } ;
#print "[$Option_2_Valeur] [$Impact_sur_le_solde]\n" ;
#next;
( $Etat ) = @action{ ( 'Etat' ) } || @action{ ( 'État' ) } ;
( $Hors_taxe ) = @action{ ( 'Hors taxe' ) } || @action{ ( 'Avant commission' ) } ;
$Impact_sur_le_solde ||= '' ;
my $invoice = 'NONE' ;
$Montant = $action->{ 'Net' } if not defined $Montant;
# compute_line() adds $action->{ 'invoice' } if needed
compute_line( $action, $invoice, $Date, $Heure, $Fuseau_horaire, $Nom, $Type, $Etat,
$Devise, $Montant, $Numero_davis_de_reception, $Solde,
$Pays, $Nom_Option_1, $Valeur_Option_1, $Hors_taxe, $Titre_de_l_objet,
$Impact_sur_le_solde ) ;
# index by invoice number
$action_of_invoice{ $action->{ 'invoice' } } = $action ;
}
delete $action_of_invoice{ 'NONE' } ;
my @actions_file = parse_file( $file ) ;
push( @actions, @actions_file ) ;
}
foreach my $action (@actions) {
# compute_line() adds $action->{ 'invoice' } if needed
compute_line( $action ) ;
# index by invoice number
$action_invoice{ $action->{ 'invoice' } } = $action ;
}
delete $action_invoice{ 'NONE' } ;
my $last_invoice ;
my @invoice_paypal = sort { $a <=> $b } keys %invoice_paypal ;
$last_invoice = $invoice_paypal[-1] || 0 ;
@ -149,7 +131,7 @@ my %invoice_not_sent ;
foreach my $invoice ( @invoices_wanted ) {
my $action = $action_of_invoice{ $invoice } ;
my $action = $action_invoice{ $invoice } ;
next if ! $action ;
my $email_address = $action->{ "De l'adresse email" } ;
@ -158,7 +140,7 @@ foreach my $invoice ( @invoices_wanted ) {
if ( $invoice_sent ) {
$invoice_sent{ $invoice }++ ;
#build_invoice( $invoice ) ;
build_invoice( $invoice ) if ( $debug_invoice or $debug_invoice_utf8 ) ;
}elsif( not ( $invoice_canceled{ $invoice } or $invoice_refund{ $invoice } ) ) {
$invoice_not_sent{ $invoice }++ ;
build_invoice( $invoice ) ;
@ -385,18 +367,38 @@ sub tests_exportbnc {
}
sub tests {
tests_next_invoice( ) ;
#tests_half( ) ;
tests_cut( ) ;
tests_invoice_00000( ) ;
tests_exportbnc( ) ;
#tests_exportbnc( ) ;
tests_tva_rate( ) ;
}
sub compute_line {
my( $action, $invoice, $Date, $Heure, $Fuseau_horaire, $Nom, $Type, $Etat,
$Devise, $Montant, $Numero_davis_de_reception, $Solde,
$Pays, $Nom_Option_1, $Valeur_Option_1, $Hors_taxe_paypal, $Titre_de_l_objet, $Impact_sur_le_solde ) = @_ ;
my $action = shift ;
my %action = %$action ;
my( $Date, $Heure, $Fuseau_horaire, $Nom, $Type, $Etat,
$Devise, $Montant, $Numero_davis_de_reception, $Solde,
$Pays, $Nom_Option_1, $Valeur_Option_1, $Hors_taxe_paypal, $Titre_de_l_objet, $Nom_Option_2, $Option_2_Valeur,
$Impact_sur_le_solde )
= @action{ ( 'Date', 'Heure', 'Fuseau horaire', 'Nom', 'Type', 'Etat',
'Devise', 'Montant', "Numéro d'avis de réception", 'Solde',
'Pays', 'Nom Option 1', 'Valeur Option 1', 'Hors taxe', "Titre de l'objet", 'Nom Option 2', 'Option 2 Valeur',
'Impact sur le solde') } ;
#print "[$Option_2_Valeur] [$Impact_sur_le_solde]\n" ;
#next;
( $Etat ) = @action{ ( 'Etat' ) } || @action{ ( 'État' ) } ;
( $Hors_taxe_paypal ) = @action{ ( 'Hors taxe' ) } || @action{ ( 'Avant commission' ) } ;
$Impact_sur_le_solde ||= '' ;
my $invoice = 'NONE' ;
$Montant = $action->{ 'Net' } if not defined $Montant;
$debug and print( "#" x 78, "\n",
"[$Date] [$Heure] [$Fuseau_horaire] [$Nom] [$Type] [$Etat] ",
@ -437,7 +439,7 @@ sub compute_line {
$total_HT_EUR_exo += $montant_HT_EUR_exo ;
$total_HT_EUR_ass += $montant_HT_EUR_ass ;
$total_TVA_EUR += $montant_TVA_EUR ;
#$invoice = $first_invoice + $nb_invoice ;
$invoice = next_invoice( ) ;
$nb_invoice++ ;
$print_details and print ( "[$invoice] [$Date] [$Heure] [$Fuseau_horaire] [$Nom] [$Type] [$Etat] [$Devise] [$Montant] [$Numero_davis_de_reception] [$Solde] [$Impact_sur_le_solde]\n" ) ;
@ -465,8 +467,6 @@ sub compute_line {
$total_TVA_EUR_sup += $montant_TVA_EUR_sup ;
$total_HT_EUR_sup_exo += $montant_HT_EUR_sup_exo ;
#$invoice = $first_invoice + $nb_invoice ;
$invoice = next_invoice( ) ;
$nb_invoice++ ;
$print_details and print ( "[$invoice] [$Date] [$Heure] [$Fuseau_horaire] [$Nom] [$Type] [$Etat] [$Devise] [$Montant] [$Numero_davis_de_reception] [$Solde] [$Impact_sur_le_solde]\n" ) ;
@ -576,7 +576,7 @@ sub build_invoice {
return if ! $invoice ;
my $action = $action_of_invoice{ $invoice } ;
my $action = $action_invoice{ $invoice } ;
my $refund = '' ;
$refund = 'REFUND ' if $invoice_refund{ $invoice } ;
my %action = %$action if $action ;
@ -677,7 +677,7 @@ sub build_invoice {
$priceTTCusd,
$HTorTTC
)
= tva_stuff( $clientTypeEN, $Pays, $Hors_taxe, $Devise, $Titre_de_l_objet ) ;
= tva_stuff( $clientTypeEN, $Pays, $Hors_taxe, $Devise, $Titre_de_l_objet, $Date ) ;
my $object_type = object_type( $Titre_de_l_objet ) ;
@ -813,6 +813,9 @@ Hello $name,
First of all, I'm sorry for the delay in getting back to you.
Last imapsync release is available from the page
http://imapsync.lamiral.info/paypal_return.shtml
You'll find in the attachment the invoice of imapsync
software you bought and paid (dd/mm/yyyy $date).
The invoice file is named facture_imapsync-${invoice}.pdf
@ -851,6 +854,9 @@ Hello $name,
First of all, I'm sorry for the delay in getting back to you.
Last imapsync release is available from the page
http://imapsync.lamiral.info/paypal_return.shtml
You'll find in the attachment the invoice of imapsync
support you bought and paid (dd/mm/yyyy $date).
The invoice file is named facture_imapsync-${invoice}.pdf
@ -1052,6 +1058,34 @@ sub date_aaaa_mm_jj {
}
sub tva_rate {
my $date_aaaa_mm_jj = shift ;
if ( '2014_01_01' gt $date_aaaa_mm_jj ) {
#print "tva_rate 0.196\n" ;
#return( 0 ) ;
return( 0.196 ) ;
}
if ( '2014_01_01' le $date_aaaa_mm_jj ) {
#print "tva_rate 0.2\n" ;
return( 0.2 ) ;
}
#print "tva_rate 0\n" ;
return( 0 ) ;
}
sub tests_tva_rate {
ok( 0.196 == tva_rate( '2013_01_01' ), 'tva_rate: old 0.196' ) ;
ok( 0.196 == tva_rate( '2013_12_31' ), 'tva_rate: old 0.196' ) ;
ok( 0.2 == tva_rate( '2014_01_01' ), 'tva_rate: new 0.2' ) ;
ok( 0.2 == tva_rate( '2014_12_31' ), 'tva_rate: new 0.2' ) ;
ok( 0.2 == tva_rate( '2050_01_01' ), 'tva_rate: new 0.2' ) ;
ok( 0.2 == tva_rate( '2050_12_31' ), 'tva_rate: new 0.2' ) ;
return( 0 ) ;
}
sub tva_line {
my( $Devise, $Montant2, $Pays, $Nom_Option_1, $Valeur_Option_1, $Titre_de_l_objet, $Date ) = @_ ;
my( $montant_HT_EUR_exo, $montant_HT_EUR_ass, $montant_TVA_EUR ) = ( 0, 0, 0 ) ;
@ -1074,8 +1108,8 @@ sub tva_line {
or
( 'France' eq $Pays )
) {
$montant_HT_EUR_ass = $Montant2 / 1.196 ;
$montant_TVA_EUR = $Montant2 / 1.196 * 0.196 ;
$montant_HT_EUR_ass = $Montant2 / ( 1 + tva_rate( $date_aaaa_mm_jj ) ) ;
$montant_TVA_EUR = $Montant2 / ( 1 + tva_rate( $date_aaaa_mm_jj ) ) * tva_rate( $date_aaaa_mm_jj ) ;
$debug_dev and print "$Montant2 $Pays $Valeur_Option_1\n" ;
}else{
$montant_HT_EUR_exo = $Montant2 ;
@ -1090,8 +1124,8 @@ sub tva_line {
or
( '2013_02_19' gt $date_aaaa_mm_jj )
) {
$montant_HT_EUR_sup = $Montant2 / 1.196 ;
$montant_TVA_EUR_sup = $Montant2 / 1.196 * 0.196 ;
$montant_HT_EUR_sup = $Montant2 / ( 1 + tva_rate( $date_aaaa_mm_jj ) ) ;
$montant_TVA_EUR_sup = $Montant2 / ( 1 + tva_rate( $date_aaaa_mm_jj ) ) * tva_rate( $date_aaaa_mm_jj ) ;
}else{
$montant_HT_EUR_sup_exo = $Montant2 ;
}
@ -1103,10 +1137,12 @@ sub tva_line {
sub tva_stuff {
my( $clientTypeEN, $Pays, $Hors_taxe, $Devise, $Titre_de_l_objet ) = @_ ;
my( $clientTypeEN, $Pays, $Hors_taxe, $Devise, $Titre_de_l_objet, $Date ) = @_ ;
my $priceTTCusd = '' ;
$Hors_taxe =~ s{,}{.} ;
my $date_aaaa_mm_jj = date_aaaa_mm_jj( $Date ) ;
if ( $Devise eq 'USD' ) {
$priceTTCusd = "(usd $Hors_taxe)" ;
@ -1128,10 +1164,10 @@ sub tva_stuff {
or
( 'France' eq $Pays )
) {
$priceHT = sprintf('%2.2f', $Hors_taxe/1.196) ;
$priceHT = sprintf('%2.2f', $Hors_taxe / ( 1 + tva_rate( $date_aaaa_mm_jj ) ) ) ;
$tvaFR = '19,60\%';
$tvaEN = '';
$priceTVA = sprintf('%2.2f', $Hors_taxe/1.196*0.196) ;
$priceTVA = sprintf('%2.2f', $Hors_taxe / ( 1 + tva_rate( $date_aaaa_mm_jj ) ) * tva_rate( $date_aaaa_mm_jj ) ) ;
$priceTTC = sprintf('%2.2f', $Hors_taxe) ;
$HTorTTC = 'TTC' ;
$messageTVAFR = '' ;
@ -1240,19 +1276,6 @@ $addr = "
}
sub half {
my $string = shift ;
my $half = int( lenght( $string ) / 2 ) ;
# TO BE DONE
}
sub tests_half {
my( $aa, $bb ) = half( 'aa bb' ) ;
ok( 'aa' eq $aa, 'half: aa' ) ;
ok( 'bb' eq $bb, 'half: bb' ) ;
}
sub cut {
my $string = shift ;
my $offset = shift ;

View File

@ -1,6 +1,6 @@
#!/bin/sh
# $Id: paypal_build_invoices,v 1.60 2013/12/14 17:30:04 gilles Exp gilles $
# $Id: paypal_build_invoices,v 1.63 2014/01/18 01:26:53 gilles Exp gilles $
# usage: sh paypal_build_invoices /g/var/paypal_invoices/????
@ -44,7 +44,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 2820 /g/paypal/paypal_2013_09_complet.csv
#/g/public_html/imapsync/W/paypal_reply/paypal_bilan --write_invoices --first_in 2891 /g/paypal/paypal_2013_10_complet.csv
#/g/public_html/imapsync/W/paypal_reply/paypal_bilan --write_invoices --first_in 2973 /g/paypal/paypal_2013_11_complet.csv
/g/public_html/imapsync/W/paypal_reply/paypal_bilan --write_invoices --first_in 3040 /g/paypal/paypal_2013_12_complet.csv
#/g/public_html/imapsync/W/paypal_reply/paypal_bilan --write_invoices --first_in 3040 /g/paypal/paypal_2013_12_complet.csv
/g/public_html/imapsync/W/paypal_reply/paypal_bilan --write_invoices --first_in 3094 /g/paypal/paypal_2014_01_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 214 /g/paypal/paypal_2010_12_complet.csv
@ -82,22 +84,26 @@ 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 2741 /g/paypal/paypal_2013_08_complet.csv
: /g/public_html/imapsync/W/paypal_reply/paypal_bilan --first_in 2820 /g/paypal/paypal_2013_09_complet.csv
: /g/public_html/imapsync/W/paypal_reply/paypal_bilan --first_in 2891 /g/paypal/paypal_2013_10_complet.csv
set -x
: /g/public_html/imapsync/W/paypal_reply/paypal_bilan --first_in 2973 /g/paypal/paypal_2013_11_complet.csv
: /g/public_html/imapsync/W/paypal_reply/paypal_bilan --first_in 3040 /g/paypal/paypal_2013_12_complet.csv
set -x
: /g/public_html/imapsync/W/paypal_reply/paypal_bilan --first_in 3094 /g/paypal/paypal_2014_01_complet.csv
set +x
# La totale
: /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 2131 2132 2295 2296 2297 2298 2625 2626 2970 2971 2972' \
--first_in 147 --avoid_numbers '292 293 643 644 731 732 1093
1330 1331 1332 1333 1334 1652 1653 2131 2132 2295 2296 2297 2298
2625 2626 2970 2971 2972 3093' \
/g/paypal/paypal_201?_??_complet.csv
set -v
: /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 2131 2132 2295 2296 2297 2298 2625 2626 2970 2971 2972' \
--first_in 147 --avoid_numbers '292 293 643 644 731 732 1093
1330 1331 1332 1333 1334 1652 1653 2131 2132 2295 2296 2297 2298
2625 2626 2970 2971 2972 3093' \
/g/paypal/paypal_201?_??_complet.csv
set +v

View File

@ -0,0 +1,10 @@
#!/bin/sh
# imapsync example shell for Unix users
# lines beginning with # are just comments
# Replace imap.foo.org toto secretoto 192.168.42.4 titi secretiti with your own values
./imapsync --host1 imap.foo.org --user1 toto --password1 "secretoto" \
--host2 192.168.42.4 --user2 titi --password2 "secretiti"

205
imapsync
View File

@ -22,7 +22,7 @@ Synchronises mailboxes between two imap servers.
Good at IMAP migration. More than 52 different IMAP server softwares
supported with success, few failures.
$Revision: 1.580 $
$Revision: 1.584 $
=head1 SYNOPSIS
@ -433,7 +433,8 @@ Success stories reported with the following 57 imap servers
- Samsung Contact IMAP server 8.5.0
- Scalix v10.1, 10.0.1.3, 11.0.0.431, 11.4.6
- Sendmail Mail Store IMAP4rev1 (5.5.6/mstore-5-5-build-1874 [host1].
- SmarterMail, Smarter Mail 5.0 Enterprise, Smarter Mail 5.5 [host1], SmarterMail Professional 10.2 [host1].
- SmarterMail, Smarter Mail 5.0 Enterprise, Smarter Mail 5.5 [host1],
SmarterMail Professional 10.2 [host1], Smarter Mail 11.7 [host1][host2].
- Softalk Workgroup Mail 7.6.4 [host1].
- 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
@ -541,7 +542,7 @@ Entries for imapsync:
Feedback (good or bad) will often be welcome.
$Id: imapsync,v 1.580 2013/12/25 02:52:36 gilles Exp gilles $
$Id: imapsync,v 1.584 2014/02/05 00:40:59 gilles Exp gilles $
=cut
@ -581,7 +582,7 @@ use IPC::Open3 'open3' ;
my(
$rcs, $pidfile, $pidfilelocking,
$debug, $debugimap, $debugimap1, $debugimap2, $debugcontent, $debugflags,
$debugLIST, $debugsleep, $debugdev, $debugmemory,
$debugLIST, $debugsleep, $debugdev, $debugmemory, $debugmaxlinelength,
$nb_errors,
$host1, $host2, $port1, $port2,
$user1, $user2, $domain1, $domain2,
@ -664,6 +665,7 @@ my(
$messageidnodomain,
$fixInboxINBOX,
$maxlinelength,
$minmaxlinelength,
$uidnext_default,
$fixcolonbug,
$create_folder_old,
@ -676,7 +678,7 @@ my(
# global variables initialisation
$rcs = '$Id: imapsync,v 1.580 2013/12/25 02:52:36 gilles Exp gilles $ ';
$rcs = '$Id: imapsync,v 1.584 2014/02/05 00:40:59 gilles Exp gilles $ ';
$total_bytes_transferred = 0;
$total_bytes_skipped = 0;
@ -1029,8 +1031,11 @@ print "Host1 capability: ", join(" ", @{ $imap1->capability_update() || [] }), "
print "Host2 capability: ", join(" ", @{ $imap2->capability_update() || [] }), "\n";
exit_clean(0) if ($justlogin);
if ( $justlogin ) {
$imap1->logout( ) ;
$imap2->logout( ) ;
exit_clean( 0 ) ;
}
#
# Folder stuff
#
@ -1130,17 +1135,17 @@ $checkselectable and do {
my($h1_sep,$h2_sep);
# what are the private folders separators for each server ?
$debug and print "Getting separators\n";
$h1_sep = get_separator($imap1, $sep1, "--sep1");
$h2_sep = get_separator($imap2, $sep2, "--sep2");
$debug and print "Getting separators\n" ;
$h1_sep = get_separator( $imap1, $sep1, "--sep1", "Host1" ) ;
$h2_sep = get_separator( $imap2, $sep2, "--sep2", "Host2" ) ;
my($h1_prefix,$h2_prefix);
$h1_prefix = get_prefix($imap1, $prefix1, "--prefix1");
$h2_prefix = get_prefix($imap2, $prefix2, "--prefix2");
my( $h1_prefix, $h2_prefix ) ;
$h1_prefix = get_prefix( $imap1, $prefix1, "--prefix1", "Host1" ) ;
$h2_prefix = get_prefix( $imap2, $prefix2, "--prefix2", "Host2" ) ;
print "Host1 separator and prefix: [$h1_sep][$h1_prefix]\n";
print "Host2 separator and prefix: [$h2_sep][$h2_prefix]\n";
print "Host1 separator and prefix: [$h1_sep][$h1_prefix]\n" ;
print "Host2 separator and prefix: [$h2_sep][$h2_prefix]\n" ;
#my $h1_xlist_folders = $imap1->xlist_folders( ) ;
#my $h2_xlist_folders = $imap2->xlist_folders( ) ;
@ -1991,11 +1996,14 @@ sub connect_imap {
$imap->Debug($mydebugimap);
$imap->connect()
or die_clean("Can not open imap connection on [$host]: $@\n");
#myconnect($imap)
# or die_clean("Can not open imap connection on [$host]: $@\n");
my $banner = $imap->Results()->[0] ;
$imap->Banner( $banner ) ;
$imap->starttls( ) if ( $imap->Tls( ) ) ;
if ( $imap->Tls( ) ) {
$imap->starttls( )
or die_clean("Can not go to tls encryption on [$host]:", $imap->LastError, "\n" ) ;
}
return( $imap ) ;
}
@ -2083,7 +2091,10 @@ sub login_imap {
}
}
$imap->starttls( ) if ( $imap->Tls( ) ) ;
if ( $imap->Tls( ) ) {
$imap->starttls( )
or die_clean("Can not go to tls encryption on [$host]:", $imap->LastError, "\n" ) ;
}
authenticate_imap( $imap, @allargs ) ;
@ -2173,12 +2184,13 @@ sub set_ssl {
#
$SSL_version = $SSL_version || '' ;
#print "[$SSL_version]\n" ;
IO::Socket::SSL::set_ctx_defaults(
my $sslargs = [
SSL_verify_mode => 'SSL_VERIFY_PEER',
SSL_verifycn_scheme => 'imap',
SSL_version => $SSL_version,
) ;
$imap->Ssl( $ssl ) ;
] ;
$imap->Ssl( $sslargs ) ;
return( ) ;
}
@ -2307,8 +2319,8 @@ sub banner_imapsync {
my @argv = @_ ;
my $banner_imapsync = join("",
'$RCSfile: imapsync,v $ ',
'$Revision: 1.580 $ ',
'$Date: 2013/12/25 02:52:36 $ ',
'$Revision: 1.584 $ ',
'$Date: 2014/02/05 00:40:59 $ ',
"\n",localhost_info(), "\n",
"Command line used:\n",
"$0 ", command_line_nopassword( @argv ), "\n",
@ -2680,59 +2692,86 @@ sub tests_compare_lists {
sub get_prefix {
my( $imap, $prefix_in, $prefix_opt ) = @_ ;
sub get_prefix {
my( $imap, $prefix_in, $prefix_opt, $Side ) = @_ ;
my( $prefix_out ) ;
$debug and print "Getting prefix namespace\n" ;
if ( defined( $prefix_in ) ) {
print "Using [$prefix_in] given by $prefix_opt\n" ;
$prefix_out = $prefix_in ;
return( $prefix_out ) ;
}
$debug and print "Calling namespace capability\n" ;
$debug and print "$Side: Getting prefix\n" ;
$debug and print "$Side: Calling namespace capability\n" ;
if ( $imap->has_capability( "namespace" ) ) {
my $r_namespace = $imap->namespace( ) ;
$prefix_out = $r_namespace->[0][0][0] ;
return($prefix_out) ;
print "$Side: prefix given by NAMESPACE: [$prefix_out]\n" ;
if ( defined( $prefix_in ) ) {
print "$Side: but using [$prefix_in] given by $prefix_opt\n" ;
$prefix_out = $prefix_in ;
return( $prefix_out ) ;
}else{
# all good
return( $prefix_out ) ;
}
}
else{
print
"No NAMESPACE capability in imap server ",
$imap->Server( ),"\n",
help_to_guess_prefix( $imap, $prefix_opt ) ;
exit_clean( 1 ) ;
if ( defined( $prefix_in ) ) {
print "$Side: using [$prefix_in] given by $prefix_opt\n" ;
$prefix_out = $prefix_in ;
return( $prefix_out ) ;
}else{
print
"$Side: No NAMESPACE capability in imap server ",
$imap->Server( ),"\n",
help_to_guess_prefix( $imap, $prefix_opt ) ;
exit_clean( 1 ) ;
}
}
return( ) ;
}
sub get_separator {
my($imap, $sep_in, $sep_opt) = @_;
my($sep_out);
sub get_separator {
my( $imap, $sep_in, $sep_opt, $Side ) = @_ ;
my( $sep_out ) ;
if ( defined( $sep_in ) ) {
print "Using [$sep_in] given by $sep_opt\n" ;
$sep_out = $sep_in ;
return( $sep_out ) ;
}
$debug and print "Calling namespace capability\n" ;
if ($imap->has_capability( "namespace" ) ) {
$debug and print "$Side: calling namespace capability\n" ;
if ( $imap->has_capability( "namespace" ) ) {
$sep_out = $imap->separator( ) ;
return($sep_out) if defined $sep_out ;
print
"NAMESPACE request failed for ",
$imap->Server(), ": ", $imap->LastError, "\n",
help_to_guess_sep( $imap, $sep_opt ) ;
exit_clean( 1 ) ;
if ( defined( $sep_out ) ) {
print "$Side: separator given by NAMESPACE: [$sep_out]\n" ;
if ( defined( $sep_in ) ) {
print "$Side: but using [$sep_in] given by $sep_opt\n" ;
$sep_out = $sep_in ;
return( $sep_out ) ;
}else{
return( $sep_out ) ;
}
}else{
if ( defined( $sep_in ) ) {
print "$Side: NAMESPACE request failed but using [$sep_in] given by $sep_opt\n" ;
$sep_out = $sep_in ;
return( $sep_out ) ;
}else{
print
"$Side: NAMESPACE request failed for ",
$imap->Server(), ": ", $imap->LastError, "\n",
help_to_guess_sep( $imap, $sep_opt ) ;
exit_clean( 1 ) ;
}
}
}
else{
print
"No NAMESPACE capability in imap server ",
$imap->Server(),"\n",
help_to_guess_sep( $imap, $sep_opt ) ;
exit_clean( 1 ) ;
if ( defined( $sep_in ) ) {
print "$Side: No NAMESPACE capability but using [$sep_in] given by $sep_opt\n" ;
$sep_out = $sep_in ;
return( $sep_out ) ;
}else{
print
"$Side: No NAMESPACE capability in imap server ",
$imap->Server(),"\n",
help_to_guess_sep( $imap, $sep_opt ) ;
exit_clean( 1 ) ;
}
}
return( ) ;
}
@ -2941,7 +2980,8 @@ sub foldersizes {
$nb_errors++ ;
next ;
}
last if $imap->IsUnconnected() ;
my $hash_ref = { } ;
my @msgs = select_msgs( $imap, undef, $search_cmd, $folder ) ;
$nb_msgs = scalar( @msgs ) ;
@ -3474,6 +3514,8 @@ sub copy_message {
if ( size_filtered( $h1_size, $h1_msg, $h1_fold, $h2_fold ) ) {
$total_bytes_skipped += $h1_size;
$nb_msg_skipped += 1;
$h1_nb_msg_processed +=1 ;
return( ) ;
}
@ -3483,6 +3525,8 @@ sub copy_message {
if ( $checkmessageexists and not message_exists( $imap1, $h1_msg ) ) {
$total_bytes_skipped += $h1_size;
$nb_msg_skipped += 1;
$h1_nb_msg_processed +=1 ;
return( ) ;
}
@ -3492,17 +3536,34 @@ sub copy_message {
if ( not defined( $string ) and not defined( $string_len ) ) {
print "- msg $h1_fold/$h1_msg skipped. Could not be fetched\n" ;
$total_bytes_skipped += $h1_size;
$nb_msg_skipped += 1;
$h1_nb_msg_processed +=1 ;
return( ) ;
}
# Lines two long => do no copy
if ( ( defined ( $maxlinelength ) )
and ( max_line_length( $string ) > $maxlinelength ) ) {
my $subject = subject( $string ) ;
#print "[$subject]\n" ;
print "- msg $h1_fold/$h1_msg skipped S[$h1_size] F[$h1_flags] I[$h1_idate] "
. "(Subject:[$subject]) (line length exceeds maxlinelength $maxlinelength bytes)\n" ;
return( ) ;
if ( defined ( $maxlinelength ) or defined ( $minmaxlinelength ) ) {
my $maxlinelength_string = max_line_length( $string ) ;
$debugmaxlinelength and print "msg $h1_fold/$h1_msg maxlinelength: $maxlinelength_string\n" ;
if ( defined ( $maxlinelength ) and ( $maxlinelength_string > $maxlinelength ) ) {
my $subject = subject( $string ) ;
print "- msg $h1_fold/$h1_msg skipped S[$h1_size] F[$h1_flags] I[$h1_idate] "
. "(Subject:[$subject]) (line length exceeds maxlinelength $maxlinelength bytes)\n" ;
$h1_nb_msg_processed +=1 ;
$total_bytes_skipped += $h1_size;
$nb_msg_skipped += 1;
return( ) ;
}
if ( defined ( $minmaxlinelength ) and ( $maxlinelength_string <= $minmaxlinelength ) ) {
my $subject = subject( $string ) ;
$debugdev and print "- msg $h1_fold/$h1_msg skipped S[$h1_size] F[$h1_flags] I[$h1_idate] "
. "(Subject:[$subject]) (max line length under minmaxlinelength $minmaxlinelength bytes)\n" ;
$h1_nb_msg_processed +=1 ;
$total_bytes_skipped += $h1_size;
$nb_msg_skipped += 1;
return( ) ;
}
}
my $h1_date = date_for_host2( $h1_msg, $h1_idate ) ;
@ -3530,6 +3591,8 @@ sub copy_message {
return( $new_id ) ;
}
sub message_for_host2 {
my ( $h1_msg, $h1_fold, $h1_size, $h1_flags, $h1_idate, $h1_fir_ref ) = @_ ;
@ -4945,7 +5008,7 @@ sub check_last_release {
}
sub imapsync_version {
my $rcs_imapsync = '$Id: imapsync,v 1.580 2013/12/25 02:52:36 gilles Exp gilles $ ' ;
my $rcs_imapsync = '$Id: imapsync,v 1.584 2014/02/05 00:40:59 gilles Exp gilles $ ' ;
my $imapsync_version ;
if ( $rcs_imapsync =~ m{,v\s+(\d+\.\d+)}xo ) {
@ -5846,7 +5909,7 @@ Several options are mandatory.
--exitwhenover <int> : Stop syncing when total bytes transferred reached.
Gmail per day allows 2500000000 down 500000000 upload.
--maxlinelength <int> : skip messages with line length longer than <int> bytes.
--maxlinelength <int> : skip messages with a line length longer than <int> bytes.
RFC 2822 says it must be no more than 1000 bytes.
--useheader <string> : Use this header to compare messages on both sides.
@ -5958,6 +6021,7 @@ sub get_options {
"debugimap2!" => \$debugimap2,
"debugdev!" => \$debugdev,
"debugmemory!" => \$debugmemory,
"debugmaxlinelength!" => \$debugmaxlinelength,
"host1=s" => \$host1,
"host2=s" => \$host2,
"port1=i" => \$port1,
@ -6075,6 +6139,7 @@ sub get_options {
"abletosearch!" => \$abletosearch,
"showpasswords!" => \$showpasswords,
"maxlinelength=i" => \$maxlinelength,
"minmaxlinelength=i" => \$minmaxlinelength,
"fixcolonbug!" => \$fixcolonbug,
"create_folder_old!" => \$create_folder_old,
"maxmessagespersecond=f" => \$maxmessagespersecond,

67
imapsync_by_country.txt Normal file
View File

@ -0,0 +1,67 @@
832 Etats-Unis d'Amérique
527 Allemagne
263 Royaume-Uni
145 Canada
143 France
137 Italie
118 Suisse
101 Australie
83 Pays-Bas
57 Autriche
53 Belgique
48 Suède
48 Espagne
36 Danemark
28 Brésil
27 Norvège
27 Finlande
22 Japon
15 République tchèque
14 Russie
14 Nouvelle-Zélande
14 Irlande
14
12 Portugal
12 Pologne
12 Hong-Kong
10 Inde
10 Hongrie
10 Argentine
9 Singapour
9 Luxembourg
9 Chine
9 Afrique du Sud
8 Grèce
7 Slovaquie
7 Mexique
7 Malaisie
7 Israel
6 Slovénie
6 Chili
5 Lettonie
4 Islande
4 Indonésie
4 Emirats Arabes Unis
3 Venezuela
3 Turquie
3 Thaïlande
3 Roumanie
3 Philippines
3 Malte
3 Croatie
2 Uruguay
2 Estonie
2 Egypte
2 Costa Rica
2 Chypre
1 Vietnam
1 Ukraine
1 Taiwan
1 Qatar
1 Panama
1 Namibie
1 Maldives
1 Lituanie
1 Koweït
1 Colombie
1 Bahreïn

View File

@ -5,7 +5,7 @@
<title>Official imapsync migration tool ( release <!--#exec cmd="cat ./VERSION"--> )</title>
<meta name="generator" content="Bluefish 1.0.7"/>
<meta name="author" content="Gilles LAMIRAL"/>
<meta name="date" content="2013-12-25T12:16:53+0100"/>
<meta name="date" content="2014-02-13T03:57:24+0100"/>
<meta name="copyright" content="None"/>
<meta name="keywords" content="imap, transfert, migration"/>
<meta name="description" content="imap migration tool"/>
@ -81,33 +81,36 @@ for <b>bidirectionnal (2 ways) synchronizations</b>.
<p>Alternatives to imapsync are listed in the <a href="#similar"><b>Similar softwares</b></a> section.
</p>
<p>Imapsync used to be free, open and gratis, before november 2010.
<p>Imapsync used to be free, open and gratis, that was before november 2010.
Now imapsync is free, open and not gratis from the homepage.
It is the best decision I've done about imapsync to continue to maintain it.
Imapsync is still under the <a href="./NOLIMIT">NOLIMIT</a> license,
claiming no limit to do anything with this work and this license,
so one of the most open license of the universe.
It is the best decisions I've made about imapsync to continue to maintain it.
See detailed explanation and motivation here when
<a href="http://www.linux-france.org/prj/imapsync_list/msg00459.html">I looked for a business model</a>.
"Download and donate if happy" doesn't work well.
"Pay for download and I pay back if unhappy" works well.
"Pay for download and I pay back if unhappy" works well, a 100 times better.
</p>
<h2><a id="NUMBERS"></a>Facts and figures for 2011-2013</h2>
<h2><a id="NUMBERS"></a>Facts and figures for 2011-2014</h2>
<ul>
<li><b>4000 to 5000 </b>users per month (45000 users a year)</li>
<li><b>4000 to 5000 </b>users per month (48000 users a year).</li>
<li>6 to 25 millions mailboxes transfers per month.</li>
<li><b>158 millions</b> transfers for 2013, that is five whole mailboxes synced per second.</li>
<li><b>6 to 25 millions mailboxes transfers per month</b>,
total is 93 millions for 2011, 91 millions for 2012, should be <b>140 millions for end 2013</b></li>
<li><b>Operating systems</b> run by imapsync users:
<li><b>Operating systems</b> run by imapsync users (in 2013):
<ul>
<li><b>Linux: 72%</b></li>
<li><b>Win32: 13%</b></li>
<li><b>Linux: 70%</b></li>
<li><b>Win32: 14%</b></li>
<li><b>Darwin: 6%</b></li>
<li>FreeBSD: 8%</li>
<li>Solaris: 0.2%</li>
<li>FreeBSD: 10%</li>
<li>Solaris: 0.15%</li>
<li>OpenBSD: 0.02%</li>
<li>Other: 0.6%</li>
<li>Other: 0.46%</li>
</ul>
</li>
<li><b>Highest use rate</b>: about <b>21 millions</b> of IMAP mailbox transfers (in a single month)</li>
@ -115,8 +118,8 @@ total is 93 millions for 2011, 91 millions for 2012, should be <b>140 millions f
<p>
Where all those numbers come from?
To know wether a newer imapsync exists or not imapsync does a http GET to <a href="http://imapsync.lamiral.info/VERSION">VERSION</a>.
Via the <b>User-agent</b> parameter it also send:</p>
To know wether a newer imapsync exists or not imapsync does a http GET to the file <a href="http://imapsync.lamiral.info/VERSION">VERSION</a>.
Via the <b>User-agent</b> parameter it also sends:</p>
<ul>
<li>imapsync release</li>
@ -145,7 +148,7 @@ Via the <b>User-agent</b> parameter it also send:</p>
<!--
<ul>
<li><b>1.580</b></li>
<li><b>1.584</b></li>
<li><b>Enhancement</b>: </li>
<li><b>Enhancement</b>: </li>
<li><b>Enhancement</b>: </li>
@ -166,38 +169,33 @@ Via the <b>User-agent</b> parameter it also send:</p>
-->
<ul>
<li><b>1.580</b></li>
<li><b>Enhancement</b>: Added <b>--maxmessagespersecond</b> to limit messages tranfer rate and fix <b>office365 throttle limitation</b> (use --maxmessagespersecond 4).</li>
<li><b>Enhancement</b>: Added --maxbytespersecond to limit byte transfer rate.</li>
<li><b>Enhancement</b>: Added --folderfirst string: Sync this folder first. --folderfirst "Work" --folderfirst "Friends"</li>
<li><b>Enhancement</b>: Added --folderlast string: Sync this folder last. --folderlast "[Gmail]/All Mail" etc.</li>
<li><b>Enhancement</b>: Added <b>--skipcrossduplicates</b> to avoid copying messages that are already copied in another folder, good <b>from Gmail to X</b>.</li>
<li><b>Enhancement</b>: Added --debugcrossduplicates to print which messages (UIDs) are skipped with --skipcrossduplicates (and in what other folders they are).</li>
<li><b>Enhancement</b>: Added --debugmemory option that prints memory consumption after each message is copied.</li>
<li><b>Bug fix</b>: Create nested folders in the sense of their path, parent first. Thanks to Erik Torsner.</li>
<li><b>Bug fix</b>: Final statistics were avoided for newly created folders.</li>
<li><b>Bug fix</b>: Do not try to append message if the fetch failed.</li>
</ul>
<ul>
<li><b>1.569</b> Win32 --tmpdir "C:" bugfix</li>
<li><b>Bug fix</b>: On Win32 trailing blanc in cache dir name raized an error. Blanc is now moved to underscore _</li>
<li><b>Bug fix</b>: Fixed bug on Windows with for example --tmpdir "E:\TEMP". The colon was badly converted to _, ending with --tmpdir "E_\TEMP".
This fix also automatically moves the old cache to the new one if the new does not exist yet.</li>
</ul>
<ul>
<li><b>1.567</b> imapsync.exe crash fix</li>
<li><b>Enhancement</b>: Added --authmech EXTERNAL.</li>
<li><b>Bug fix</b>: Fixed a warning when RFC822.SIZE is null or undef.</li>
<li><b>Bug fix</b>: Fixed imapsync.exe crash with no error message when it exits on a error. Back to Perl 5.16</li>
<li><b>1.584</b></li>
<li><b>Enhancement</b>: Added --minmaxlinelength to select messages with long lines only.
It helps to diagnostic Echange error on messages with lines longer than 9000 characters</li>
<li><b>Enhancement</b>: Added --debugmaxlinelength</li>
<li><b>Bug fix</b>: --ssl1 --tls2 was buggy because of default SSL_VERIFY_PEER.
"Can not go to tls encryption on [localhost]:Unable to start TLS: Cannot determine peer hostname for verification..."</li>
<li><b>Bug fix</b>: Check if going to tls is ok, exit otherwise with explicit error message.
Thanks to Dennis Schridde for reporting this ugly bug that deserves a CVE.</li>
<li><b>Debug</b>: Print separator given by NAMESPACE even when --sep1 oe --sep2 is used.</li>
<li><b>Debug</b>: Prints prefix given by NAMESPACE even when --prefix1 or --prefix2 is used.
It is a preparation for advising not to use --prefix unless suggested.</li>
</ul>
<p><b>Good changed</b> made before, listed because <b>they can help</b>:
<p><b>Good changes</b> made before, listed because <b>they can help</b>:
</p>
<ul>
<li><b>Enhancement</b>: Added <b>--skipcrossduplicates</b> to avoid copying messages that are already copied in another folder, good <b>from Gmail to X</b>.</li>
<li><b>Enhancement</b>: Added --debugcrossduplicates to print which messages (UIDs) are skipped with --skipcrossduplicates (and in what other folders they are).</li>
<li><b>Enhancement</b>: Added --folderfirst string: sync this folder first. --folderfirst "Work" --folderfirst "Friends"</li>
<li><b>Enhancement</b>: Added --folderlast string: sync this folder last. --folderlast "[Gmail]/All Mail" etc.</li>
<li><b>Enhancement</b>: Added <b>--maxmessagespersecond</b> to limit messages tranfer rate and fix <b>Office365 throttle limitation</b> (use --maxmessagespersecond 4).</li>
<li><b>Enhancement</b>: Added --maxbytespersecond to limit byte transfer rate.</li>
<li><b>Enhancement</b>: Added --debugmemory option that prints memory consumption after each message is copied.</li>
<li><b>Enhancement</b>: Added --authmech EXTERNAL.</li>
<li><b>Enhancement</b>: Adapted behavior for allowing --maxdate --mindate with --noabletosearch.
Use internat date instead of Date: header.</li>
@ -299,13 +297,6 @@ by ignoring PERMANENTFLAGS (Exchange tests)</li>
</ul>
<!--
<p>The next imapsync release should see:</p>
<ul>
<li>nothing planned</li>
</ul>
-->
<h2><a id="DOC_BASIC"></a>Simple transfer on Windows</h2>
<p>
@ -346,6 +337,31 @@ example.
<!--
<h2><a id="buy_all"></a>Buy imapsync</h2>
<p>Buy complete and <b>latest imapsync</b> for <b>50 EUR</b> and optionnaly full professional support for <b>100 EUR</b>
</p>
<p>
For 50 EUR you will get:
<ul>
<li>Standalone <b>imapsync.exe</b> for win32, no installation needed.</li>
<li>imapsync Perl <b>source code</b>.</li>
<li><b>Lifetime</b> of imapsync <b>updates</b> without extra payment.</li>
<li><b>30 days money-back guarantee!</b>, any reason qualifies.</li>
</ul>
</p>
<p>
For 100 EUR more you will get imapsync <b>full support</b>
done by the imapsync designer and developper himself.
You will be able to expose your issues by email
or phone and then we'll work together until complete success.
</p>
-->
<h2><a id="buy_source"></a>Buy imapsync source code</h2>
<p>Buy <b>latest</b> imapsync Perl <b>source code</b> for <b>50 EUR</b>
@ -391,7 +407,7 @@ name="submit" alt="PayPal - The safer, easier way to pay online!"/>
</p>
</form>
<p>You will receive a <b>download link just after</b> the payment from gilles.lamiral@laposte.net (can fall in Spam folder sometimes).<br/>
<p>You will receive a <b>download link just after</b> the payment from <b>gilles.lamiral@laposte.net</b> (can fall in Spam folder sometimes).<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), since reedit is not easy (and forbidden by law).
@ -440,7 +456,7 @@ name="submit" alt="PayPal - The safer, easier way to pay online!"/>
</p>
</form>
<p>You will receive a download link <b>just after</b> the payment, from gilles.lamiral@laposte.net (can fall in Spam folder sometimes).<br/>
<p>You will receive a download link <b>just after</b> the payment, from <b>gilles.lamiral@laposte.net</b> (can fall in Spam folder sometimes).<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), since reedit is not easy (and forbidden by law).
@ -449,7 +465,7 @@ Please give a <b>delivery postal address where the invoice will be needed</b>
<!--
<p>
thanks to Strawberry Perl 5.12 and Par::Packer module.<br/>
thanks to Strawberry Perl 5.16 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>
-->
@ -496,7 +512,7 @@ It's 2 letters followed by 11 digits, for example mine is FR74429303332.
</p>
</form>
<p>You will receive instructions to contact me <b>just after</b> the payment, from gilles.lamiral@laposte.net (can fall in Spam folder sometimes).<br/>
<p>You will receive instructions to contact me <b>just after</b> the payment, from <b>gilles.lamiral@laposte.net</b> (can fall in Spam folder sometimes).<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), since reedit is not easy (and forbidden by law).
@ -622,7 +638,7 @@ I like it.
(<a href="http://www.communigate.com/">http://www.communigate.com/</a>) </li>
<li>Courier IMAP 1.5.1, 2.2.0, 2.1.1, 2.2.1, 3.0.8, 3.0.3, 4.1.1 (GPL)
(<a href="http://www.courier-mta.org/imap/">http://www.courier-mta.org/imap/</a>) </li>
<li>Critical Path (7.0.020) (<a href=""></a>) </li>
<li>Critical Path (7.0.020) </li>
<li>Cyrus IMAP 1.5, 1.6,
2.1, 2.1.15, 2.1.16, 2.1.18
2.2.1, 2.2.2-BETA, 2.2.3, 2.2.6, 2.2.10, 2.2.12, 2.2.13,
@ -635,7 +651,7 @@ I like it.
<li>DBOX 2.41 System [host1] (<a href="http://www.dbox.handshake.de/">http://www.dbox.handshake.de/</a>).</li>
<li>Deerfield VisNetic MailServer 5.8.6 [host1]
(<a href="http://www.deerfield.net/products/visnetic-mailserver/">http://www.deerfield.net/products/visnetic-mailserver/</a>) </li>
<li>dkimap4 [host1] (<a href=""></a>) </li>
<li>dkimap4 [host1] </li>
<li>Domino (Notes) 4.61[host1], 6.5, 5.0.6, 5.0.7, 7.0.2, 6.0.2CF1, 7.0.1[host1], 8.0.1[host1]
(<a href="http://www-01.ibm.com/software/lotus/products/notes/">http://www-01.ibm.com/software/lotus/products/notes/</a>) </li>
<li><b>Dovecot</b> 0.99.10.4, 0.99.14, 0.99.14-8.fc4, 1.0-0.beta2.7,
@ -684,7 +700,9 @@ I like it.
<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>Sendmail Mail Store IMAP4rev1 (5.5.6/mstore-5-5-build-1874 [host1].</li>
<li>SmarterMail, Smarter Mail 5.0 Enterprise, Smarter Mail 5.5 [host1], SmarterMail Professional 10.2 [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], SmarterMail Professional 10.2 [host1],
Smarter Mail 11.7 [host1][host2].
(<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>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>
@ -720,6 +738,8 @@ I like it.
<li> wonko_imapsync: <a href="http://wonko.com/article/554">http://wonko.com/article/554</a></li>
<li> pop2imap: <a href="http://www.linux-france.org/prj/pop2imap/">http://www.linux-france.org/prj/pop2imap/</a></li>
<li> exchange-away: <a href="http://exchange-away.sourceforge.net/">http://exchange-away.sourceforge.net/</a></li>
<li> SyncBackPro <a href="http://www.2brightsparks.com/syncback/sbpro.html">http://www.2brightsparks.com/syncback/sbpro.html</a></li>
</ul>
<h2>Online IMAP migration services</h2>
@ -766,7 +786,7 @@ alt="Viewable With Any Browser" />
<!--#config timefmt="%D" -->
<!--#config timefmt="%A %B %d, %Y" -->
<b>This document last modified on <!--#echo var="LAST_MODIFIED" --></b>
($Id: index.shtml,v 1.189 2013/12/25 11:35:38 gilles Exp gilles $)
($Id: index.shtml,v 1.195 2014/02/13 03:17:59 gilles Exp gilles $)
</p>
</body>

File diff suppressed because it is too large Load Diff

View File

@ -1,37 +1,37 @@
Main code has high complexity score (350) at line 1, column 1. Consider refactoring. (Severity: 3)
Expression form of "map" at line 1096, column 51. See page 169 of PBP. (Severity: 4)
Expression form of "map" at line 1106, column 51. See page 169 of PBP. (Severity: 4)
Code structure is deeply nested at line 1542, column 41. Consider refactoring. (Severity: 3)
Too many arguments at line 1722, column 1. See page 182 of PBP. (Severity: 3)
Too many arguments at line 1740, column 1. See page 182 of PBP. (Severity: 3)
Too many arguments at line 1750, column 1. See page 182 of PBP. (Severity: 3)
Too many arguments at line 1984, column 1. See page 182 of PBP. (Severity: 3)
Too many arguments at line 2039, column 1. See page 182 of PBP. (Severity: 3)
Too many arguments at line 2095, column 1. See page 182 of PBP. (Severity: 3)
Too many arguments at line 2185, column 1. See page 182 of PBP. (Severity: 3)
Reused variable name in lexical scope: $imap2 at line 2477, column 9. Invent unique variable names. (Severity: 3)
Regular expression without "/x" flag at line 2493, column 20. See page 236 of PBP. (Severity: 3)
Mixed high and low-precedence booleans at line 2494, column 12. See page 70 of PBP. (Severity: 4)
Expression form of "eval" at line 2890, column 13. See page 161 of PBP. (Severity: 5)
Expression form of "eval" at line 3108, column 13. See page 161 of PBP. (Severity: 5)
Subroutine "select_msgs" does not end with "return" at line 3249, column 1. See page 197 of PBP. (Severity: 4)
Subroutine "tests_msgs_from_maxmin" does not end with "return" at line 3388, column 1. See page 197 of PBP. (Severity: 4)
Subroutine "copy_message" with high complexity score (24) at line 3465, column 1. Consider refactoring. (Severity: 3)
Too many arguments at line 3465, column 1. See page 182 of PBP. (Severity: 3)
Too many arguments at line 3533, column 1. See page 182 of PBP. (Severity: 3)
Subroutine "tests_subject" does not end with "return" at line 3627, column 1. See page 197 of PBP. (Severity: 4)
Too many arguments at line 3690, column 1. See page 182 of PBP. (Severity: 3)
Subroutine "sleep_if_needed" does not end with "return" at line 3746, column 1. See page 197 of PBP. (Severity: 4)
Reused variable name in lexical scope: $total_bytes_transferred at line 3747, column 2. Invent unique variable names. (Severity: 3)
Reused variable name in lexical scope: $nb_msg_transferred at line 3747, column 2. Invent unique variable names. (Severity: 3)
Reused variable name in lexical scope: $nb_msg_transferred at line 3759, column 9. Invent unique variable names. (Severity: 3)
Reused variable name in lexical scope: $maxmessagespersecond at line 3759, column 9. Invent unique variable names. (Severity: 3)
Reused variable name in lexical scope: $total_bytes_transferred at line 3780, column 9. Invent unique variable names. (Severity: 3)
Reused variable name in lexical scope: $maxbytespersecond at line 3780, column 9. Invent unique variable names. (Severity: 3)
Mismatched operator at line 4248, column 75. Numeric/string operators and operands should match. (Severity: 3)
Hard tabs used at line 4332, column 10. See page 20 of PBP. (Severity: 3)
Expression form of "eval" at line 4603, column 13. See page 161 of PBP. (Severity: 5)
Too many arguments at line 4758, column 1. See page 182 of PBP. (Severity: 3)
Expression form of "eval" at line 5390, column 43. See page 161 of PBP. (Severity: 5)
Expression form of "eval" at line 5394, column 45. See page 161 of PBP. (Severity: 5)
"$i" is declared but not used at line 5658, column 9. Unused variables clutter code and make it harder to read. (Severity: 3)
Expression form of "map" at line 1101, column 51. See page 169 of PBP. (Severity: 4)
Expression form of "map" at line 1111, column 51. See page 169 of PBP. (Severity: 4)
Code structure is deeply nested at line 1547, column 41. Consider refactoring. (Severity: 3)
Too many arguments at line 1727, column 1. See page 182 of PBP. (Severity: 3)
Too many arguments at line 1745, column 1. See page 182 of PBP. (Severity: 3)
Too many arguments at line 1755, column 1. See page 182 of PBP. (Severity: 3)
Too many arguments at line 1989, column 1. See page 182 of PBP. (Severity: 3)
Too many arguments at line 2047, column 1. See page 182 of PBP. (Severity: 3)
Too many arguments at line 2106, column 1. See page 182 of PBP. (Severity: 3)
Too many arguments at line 2197, column 1. See page 182 of PBP. (Severity: 3)
Reused variable name in lexical scope: $imap2 at line 2489, column 9. Invent unique variable names. (Severity: 3)
Regular expression without "/x" flag at line 2505, column 20. See page 236 of PBP. (Severity: 3)
Mixed high and low-precedence booleans at line 2506, column 12. See page 70 of PBP. (Severity: 4)
Expression form of "eval" at line 2929, column 13. See page 161 of PBP. (Severity: 5)
Expression form of "eval" at line 3148, column 13. See page 161 of PBP. (Severity: 5)
Subroutine "select_msgs" does not end with "return" at line 3289, column 1. See page 197 of PBP. (Severity: 4)
Subroutine "tests_msgs_from_maxmin" does not end with "return" at line 3428, column 1. See page 197 of PBP. (Severity: 4)
Subroutine "copy_message" with high complexity score (30) at line 3505, column 1. Consider refactoring. (Severity: 3)
Too many arguments at line 3505, column 1. See page 182 of PBP. (Severity: 3)
Too many arguments at line 3596, column 1. See page 182 of PBP. (Severity: 3)
Subroutine "tests_subject" does not end with "return" at line 3690, column 1. See page 197 of PBP. (Severity: 4)
Too many arguments at line 3753, column 1. See page 182 of PBP. (Severity: 3)
Subroutine "sleep_if_needed" does not end with "return" at line 3809, column 1. See page 197 of PBP. (Severity: 4)
Reused variable name in lexical scope: $total_bytes_transferred at line 3810, column 2. Invent unique variable names. (Severity: 3)
Reused variable name in lexical scope: $nb_msg_transferred at line 3810, column 2. Invent unique variable names. (Severity: 3)
Reused variable name in lexical scope: $nb_msg_transferred at line 3822, column 9. Invent unique variable names. (Severity: 3)
Reused variable name in lexical scope: $maxmessagespersecond at line 3822, column 9. Invent unique variable names. (Severity: 3)
Reused variable name in lexical scope: $total_bytes_transferred at line 3843, column 9. Invent unique variable names. (Severity: 3)
Reused variable name in lexical scope: $maxbytespersecond at line 3843, column 9. Invent unique variable names. (Severity: 3)
Mismatched operator at line 4311, column 75. Numeric/string operators and operands should match. (Severity: 3)
Hard tabs used at line 4395, column 10. See page 20 of PBP. (Severity: 3)
Expression form of "eval" at line 4666, column 13. See page 161 of PBP. (Severity: 5)
Too many arguments at line 4821, column 1. See page 182 of PBP. (Severity: 3)
Expression form of "eval" at line 5453, column 43. See page 161 of PBP. (Severity: 5)
Expression form of "eval" at line 5457, column 45. See page 161 of PBP. (Severity: 5)
"$i" is declared but not used at line 5721, column 9. Unused variables clutter code and make it harder to read. (Severity: 3)

108
tests.sh
View File

@ -1,6 +1,6 @@
#!/bin/sh
# $Id: tests.sh,v 1.233 2013/12/25 03:25:18 gilles Exp gilles $
# $Id: tests.sh,v 1.235 2014/01/27 02:22:29 gilles Exp gilles $
# Example 1:
# CMD_PERL='perl -I./W/Mail-IMAPClient-3.35/lib' sh -x tests.sh
@ -1183,6 +1183,42 @@ ll_maxlinelength()
--maxlinelength 8 --nofoldersizes --folder INBOX
}
ll_minmaxlinelength()
{
can_send && sendtestmessage
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--minmaxlinelength 1000 --nofoldersizes --folder INBOX
}
ll_maxlinelength_prepa_1()
{
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 gilles@est.belle \
--passfile1 ../../var/pass/secret.gilles_mbox \
--host2 $HOST2 --user2 tete@est.belle \
--passfile2 ../../var/pass/secret.tete \
--folderrec INBOX.Junk --foldersizes --justfolders \
--usecache --tmpdir /var/tmp --minmaxlinelength 8000 --debugmaxlinelength
}
ll_maxlinelength_prepa_2()
{
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tete@est.belle \
--passfile1 ../../var/pass/secret.tete \
--host2 ks.lamiral.info --user2 tata \
--passfile2 ../../var/pass/secret.tata \
--ssl2 \
--include INBOX.Junk.20 --foldersizes --nojustfolders \
--useuid --tmpdir /var/tmp --minmaxlinelength 10 --delete2 --nofastio1 --nofastio2
}
ll_maxsize()
{
@ -2046,6 +2082,20 @@ ll_delete_reverse() {
--delete --minage 100 --maxage 300 --noexpungeaftereach
}
ll_delete_reverse_useuid() {
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 titi \
--passfile1 ../../var/pass/secret.titi \
--host2 $HOST2 --user2 tata \
--passfile2 ../../var/pass/secret.tata \
--folder INBOX \
--delete --minage 100 --maxage 300 --noexpungeaftereach \
--useuid
}
ll_maxmessagespersecond() {
ll_delete_reverse
$CMD_PERL ./imapsync \
@ -2964,9 +3014,55 @@ l_office365()
--passfile1 ../../var/pass/secret.tata \
--host2 imap-mail.outlook.com --ssl2 --user2 gilles.lamiral@outlook.com \
--passfile2 ../../var/pass/secret.outlook.com \
--folder INBOX --regextrans2 's/INBOX/tata/' --debugflags
--folder INBOX --tmpdir /var/tmp --usecache --regextrans2 's/INBOX/tata/' --delete2 --expunge2
}
l_office365_bigfolders()
{
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 imap-mail.outlook.com --ssl2 --user2 gilles.lamiral@outlook.com \
--passfile2 ../../var/pass/secret.outlook.com \
--tmpdir /var/tmp --useuid --include Junk.20
}
l_office365_maxline()
{
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 imap-mail.outlook.com --ssl2 --user2 gilles.lamiral@outlook.com \
--passfile2 ../../var/pass/secret.outlook.com \
--tmpdir /var/tmp --usecache --include Junk.2013 --maxlinelength 16000 --debugmaxlinelength
}
l_office365_maxline_2()
{
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 imap-mail.outlook.com --ssl2 --user2 gilles.lamiral@outlook.com \
--passfile2 ../../var/pass/secret.outlook.com \
--tmpdir /var/tmp --usecache \
--folder INBOX --regextrans2 's/INBOX/tata/' \
--minmaxlinelength 8000 --debugmaxlinelength
}
# Only available on ks2 (filtered by a firewall)
l_exchange_maxline()
{
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 correu.quopiam.com --ssl2 --user2 utest@quopiam.com \
--passfile2 ../../var/pass/secret.quopiam.com \
--tmpdir /var/tmp --usecache \
--folder INBOX --regextrans2 's/INBOX/longlines/' \
--minmaxlinelength 10000 --maxlinelength 11000 --debugmaxlinelength
}
##########################
# specific tests
@ -3431,8 +3527,8 @@ big_folder()
--passfile1 ../../var/pass/secret.gilles_mbox \
--host2 $HOST2 --user2 tete@est.belle \
--passfile2 ../../var/pass/secret.tete \
--folder INBOX.Junk.2010 \
--useheader Message-ID || \
--include INBOX.Junk.20 \
--usecache --tmpdir /var/tmp || \
true
}
date2=`date`
@ -3447,8 +3543,8 @@ big_folder_useuid()
--passfile1 ../../var/pass/secret.gilles_mbox \
--host2 $HOST2 --user2 tete@est.belle \
--passfile2 ../../var/pass/secret.tete \
--folder INBOX.Junk.2011 --nofoldersizes \
--useuid --tmpdir /var/tmp || \
--include INBOX.Junk.20 --foldersizes \
--useuid --tmpdir /var/tmp --delete2 || \
true
}
date2=`date`