mirror of
https://github.com/imapsync/imapsync.git
synced 2025-07-21 17:55:54 +02:00
1.500
This commit is contained in:
parent
2ca1ed54cb
commit
495d5a9526
15 changed files with 207 additions and 99 deletions
9
COPYING
9
COPYING
|
@ -1,14 +1,15 @@
|
|||
NO LIMIT PUBLIC LICENSE
|
||||
Version 0, June 2012
|
||||
NO LIMIT PUBLIC LICENSE
|
||||
Version 0, June 2012
|
||||
|
||||
Gilles LAMIRAL
|
||||
La Billais
|
||||
35580 Baulon
|
||||
France
|
||||
|
||||
NO LIMIT PUBLIC LICENSE
|
||||
NO LIMIT PUBLIC LICENSE
|
||||
Terms and conditions for copying, distribution, modification
|
||||
or anything else.
|
||||
|
||||
0. No limit to do anything with this work and this license.
|
||||
0 No limit to do anything with this work and this license.
|
||||
1 GOTO 0
|
||||
|
||||
|
|
6
CREDITS
6
CREDITS
|
@ -1,5 +1,5 @@
|
|||
#!/bin/cat
|
||||
# $Id: CREDITS,v 1.169 2012/07/19 09:43:09 gilles Exp gilles $
|
||||
# $Id: CREDITS,v 1.170 2012/08/10 11:29:41 gilles Exp gilles $
|
||||
|
||||
If you want to make a donation to the author, Gilles LAMIRAL,
|
||||
use any of the following ways:
|
||||
|
@ -30,6 +30,10 @@ I thank very much all of these people.
|
|||
I thank also very much all people who bought imapsync from the homepage
|
||||
but I don't cite them here.
|
||||
|
||||
|
||||
David Abrahams
|
||||
Gave a patch for --authmech PREAUTH
|
||||
|
||||
Peter Fuchs
|
||||
Contributed by giving the book
|
||||
30.86 "Designed for Use: Create Usable Interfaces for Applications and the Web"
|
||||
|
|
18
ChangeLog
18
ChangeLog
|
@ -1,17 +1,27 @@
|
|||
|
||||
RCS file: RCS/imapsync,v
|
||||
Working file: imapsync
|
||||
head: 1.498
|
||||
head: 1.500
|
||||
branch:
|
||||
locks: strict
|
||||
gilles: 1.498
|
||||
gilles: 1.500
|
||||
access list:
|
||||
symbolic names:
|
||||
keyword substitution: kv
|
||||
total revisions: 498; selected revisions: 498
|
||||
total revisions: 500; selected revisions: 500
|
||||
description:
|
||||
----------------------------
|
||||
revision 1.498 locked by: gilles;
|
||||
revision 1.500 locked by: gilles;
|
||||
date: 2012/08/10 04:58:46; author: gilles; state: Exp; lines: +40 -28
|
||||
Bugfix. The cache system didn't work in Win32 (problem with \ transformation)
|
||||
Added option --nocheckselectable to fix INBOX issue with Jana-server.
|
||||
Documentation. Example for --delete2foldersbutnot
|
||||
----------------------------
|
||||
revision 1.499
|
||||
date: 2012/07/30 10:56:26; author: gilles; state: Exp; lines: +45 -31
|
||||
Bugfix. Check the return of touch calls.
|
||||
----------------------------
|
||||
revision 1.498
|
||||
date: 2012/07/20 14:28:45; author: gilles; state: Exp; lines: +22 -6
|
||||
Added several connection ckecks like old good imapsync-1.181 to imapsync-1.398
|
||||
----------------------------
|
||||
|
|
8
Makefile
8
Makefile
|
@ -1,5 +1,5 @@
|
|||
|
||||
# $Id: Makefile,v 1.95 2012/07/19 05:58:22 gilles Exp gilles $
|
||||
# $Id: Makefile,v 1.96 2012/07/29 22:03:29 gilles Exp gilles $
|
||||
|
||||
.PHONY: help usage all
|
||||
|
||||
|
@ -284,9 +284,9 @@ upload_lfo:
|
|||
|
||||
upload_index: index.shtml FAQ paypal.shtml
|
||||
validate --verbose index.shtml paypal.shtml
|
||||
rcsdiff index.shtml paypal.shtml FAQ
|
||||
rsync -avH index.shtml FAQ paypal.shtml root@ks.lamiral.info:/var/www/imapsync/
|
||||
rsync -avH index.shtml FAQ paypal.shtml \
|
||||
rcsdiff index.shtml paypal.shtml FAQ COPYING
|
||||
rsync -avH index.shtml FAQ paypal.shtml COPYING root@ks.lamiral.info:/var/www/imapsync/
|
||||
rsync -avH index.shtml FAQ paypal.shtml COPYING \
|
||||
../../public_html/www.linux-france.org/html/prj/imapsync/
|
||||
sh $(HOME)/memo/lfo-rsync
|
||||
|
||||
|
|
4
README
4
README
|
@ -3,7 +3,7 @@ NAME
|
|||
Synchronise mailboxes between two imap servers. Good at IMAP migration.
|
||||
More than 44 different IMAP server softwares supported with success.
|
||||
|
||||
$Revision: 1.498 $
|
||||
$Revision: 1.500 $
|
||||
|
||||
SYNOPSIS
|
||||
To synchronise imap account "foo" on "imap.truc.org" to imap account
|
||||
|
@ -440,5 +440,5 @@ SIMILAR SOFTWARES
|
|||
|
||||
Feedback (good or bad) will often be welcome.
|
||||
|
||||
$Id: imapsync,v 1.498 2012/07/20 14:28:45 gilles Exp gilles $
|
||||
$Id: imapsync,v 1.500 2012/08/10 04:58:46 gilles Exp gilles $
|
||||
|
||||
|
|
2
VERSION
2
VERSION
|
@ -1 +1 @@
|
|||
1.498
|
||||
1.500
|
||||
|
|
|
@ -1 +1 @@
|
|||
1.498
|
||||
1.500
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#!/bin/sh
|
||||
|
||||
# $Id: memo,v 1.9 2012/07/05 20:37:53 gilles Exp gilles $
|
||||
# $Id: memo,v 1.10 2012/08/10 22:25:31 gilles Exp gilles $
|
||||
|
||||
|
||||
echo paypal_bilan_todo
|
||||
|
@ -28,7 +28,28 @@ Europe a un autre assujetti : Article 262 ter => Exoneration
|
|||
EOF
|
||||
}
|
||||
|
||||
echo paypal_bilan_tests_tva
|
||||
echo paypal_bilan_tests_tva_2
|
||||
paypal_bilan_tests_tva_2() {
|
||||
# DID output no diff between paypal_bilan_1.56 and 1.5?
|
||||
(
|
||||
#set -x
|
||||
/g/public_html/imapsync/W/paypal_reply/paypal_bilan_1.56 --bnc --debug --debug_invoice --first_in 147 \
|
||||
--avoid_numbers '292 293 643 644 731 732 1093 1330 1331 1332 1333 1334 1652 1653' \
|
||||
/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 --bnc --debug --debug_invoice --first_in 147 \
|
||||
--avoid_numbers '292 293 643 644 731 732 1093 1330 1331 1332 1333 1334 1652 1653' \
|
||||
/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_tests_tva
|
||||
paypal_bilan_tests_tva() {
|
||||
# DID output no diff between paypal_bilan_1.55 and 1.5?
|
||||
(
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#!/usr/bin/perl
|
||||
|
||||
# $Id: paypal_bilan,v 1.56 2012/07/16 21:57:51 gilles Exp gilles $
|
||||
# $Id: paypal_bilan,v 1.58 2012/08/11 00:01:46 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.56 2012/07/16 21:57:51 gilles Exp gilles $ ' ;
|
||||
my $rcs = '$Id: paypal_bilan,v 1.58 2012/08/11 00:01:46 gilles Exp gilles $ ' ;
|
||||
$rcs =~ m/,v (\d+\.\d+)/ ;
|
||||
my $VERSION = ($1) ? $1: "UNKNOWN" ;
|
||||
|
||||
|
@ -103,10 +103,10 @@ foreach my $file ( @files ) {
|
|||
#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 )
|
||||
$Pays, $Nom_Option_1, $Valeur_Option_1, $Hors_taxe, $Titre_de_l_objet, $Nom_Option_2, $Option_2_Valeur )
|
||||
= @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") } ;
|
||||
'Pays', 'Nom Option 1', 'Valeur Option 1', 'Hors taxe', "Titre de l'objet", 'Nom Option 2', 'Option 2 Valeur') } ;
|
||||
#print "$Nom\n" ;
|
||||
( $Etat ) = @action{ ( 'Etat', ) } || @action{ ( 'État' ) } ;
|
||||
my $invoice = 'NONE' ;
|
||||
|
@ -509,12 +509,14 @@ sub build_invoice {
|
|||
$De_l_adresse_email, $A_l_adresse_email, $N_de_transaction, $Titre_de_l_objet,
|
||||
$TVA, $Nom_Option_1, $Valeur_Option_1, $N_de_transaction_de_reference,
|
||||
$Adresse_1, $Adresse_2_district_quartier, $Ville,
|
||||
$Etat_Province, $Code_postal, $Pays, $line_number, $line_csv, $file_csv )
|
||||
$Etat_Province, $Code_postal, $Pays, $line_number, $line_csv, $file_csv,
|
||||
$Nom_Option_2, $Option_2_Valeur )
|
||||
= @action{ ( 'Date', 'Heure', 'Nom', 'Type', 'Etat', 'Devise', 'Hors taxe', 'Commission', 'Net',
|
||||
"De l'adresse email", "A l'adresse email", 'N° de transaction', "Titre de l'objet",
|
||||
'TVA', 'Nom Option 1', 'Valeur Option 1', 'Nº de transaction de référence',
|
||||
'Adresse 1', 'Adresse 2/district/quartier', 'Ville',
|
||||
'Etat/Province/Région/Comté/Territoire/Préfecture/République', 'Code postal', 'Pays', 'line_number', 'line_csv', 'file_csv' ) } ;
|
||||
'Etat/Province/Région/Comté/Territoire/Préfecture/République', 'Code postal', 'Pays', 'line_number', 'line_csv', 'file_csv',
|
||||
'Nom Option 2', 'Option 2 Valeur' ) } ;
|
||||
|
||||
my( $Etat_Province1 ) = @action{ ( 'Etat/Province/Région/Comté/Territoire/Préfecture/République' ) } ;
|
||||
my( $Etat_Province2 ) = @action{ ( 'État/Province/Région/Comté/Territoire/Préfecture/République' ) } ;
|
||||
|
@ -609,6 +611,13 @@ sub build_invoice {
|
|||
#print "ZZZ $object_type ( $urlSrc, $urlExe )\n" ;
|
||||
|
||||
my ( $Nom1 ) = cut( $Nom, 42 ) ;
|
||||
|
||||
my $clientVAT = '' ;
|
||||
|
||||
if ( ( 'VAT if professional in Europe' eq $Nom_Option_2 ) and $Option_2_Valeur ) {
|
||||
$clientVAT = $Option_2_Valeur ;
|
||||
}
|
||||
|
||||
my $tex_variables = qq{
|
||||
%% Begin input from paypal_bilan $VERSION
|
||||
\\providecommand{\\invoiceNumber}{$invoice}
|
||||
|
@ -620,7 +629,7 @@ sub build_invoice {
|
|||
\\providecommand{\\clientAdrD}{$clientAdrD}
|
||||
\\providecommand{\\clientAdrE}{$clientAdrE}
|
||||
\\providecommand{\\clientAdrF}{$clientAdrF}
|
||||
\\providecommand{\\clientVAT}{}
|
||||
\\providecommand{\\clientVAT}{$clientVAT}
|
||||
\\providecommand{\\invoiceDate}{$Date}
|
||||
\\providecommand{\\invoiceHour}{$Heure}
|
||||
|
||||
|
@ -1031,8 +1040,8 @@ sub tva_stuff {
|
|||
$priceTVA = 'néant (none)' ;
|
||||
$priceTTC = $priceHT ;
|
||||
$HTorTTC = 'HT' ;
|
||||
$messageTVAFR = 'Exonération de TVA, articles 262 1-2 du Code Général des Impôts';
|
||||
$messageTVAEN = '(VAT tax-exempt, articles 262 1-2 French General Tax Code)';
|
||||
$messageTVAFR = 'Exonération de TVA, articles 262 1-2 et ter du Code Général des Impôts';
|
||||
$messageTVAEN = '(VAT tax-exempt, articles 262 1-2 and ter of French General Tax Code)';
|
||||
}
|
||||
foreach my $price ( $priceHT, $priceTVA, $priceTTC, $priceTTCusd ) {
|
||||
#print "[$price]\n" ;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#!/usr/bin/perl
|
||||
|
||||
# $Id: paypal_bilan,v 1.55 2012/07/16 19:33:46 gilles Exp gilles $
|
||||
# $Id: paypal_bilan,v 1.56 2012/07/16 21:57:51 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.55 2012/07/16 19:33:46 gilles Exp gilles $ ' ;
|
||||
my $rcs = '$Id: paypal_bilan,v 1.56 2012/07/16 21:57:51 gilles Exp gilles $ ' ;
|
||||
$rcs =~ m/,v (\d+\.\d+)/ ;
|
||||
my $VERSION = ($1) ? $1: "UNKNOWN" ;
|
||||
|
||||
|
@ -620,6 +620,7 @@ sub build_invoice {
|
|||
\\providecommand{\\clientAdrD}{$clientAdrD}
|
||||
\\providecommand{\\clientAdrE}{$clientAdrE}
|
||||
\\providecommand{\\clientAdrF}{$clientAdrF}
|
||||
\\providecommand{\\clientVAT}{}
|
||||
\\providecommand{\\invoiceDate}{$Date}
|
||||
\\providecommand{\\invoiceHour}{$Heure}
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
#!/bin/sh
|
||||
|
||||
# $Id: paypal_build_invoices,v 1.34 2012/07/16 14:00:28 gilles Exp gilles $
|
||||
# $Id: paypal_build_invoices,v 1.36 2012/08/10 22:37:18 gilles Exp gilles $
|
||||
|
||||
# usage: sh paypal_build_invoices /g/var/paypal_invoices/????
|
||||
|
||||
|
@ -27,8 +27,9 @@ set -x
|
|||
#/g/public_html/imapsync/W/paypal_reply/paypal_bilan --write_invoices --first_in 1508 /g/paypal/paypal_2012_03_complet.csv
|
||||
#/g/public_html/imapsync/W/paypal_reply/paypal_bilan --write_invoices --first_in 1575 /g/paypal/paypal_2012_04_complet.csv
|
||||
#/g/public_html/imapsync/W/paypal_reply/paypal_bilan --write_invoices --first_in 1654 /g/paypal/paypal_2012_05_complet.csv
|
||||
/g/public_html/imapsync/W/paypal_reply/paypal_bilan --write_invoices --first_in 1743 /g/paypal/paypal_2012_06_complet.csv
|
||||
#/g/public_html/imapsync/W/paypal_reply/paypal_bilan --write_invoices --first_in 1743 /g/paypal/paypal_2012_06_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 --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
|
||||
|
@ -51,6 +52,7 @@ set -x
|
|||
: /g/public_html/imapsync/W/paypal_reply/paypal_bilan --first_in 1654 /g/paypal/paypal_2012_05_complet.csv
|
||||
: /g/public_html/imapsync/W/paypal_reply/paypal_bilan --first_in 1743 /g/paypal/paypal_2012_06_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
|
||||
|
||||
set +x
|
||||
|
||||
|
|
132
imapsync
132
imapsync
|
@ -20,7 +20,7 @@ Synchronise mailboxes between two imap servers.
|
|||
Good at IMAP migration. More than 44 different IMAP server softwares
|
||||
supported with success.
|
||||
|
||||
$Revision: 1.498 $
|
||||
$Revision: 1.500 $
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
|
@ -515,7 +515,7 @@ Entries for imapsync:
|
|||
|
||||
Feedback (good or bad) will often be welcome.
|
||||
|
||||
$Id: imapsync,v 1.498 2012/07/20 14:28:45 gilles Exp gilles $
|
||||
$Id: imapsync,v 1.500 2012/08/10 04:58:46 gilles Exp gilles $
|
||||
|
||||
=cut
|
||||
|
||||
|
@ -626,13 +626,14 @@ my(
|
|||
$wholeheaderifneeded, %h1_msgs_copy_by_uid, $useuid, $h2_uidguess,
|
||||
$addheader,
|
||||
%h1, %h2,
|
||||
$checkselectable,
|
||||
);
|
||||
|
||||
# main program
|
||||
|
||||
# global variables initialisation
|
||||
|
||||
$rcs = '$Id: imapsync,v 1.498 2012/07/20 14:28:45 gilles Exp gilles $ ';
|
||||
$rcs = '$Id: imapsync,v 1.500 2012/08/10 04:58:46 gilles Exp gilles $ ';
|
||||
|
||||
$total_bytes_transferred = 0;
|
||||
$total_bytes_skipped = 0;
|
||||
|
@ -712,6 +713,8 @@ if ( $fast ) {
|
|||
$usecache = 1 if ( $useuid and ( ! defined( $usecache ) ) ) ;
|
||||
$cacheaftercopy = 1 if ( $usecache and ( ! defined( $cacheaftercopy ) ) ) ;
|
||||
|
||||
$checkselectable = defined( $checkselectable ) ? $checkselectable : 1 ;
|
||||
|
||||
print banner_imapsync(@argv_copy);
|
||||
|
||||
print "Temp directory is $tmpdir\n";
|
||||
|
@ -882,17 +885,6 @@ $password2 = ( defined( $passfile2 ) ) ? firstline ( $passfile2 ) : $password2 ;
|
|||
my $dry_message = '' ;
|
||||
$dry_message = "\t(not really since --dry mode)" if $dry ;
|
||||
|
||||
if ( ! ( 1
|
||||
or ( $maxsize
|
||||
or $minsize
|
||||
or $maxage
|
||||
or $minage )
|
||||
and $usecache
|
||||
and ! $delete ) ) {
|
||||
die_clean(
|
||||
"Problem --usecache can not be used safely with options --maxsize --minsize --maxage --minage
|
||||
Use --nousecache or suppress the --max* --min* options\n" ) ;
|
||||
}
|
||||
|
||||
my $imap1 = ();
|
||||
my $imap2 = ();
|
||||
|
@ -999,13 +991,14 @@ if (scalar(@exclude)) {
|
|||
|
||||
# Remove no selectable folders
|
||||
|
||||
foreach my $folder (keys(%requested_folder)) {
|
||||
if ( not $imap1->selectable($folder)) {
|
||||
print "Warning: ignoring folder $folder because it is not selectable\n";
|
||||
remove_from_requested_folders($folder);
|
||||
}
|
||||
}
|
||||
|
||||
$checkselectable and do {
|
||||
foreach my $folder (keys(%requested_folder)) {
|
||||
if ( not $imap1->selectable($folder)) {
|
||||
print "Warning: ignoring folder $folder because it is not selectable\n";
|
||||
remove_from_requested_folders($folder);
|
||||
}
|
||||
}
|
||||
} ;
|
||||
|
||||
my @requested_folder = sort(keys(%requested_folder));
|
||||
|
||||
|
@ -1143,12 +1136,14 @@ FOLDER: foreach my $h1_fold (@h1_folders_wanted) {
|
|||
|
||||
( $debug or $debugLIST ) and print "Host2 LIST: $h2_msgs_nb messages [@h2_msgs]\n";
|
||||
|
||||
my $cache_base = "$tmpdir/imapsync_cache/$host1/$user1/$host2/$user2";
|
||||
my $cache_dir = cache_folder( $cache_base, $h1_fold, $h2_fold );
|
||||
my ( $cache_1_2_ref, $cache_2_1_ref ) = ( {}, {} );
|
||||
|
||||
last FOLDER if $imap1->IsUnconnected();
|
||||
last FOLDER if $imap2->IsUnconnected();
|
||||
my $cache_base = "$tmpdir/imapsync_cache/$host1/$user1/$host2/$user2" ;
|
||||
my $cache_dir = cache_folder( $cache_base, $h1_fold, $h2_fold ) ;
|
||||
my ( $cache_1_2_ref, $cache_2_1_ref ) = ( {}, {} ) ;
|
||||
my $h1_uidvalidity = $imap1->uidvalidity( ) || '' ;
|
||||
my $h2_uidvalidity = $imap2->uidvalidity( ) || '' ;
|
||||
|
||||
last FOLDER if $imap1->IsUnconnected() ;
|
||||
last FOLDER if $imap2->IsUnconnected() ;
|
||||
|
||||
if ( $usecache ) {
|
||||
print "cache directory: $cache_dir\n" ;
|
||||
|
@ -1361,8 +1356,11 @@ FOLDER: foreach my $h1_fold (@h1_folders_wanted) {
|
|||
$debug and print "Host1 found msg $h1_fold/$h1_msg equals Host2 $h2_fold/$h2_msg\n" ;
|
||||
$total_bytes_skipped += $h1_size ;
|
||||
$nb_msg_skipped += 1 ;
|
||||
$debugcache and print "touch $cache_dir/${h1_msg}_$h2_msg\n" if ( $usecache ) ;
|
||||
touch( "$cache_dir/${h1_msg}_$h2_msg" ) if ( $usecache ) ;
|
||||
if ( $usecache ) {
|
||||
$debugcache and print "touch $cache_dir/${h1_msg}_$h2_msg\n" ;
|
||||
touch( "$cache_dir/${h1_msg}_$h2_msg" )
|
||||
or die( "Couldn't touch $cache_dir/${h1_msg}_$h2_msg" ) ;
|
||||
}
|
||||
}
|
||||
|
||||
#$debug and print "MESSAGE $m_id\n";
|
||||
|
@ -1901,8 +1899,8 @@ sub banner_imapsync {
|
|||
my @argv_copy = @_;
|
||||
my $banner_imapsync = join("",
|
||||
'$RCSfile: imapsync,v $ ',
|
||||
'$Revision: 1.498 $ ',
|
||||
'$Date: 2012/07/20 14:28:45 $ ',
|
||||
'$Revision: 1.500 $ ',
|
||||
'$Date: 2012/08/10 04:58:46 $ ',
|
||||
"\n",localhost_info(), "\n",
|
||||
"Command line used:\n",
|
||||
"$0 ", command_line_nopassword(@argv_copy), "\n",
|
||||
|
@ -2808,8 +2806,12 @@ sub copy_message {
|
|||
$h2_uidguess += 1 ;
|
||||
$total_bytes_transferred += $h1_size;
|
||||
$nb_msg_transferred += 1;
|
||||
$debugcache and print "touch $cache_dir/${h1_msg}_$new_id\n" if ( $usecache and $cacheaftercopy and $new_id =~ m{^\d+$} ) ;
|
||||
touch( "$cache_dir/${h1_msg}_$new_id" ) if ( $usecache and $cacheaftercopy and $new_id =~ m{^\d+$} ) ;
|
||||
|
||||
if ( $usecache and $cacheaftercopy and $new_id =~ m{^\d+$} ) {
|
||||
$debugcache and print "touch $cache_dir/${h1_msg}_$new_id\n" ;
|
||||
touch( "$cache_dir/${h1_msg}_$new_id" )
|
||||
or die( "Couldn't touch $cache_dir/${h1_msg}_$new_id" ) ;
|
||||
}
|
||||
if ( $delete ) {
|
||||
print "msg $h1_fold/$h1_msg deleted on host1\n";
|
||||
unless($dry) {
|
||||
|
@ -2906,6 +2908,20 @@ sub tests_cache_map {
|
|||
|
||||
}
|
||||
|
||||
sub cache_dir_fix {
|
||||
my $cache_dir = shift ;
|
||||
$cache_dir =~ s/([;<>\*\|`&\$!#\(\)\[\]\{\}:'"\\])/\\$1/g ;
|
||||
#print "cache_dir_fix: $cache_dir\n" ;
|
||||
return( $cache_dir ) ;
|
||||
}
|
||||
|
||||
sub tests_cache_dir_fix {
|
||||
ok( 'lalala' eq cache_dir_fix('lalala'), 'cache_dir_fix: lalala -> lalala' );
|
||||
ok( 'ii\\\\ii' eq cache_dir_fix('ii\ii'), 'cache_dir_fix: ii\ii -> ii\\\\ii' );
|
||||
ok( 'ii@ii' eq cache_dir_fix('ii@ii'), 'cache_dir_fix: ii@ii -> ii@ii' );
|
||||
ok( 'ii@ii\\:ii' eq cache_dir_fix('ii@ii:ii'), 'cache_dir_fix: ii@ii:ii -> ii@ii\\:ii' );
|
||||
|
||||
}
|
||||
|
||||
sub get_cache {
|
||||
$debugcache and print "Entering get_cache\n";
|
||||
|
@ -2915,12 +2931,14 @@ sub get_cache {
|
|||
$debugcache and print "cache_dir : $cache_dir\n";
|
||||
|
||||
#$cache_dir =~ s{\\}{\\\\}g;
|
||||
$cache_dir =~ s/([;<>\*\|`&\$!#\(\)\[\]\{\}:'"\\])/\\$1/g ;
|
||||
$cache_dir = cache_dir_fix( $cache_dir ) if ( 'MSWin32' ne $OSNAME ) ;
|
||||
|
||||
$debugcache and print "cache_dir fix: $cache_dir\n";
|
||||
$debugcache and print "cache_dir_fix: $cache_dir\n" ;
|
||||
|
||||
my @cache_files = bsd_glob( "$cache_dir/*" ) ;
|
||||
#$debugcache and print "cache_files: [@cache_files]\n";
|
||||
#$debugcache and print "cache_files: [@cache_files]\n" ;
|
||||
|
||||
$debugcache and print( "cache_files: ", scalar( @cache_files ), " files found\n" ) ;
|
||||
|
||||
my( $cache_1_2_ref, $cache_2_1_ref )
|
||||
= cache_map( \@cache_files, $h1_msgs_ref, $h2_msgs_ref ) ;
|
||||
|
@ -3200,16 +3218,6 @@ sub tests_clean_cache_2 {
|
|||
}
|
||||
|
||||
|
||||
sub tests_touch {
|
||||
|
||||
ok( (-d 'tmp/tests/' or mkpath( 'tmp/tests/' )), 'tests_touch: mkpath tmp/tests/' ) ;
|
||||
ok( 1 == touch( 'tmp/tests/lala'), 'tests_touch: tmp/tests/lala') ;
|
||||
ok( 1 == touch( 'tmp/tests/\y'), 'tests_touch: tmp/tests/\y') ;
|
||||
ok( 0 == touch( '/aaa'), 'tests_touch: not /aaa') ;
|
||||
ok( 2 == touch( 'tmp/tests/lili', 'tmp/tests/lolo'), 'tests_touch: 2 files') ;
|
||||
ok( 1 == touch( 'tmp/tests/\y', '/aaa'), 'tests_touch: 2 files, 1 fails' ) ;
|
||||
|
||||
}
|
||||
|
||||
sub tests_mkpath {
|
||||
|
||||
|
@ -3219,18 +3227,32 @@ sub tests_mkpath {
|
|||
ok( 1 == 1, 'tests_mkpath: 1 == 1' ) ;
|
||||
}
|
||||
|
||||
sub tests_touch {
|
||||
|
||||
ok( (-d 'tmp/tests/' or mkpath( 'tmp/tests/' )), 'tests_touch: mkpath tmp/tests/' ) ;
|
||||
ok( 1 == touch( 'tmp/tests/lala'), 'tests_touch: tmp/tests/lala') ;
|
||||
ok( 1 == touch( 'tmp/tests/\y'), 'tests_touch: tmp/tests/\y') ;
|
||||
ok( 0 == touch( '/aaa'), 'tests_touch: not /aaa') ;
|
||||
ok( 1 == touch( 'tmp/tests/lili', 'tmp/tests/lolo'), 'tests_touch: 2 files') ;
|
||||
ok( 0 == touch( 'tmp/tests/\y', '/aaa'), 'tests_touch: 2 files, 1 fails' ) ;
|
||||
|
||||
}
|
||||
|
||||
|
||||
sub touch {
|
||||
my @files = @_ ;
|
||||
my @result;
|
||||
my $failures = 0 ;
|
||||
|
||||
foreach my $file ( @files ) {
|
||||
my $fh = new IO::File ;
|
||||
if ($fh->open(">> $file")) {
|
||||
if ( $fh->open(">> $file" ) ) {
|
||||
$fh->close ;
|
||||
push(@result, $file) ;
|
||||
}
|
||||
}else{
|
||||
print "Could not open file $file in write/append mode\n" ;
|
||||
$failures++ ;
|
||||
}
|
||||
}
|
||||
return(@result);
|
||||
return( ! $failures );
|
||||
}
|
||||
|
||||
sub cache_folder {
|
||||
|
@ -3545,6 +3567,7 @@ sub get_options {
|
|||
"useuid!" => \$useuid,
|
||||
"addheader!" => \$addheader,
|
||||
"exitwhenover=i" => \$exitwhenover,
|
||||
"checkselectable!" => \$checkselectable,
|
||||
);
|
||||
|
||||
$debug and print "get options: [$opt_ret]\n";
|
||||
|
@ -3734,7 +3757,7 @@ sub check_last_release {
|
|||
}
|
||||
|
||||
sub imapsync_version {
|
||||
my $rcs = '$Id: imapsync,v 1.498 2012/07/20 14:28:45 gilles Exp gilles $ ';
|
||||
my $rcs = '$Id: imapsync,v 1.500 2012/08/10 04:58:46 gilles Exp gilles $ ';
|
||||
$rcs =~ m/,v (\d+\.\d+)/;
|
||||
my $VERSION = ($1) ? $1: "UNKNOWN";
|
||||
return($VERSION);
|
||||
|
@ -3928,6 +3951,7 @@ Several options are mandatory.
|
|||
--delete2folders --dry --justfolders --nofoldersizes
|
||||
--delete2foldersonly <regex>: delete only folders matching regex.
|
||||
--delete2foldersbutnot <regex>: do not delete folders matching regex.
|
||||
Example: --delete2foldersbutnot "/Tasks|Contacts|Foo/"
|
||||
--noexpunge : Do not expunge messages on host1.
|
||||
Expunge really deletes messages marked deleted.
|
||||
Expunge is made at the beginning, on host1 only.
|
||||
|
@ -4532,7 +4556,7 @@ sub tests_debug {
|
|||
|
||||
SKIP: {
|
||||
skip "No test in normal run" if ( not $tests_debug );
|
||||
tests_add_header( ) ;
|
||||
tests_cache_dir_fix( ) ;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4568,6 +4592,8 @@ sub tests {
|
|||
tests_extract_header( ) ;
|
||||
tests_decompose_header( ) ;
|
||||
tests_epoch( ) ;
|
||||
tests_add_header( ) ;
|
||||
tests_cache_dir_fix( ) ;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
49
index.shtml
49
index.shtml
|
@ -5,7 +5,7 @@
|
|||
<title>Imapsync: an IMAP 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="2012-07-20T16:47:33+0200"/>
|
||||
<meta name="date" content="2012-08-11T03:39:57+0200"/>
|
||||
<meta name="copyright" content="None"/>
|
||||
<meta name="keywords" content="imap, transfert, migration"/>
|
||||
<meta name="description" content="imap migration tool"/>
|
||||
|
@ -94,6 +94,15 @@ total is 93 millions for 2011</li>
|
|||
|
||||
<p>New features or bugfixes since previous releases:</p>
|
||||
|
||||
<ul>
|
||||
<li><b>1.500</b></li>
|
||||
<li><b>Enhancement</b>: Added option --nocheckselectable 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>: Check the return of touch calls for the cache. </li>
|
||||
<li><b>Usability</b>: Example for --delete2foldersbutnot "m/Contacts|Agenda|Trash/"</li>
|
||||
</ul>
|
||||
|
||||
|
||||
<ul>
|
||||
<li><b>1.498</b></li>
|
||||
<li><b>Usability</b>: Use KiB MiB GiB etc in result summary. Patch from Mark Atwood.</li>
|
||||
|
@ -215,7 +224,7 @@ any Unix, Linux, Windows, or Mac OS operating system.
|
|||
|
||||
<p>
|
||||
<b>+ One year</b> of imapsync <b>updates</b> without extra payment.<br/>
|
||||
<b>+ 30 days money-back guarantee!</b><br/>
|
||||
<b>+ 30 days money-back guarantee!</b> (any reason qualifies)<br/>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
|
@ -232,7 +241,12 @@ Price <b>42 EUR</b> is equal to around <b>50 USD</b>, no problem to pay in USD (
|
|||
<select name="os0">
|
||||
<option value="professional">professional </option>
|
||||
<option value="individual">individual </option>
|
||||
</select><br/>
|
||||
</select>
|
||||
<br/>
|
||||
<input type="hidden" name="on1" value="VAT if professional in Europe"/>
|
||||
Enter your <b>VAT</b> <input type="text" name="os1" size="13" maxlength="13"/> <b> if you're a European professional</b> (for accounting). It's 2 letters followed by 11 digits, for example mine is FR74429303332.
|
||||
<br/>
|
||||
<input type="hidden" name="currency_code" value="EUR"/>
|
||||
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_buynowCC_LG.gif"
|
||||
name="submit" alt="PayPal - The safer, easier way to pay online!"/>
|
||||
<img alt="" src="https://www.paypalobjects.com/fr_FR/i/scr/pixel.gif" width="1" height="1"/>
|
||||
|
@ -241,7 +255,7 @@ 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/>
|
||||
You will also receive a gpg signed <b>invoice</b> within <b>a few days by email</b>.<br/>
|
||||
Please give a <b>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> (your company for example),
|
||||
since reedit is not easy (and forbidden by law).
|
||||
</p>
|
||||
|
||||
|
@ -256,7 +270,7 @@ buying the latest win32 <b>standalone imapsync.exe</b> for <b>42 EUR</b>
|
|||
|
||||
<p>
|
||||
<b>+ One year</b> of imapsync <b>updates</b> without extra payment.<br/>
|
||||
<b>+ 30 days money-back guarantee!</b><br/>
|
||||
<b>+ 30 days money-back guarantee!</b> (any reason qualifies)<br/>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
|
@ -272,7 +286,12 @@ Price <b>42 EUR</b> is equal to around <b>50 USD</b>, no problem to pay in USD (
|
|||
<select name="os0">
|
||||
<option value="professional">professional </option>
|
||||
<option value="individual">individual </option>
|
||||
</select> <br/>
|
||||
</select>
|
||||
<br/>
|
||||
<input type="hidden" name="on1" value="VAT if professional in Europe"/>
|
||||
Enter your <b>VAT</b> <input type="text" name="os1" size="13" maxlength="13"/> <b> if you're a European professional</b> (for accounting). It's 2 letters followed by 11 digits, for example mine is FR74429303332.
|
||||
<br/>
|
||||
<input type="hidden" name="currency_code" value="EUR"/>
|
||||
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_buynowCC_LG.gif"
|
||||
name="submit" alt="PayPal - The safer, easier way to pay online!"/>
|
||||
<img alt="" src="https://www.paypalobjects.com/fr_FR/i/scr/pixel.gif" width="1" height="1"/>
|
||||
|
@ -281,7 +300,7 @@ 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/>
|
||||
You will also receive a gpg signed <b>invoice</b> within <b>a few days by email</b>.<br/>
|
||||
Please give a <b>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> (your company for example),
|
||||
since reedit is not easy (and forbidden by law).
|
||||
</p>
|
||||
|
||||
|
@ -308,6 +327,16 @@ Payment by Paypal account and credit card accepted. <br/>
|
|||
<p>
|
||||
<input type="hidden" name="cmd" value="_s-xclick" />
|
||||
<input type="hidden" name="hosted_button_id" value="E25UVGFNDJWW8" />
|
||||
<input type="hidden" name="on0" value="imapsync usage"/>imapsync usage
|
||||
<select name="os0">
|
||||
<option value="professional">professional </option>
|
||||
<option value="individual">individual </option>
|
||||
</select>
|
||||
<br/>
|
||||
<input type="hidden" name="on1" value="VAT if professional in Europe"/>
|
||||
Enter your <b>VAT</b> <input type="text" name="os1" size="13" maxlength="13"/> <b> if you're a European professional</b> (for accounting). It's 2 letters followed by 11 digits, for example mine is FR74429303332.
|
||||
<br/>
|
||||
<input type="hidden" name="currency_code" value="EUR"/>
|
||||
<input type="image"
|
||||
src="https://www.paypalobjects.com/WEBSCR-640-20110401-1/en_US/i/btn/btn_buynowCC_LG.gif"
|
||||
name="submit"
|
||||
|
@ -318,7 +347,7 @@ Payment by Paypal account and credit card accepted. <br/>
|
|||
</form>
|
||||
|
||||
<p>You will also receive a gpg signed <b>invoice</b> within <b>a few days by email</b>.<br/>
|
||||
Please give a <b>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> (your company for example),
|
||||
since reedit is not easy (and forbidden by law).
|
||||
</p>
|
||||
|
||||
|
@ -492,6 +521,7 @@ Don't hesitate to have a try, I will help you and make efforts to switch them to
|
|||
<li> imapcopy: <a href="http://home.arcor.de/armin.diehl/imapcopy/imapcopy.html">http://home.arcor.de/armin.diehl/imapcopy/imapcopy.html</a></li>
|
||||
<li> migrationtool: <a href="http://sourceforge.net/projects/migrationtool/">http://sourceforge.net/projects/migrationtool/</a></li>
|
||||
<li> imapmigrate: <a href="http://sourceforge.net/projects/cyrus-utils/">http://sourceforge.net/projects/cyrus-utils/</a></li>
|
||||
<li> larch: <a href="https://github.com/rgrove/larch">https://github.com/rgrove/larch</a> (derived from wonko_imapsync)</li>
|
||||
<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>
|
||||
|
@ -540,8 +570,9 @@ 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.122 2012/07/20 15:24:40 gilles Exp gilles $)
|
||||
($Id: index.shtml,v 1.127 2012/08/11 01:40:17 gilles Exp gilles $)
|
||||
</p>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
|
||||
REM $Id: test2.bat,v 1.8 2012/02/25 14:42:23 gilles Exp gilles $
|
||||
REM $Id: test2.bat,v 1.9 2012/08/10 11:28:30 gilles Exp gilles $
|
||||
|
||||
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
|
||||
|
@ -26,6 +26,9 @@ REM --host2 imap.side2.org --user2 %%I --password2 %%J
|
|||
REM imapsync --host1 p --user1 tata --passfile1 secret.tata ^
|
||||
REM --host2 p --user2 dollar --password2 "$%%&<>|^"^" --justlogin
|
||||
|
||||
imapsync --host1 p --user1 tata --passfile1 secret.tata ^
|
||||
--host2 p --user2 equal --password2 "==lalala" --justlogin --debugimap2
|
||||
REM imapsync --host1 p --user1 tata --passfile1 secret.tata ^
|
||||
REM --host2 p --user2 equal --password2 "==lalala" --justlogin --debugimap2
|
||||
|
||||
perl ./imapsync --host1 p --user1 tata --passfile1 secret.tata ^
|
||||
--host2 p --user2 titi --passfile2 secret.titi ^
|
||||
--folder INBOX.useuid --useuid --debugcache --delete2
|
||||
|
|
4
tests.sh
4
tests.sh
|
@ -1,6 +1,6 @@
|
|||
#!/bin/sh
|
||||
|
||||
# $Id: tests.sh,v 1.195 2012/07/18 11:10:00 gilles Exp gilles $
|
||||
# $Id: tests.sh,v 1.196 2012/08/10 11:29:11 gilles Exp gilles $
|
||||
|
||||
# Example 1:
|
||||
# CMD_PERL='perl -I./Mail-IMAPClient-3.25/lib' sh -x tests.sh
|
||||
|
@ -486,7 +486,7 @@ ll_delete2foldersbutnot() {
|
|||
--host2 $HOST2 --user2 titi \
|
||||
--passfile2 ../../var/pass/secret.titi \
|
||||
--justfolders --nofoldersizes \
|
||||
--delete2foldersbutnot '/NEW_2|NEW_3|\[abc\]/' \
|
||||
--delete2foldersbutnot 'm{NEW_2|NEW_3|\[abc\]}' \
|
||||
--dry
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue