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 2012-04-16 17:33:16 -05:00
parent 74ca16d8c6
commit 1466872026
14 changed files with 1244 additions and 46 deletions

10
CREDITS
View File

@ -1,5 +1,5 @@
#!/bin/cat
# $Id: CREDITS,v 1.167 2012/02/07 00:22:01 gilles Exp gilles $
# $Id: CREDITS,v 1.168 2012/02/19 22:26:00 gilles Exp gilles $
If you want to make a donation to the author, Gilles LAMIRAL,
use any of the following ways:
@ -30,7 +30,13 @@ 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.
? (Found no card in the packet may be lost since book is damaged, amazon and paper box for an international transported book ...)
Pierre GUILLAUME // e-Lixir
Fixed 2 bugs about [Gmail] folder names.
one is about $cache_dir and bsd_globs() that needs escaped characters.
Second is eval and --delete2foldersonly --delete2foldersbutnot that need
also good escaping. Thanks.
? (Found no card in the packet; may be lost since book is damaged, amazon and paper box for an international transported book ...)
Contributed by giving the book
87.18 "Paradigms of Artificial Intelligence Programming: Case Studies in Common Lisp"

View File

@ -1,17 +1,32 @@
RCS file: RCS/imapsync,v
Working file: imapsync
head: 1.484
head: 1.487
branch:
locks: strict
gilles: 1.484
gilles: 1.487
access list:
symbolic names:
keyword substitution: kv
total revisions: 484; selected revisions: 484
total revisions: 487; selected revisions: 487
description:
----------------------------
revision 1.484 locked by: gilles;
revision 1.487 locked by: gilles;
date: 2012/02/29 05:29:21; author: gilles; state: Exp; lines: +7 -7
Fixed a useless Perl warning.
----------------------------
revision 1.486
date: 2012/02/23 23:05:49; author: gilles; state: Exp; lines: +10 -10
Removed "Memory/biggest message ratio" in final stats, useless now.
Fixed a warning about memory_consumption when the call fails.
----------------------------
revision 1.485
date: 2012/02/19 22:24:23; author: gilles; state: Exp; lines: +16 -12
Applied Pierre GUILLAUME patch about
1) $cache_dir and bsd_globs() that needs escaped characters.
2) eval and --delete2foldersonly --delete2foldersbutnot that need also good escaping. Thanks Pierre.
----------------------------
revision 1.484
date: 2012/02/07 00:19:33; author: gilles; state: Exp; lines: +8 -7
Just a comment about examine versus select on host1.
----------------------------

17
FAQ
View File

@ -1,10 +1,12 @@
#!/bin/cat
# $Id: FAQ,v 1.102 2012/01/08 06:40:50 gilles Exp gilles $
# $Id: FAQ,v 1.104 2012/02/20 18:23:29 gilles Exp gilles $
+------------------+
| FAQ for imapsync |
+------------------+
http://imapsync.lamiral.info/FAQ
Unix versus Windows syntax.
A) \ versus ^
@ -503,6 +505,19 @@ you have to enter
imapsync ... --password1 "$%%&<>|^"^"
=======================================================================
Q. On Windows, some passwords begin with an equal = character.
Login fails. What can I do?
R. Use twice equals == characters instead; For example, if =secret
is the password then use:
imapsync ... --password1 ==secret
or even
imapsync ... --password1 "==secret"
=======================================================================
Q. With huge account (many messages) when it comes to reading the
destination server it comes out this error:

4
README
View File

@ -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.484 $
$Revision: 1.487 $
SYNOPSIS
To synchronise imap account "foo" on "imap.truc.org" to imap account
@ -444,5 +444,5 @@ SIMILAR SOFTWARES
Feedback (good or bad) will often be welcome.
$Id: imapsync,v 1.484 2012/02/07 00:19:33 gilles Exp gilles $
$Id: imapsync,v 1.487 2012/02/29 05:29:21 gilles Exp gilles $

View File

@ -1 +1 @@
1.484
1.487

View File

@ -1 +1 @@
1.484
1.487

View File

@ -1,14 +1,14 @@
#!/bin/sh
# $Id: memo,v 1.5 2011/05/20 12:57:31 gilles Exp gilles $
# $Id: memo,v 1.6 2012/02/24 12:23:38 gilles Exp gilles $
echo paypal_bilan_tests_invoice
paypal_bilan_tests_invoice() {
# DID output no diff between paypal_bilan_1.43 and 1.??
# DID output no diff between paypal_bilan_1.46 and 1.47
(
#set -x
/g/public_html/imapsync/W/paypal_reply/paypal_bilan_1.44 --bnc --debug --debug_invoice --first_in 147 --avoid_numbers '292 293 643 644 731 732 1093 1330 1331 1332 1333 1334' /g/paypal/paypal_201?_??_complet.csv \
/g/public_html/imapsync/W/paypal_reply/paypal_bilan_1.46 --bnc --debug --debug_invoice --first_in 147 --avoid_numbers '292 293 643 644 731 732 1093 1330 1331 1332 1333 1334' /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' /g/paypal/paypal_201?_??_complet.csv \
> /g/var/paypal_bilan/tests/paypal_invoice.out2 2>&1

View File

@ -1,6 +1,6 @@
#!/usr/bin/perl
# $Id: paypal_bilan,v 1.45 2012/01/30 03:12:55 gilles Exp gilles $
# $Id: paypal_bilan,v 1.47 2012/02/24 12:22:05 gilles Exp gilles $
use strict;
use warnings;
@ -27,6 +27,7 @@ my $total_eur_invoice = 0 ;
my $nb_invoice = 0 ;
my $nb_invoice_refund = 0 ;
my $nb_invoice_suspended = 0 ;
my $nb_invoice_canceled = 0 ;
my ( $tests, $testeur ) ;
my $debug ;
@ -41,6 +42,7 @@ my $bnc = '' ;
my $usdeur = 1.2981 ;
my $invoices ;
my %invoice_refund ;
my %invoice_canceled ;
my %invoice_suspended ;
my $write_invoices = 0 ;
my $avoid_numbers ;
@ -148,6 +150,10 @@ foreach my $invoice ( @invoices_wanted ) {
my $nb_invoice_sent = scalar( @invoice_sent ) ;
@invoice_not_sent = sort { $a <=> $b } keys( %invoice_not_sent ) ;
my @invoice_canceled = sort { $a <=> $b } keys( %invoice_canceled ) ;
my @invoice_suspended = sort { $a <=> $b } keys( %invoice_suspended ) ;
my @invoice_refund = sort { $a <=> $b } keys( %invoice_refund ) ;
print "USD banque $total_usd_received\n" ;
print "USD invoice $total_usd_invoice\n" ;
my $total_eur_from_usd ;
@ -174,8 +180,9 @@ print "EUR total TVA $total_TVA_EUR\n" ;
print "EUR total HT sup $total_HT_EUR_sup\n" ;
print "EUR total TVA sup $total_TVA_EUR_sup\n" ;
print "Nb invoice $nb_invoice ( from $first_invoice_paypal to $last_invoice )\n" ;
print "Nb invoice refund $nb_invoice_refund\n" ;
print "Nb invoice suspended $nb_invoice_suspended\n" ;
print "Nb invoice canceled $nb_invoice_canceled @invoice_canceled\n" ;
print "Nb invoice suspended $nb_invoice_suspended @invoice_suspended\n" ;
print "Nb invoice refund $nb_invoice_refund @invoice_refund\n" ;
print "Nb invoice sent $nb_invoice_sent\n" ;
print "Have to send invoices @invoice_not_sent\n" if ( @invoice_not_sent ) ;
@ -420,7 +427,6 @@ sub compute_line {
and 'EUR' eq $Devise
and 'Remboursé' eq $Etat
) {
#$invoice = $first_invoice + $nb_invoice ;
$invoice = next_invoice( ) ;
$nb_invoice++ ;
$nb_invoice_refund++;
@ -429,12 +435,24 @@ sub compute_line {
$print_details and print ( "[$invoice] [$Date] [$Heure] [$Fuseau_horaire] [$Nom] [$Type] [$Etat] [$Devise] [$Montant] [$Numero_davis_de_reception] [$Solde]\n" ) ;
}
if (
'Paiement sur site marchand reçu' eq $Type
and 'EUR' eq $Devise
and 'Annulé' eq $Etat
) {
$invoice = next_invoice( ) ;
$nb_invoice++ ;
$nb_invoice_canceled++;
$invoice_canceled{ $invoice }++ ;
$print_details and print ( "[$invoice] [$Date] [$Heure] [$Fuseau_horaire] [$Nom] [$Type] [$Etat] [$Devise] [$Montant] [$Numero_davis_de_reception] [$Solde]\n" ) ;
}
if (
'Paiement sur site marchand reçu' eq $Type
and 'EUR' eq $Devise
and 'Suspendu' eq $Etat
) {
#$invoice = $first_invoice + $nb_invoice ;
$invoice = next_invoice( ) ;
$nb_invoice++ ;
$nb_invoice_suspended++;
@ -448,7 +466,6 @@ sub compute_line {
and 'EUR' eq $Devise
and 'Non compensé' eq $Etat
) {
#$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]\n" ) ;

1123
W/paypal_reply/paypal_bilan_1.46 Executable file

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
#!/bin/sh
# $Id: paypal_build_invoices,v 1.24 2012/01/28 02:19:43 gilles Exp gilles $
# $Id: paypal_build_invoices,v 1.26 2012/02/24 12:32:56 gilles Exp gilles $
# usage: sh paypal_build_invoices /g/var/paypal_invoices/????
@ -23,6 +23,7 @@ set -x
#/g/public_html/imapsync/W/paypal_reply/paypal_bilan --write_invoices --first_in 1185 /g/paypal/paypal_2011_11_complet.csv
#/g/public_html/imapsync/W/paypal_reply/paypal_bilan --write_invoices --first_in 1263 /g/paypal/paypal_2011_12_complet.csv
/g/public_html/imapsync/W/paypal_reply/paypal_bilan --write_invoices --first_in 1335 /g/paypal/paypal_2012_01_complet.csv
/g/public_html/imapsync/W/paypal_reply/paypal_bilan --write_invoices --first_in 1417 /g/paypal/paypal_2012_02_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
@ -38,6 +39,7 @@ set -x
: /g/public_html/imapsync/W/paypal_reply/paypal_bilan --first_in 1185 /g/paypal/paypal_2011_11_complet.csv
: /g/public_html/imapsync/W/paypal_reply/paypal_bilan --first_in 1263 /g/paypal/paypal_2011_12_complet.csv
: /g/public_html/imapsync/W/paypal_reply/paypal_bilan --first_in 1335 /g/paypal/paypal_2012_01_complet.csv
: /g/public_html/imapsync/W/paypal_reply/paypal_bilan --first_in 1417 /g/paypal/paypal_2012_02_complet.csv
set +x
# La totale

View File

@ -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.484 $
$Revision: 1.487 $
=head1 SYNOPSIS
@ -519,7 +519,7 @@ Entries for imapsync:
Feedback (good or bad) will often be welcome.
$Id: imapsync,v 1.484 2012/02/07 00:19:33 gilles Exp gilles $
$Id: imapsync,v 1.487 2012/02/29 05:29:21 gilles Exp gilles $
=cut
@ -636,7 +636,7 @@ my(
# global variables initialisation
$rcs = '$Id: imapsync,v 1.484 2012/02/07 00:19:33 gilles Exp gilles $ ';
$rcs = '$Id: imapsync,v 1.487 2012/02/29 05:29:21 gilles Exp gilles $ ';
$total_bytes_transferred = 0;
$total_bytes_skipped = 0;
@ -1377,7 +1377,7 @@ FOLDER: foreach my $h1_fold (@h1_folders_wanted) {
my $h2_msg = $cache_1_2_ref->{ $h1_msg } ;
$debugcache and print "cache messages update flags $h1_msg->$h2_msg\n";
sync_flags( $h1_fold, $h1_msg, $h2_fold, $h2_msg, $permanentflags2, $h1_fir_ref, $h2_fir_ref ) ;
my $h1_size = $h1_fir_ref->{ $h1_msg }->{ 'RFC822.SIZE' } ;
my $h1_size = $h1_fir_ref->{ $h1_msg }->{ 'RFC822.SIZE' } || 0 ;
$total_bytes_skipped += $h1_size;
$nb_msg_skipped += 1;
}
@ -1399,7 +1399,7 @@ FOLDER: foreach my $h1_fold (@h1_folders_wanted) {
unless($dry) { $imap2->expunge() };
}
$debug and print "Time: ", timenext(), " s\n";
$debug and print "Time: ", timenext(), " s\n";
}
sub total_bytes_max_reached {
@ -1868,8 +1868,8 @@ sub banner_imapsync {
my @argv_copy = @_;
my $banner_imapsync = join("",
'$RCSfile: imapsync,v $ ',
'$Revision: 1.484 $ ',
'$Date: 2012/02/07 00:19:33 $ ',
'$Revision: 1.487 $ ',
'$Date: 2012/02/29 05:29:21 $ ',
"\n",localhost_info(), "\n",
"Command line used:\n",
"$0 ", command_line_nopassword(@argv_copy), "\n",
@ -2874,14 +2874,18 @@ sub tests_cache_map {
}
sub get_cache {
sub get_cache {
$debugcache and print "Entering get_cache\n";
my ( $cache_dir, $h1_msgs_ref, $h2_msgs_ref, $h1_msgs_all_hash_ref, $h2_msgs_all_hash_ref ) = @_;
-d $cache_dir or return( undef ); # exit if cache directory doesn't exist
$debugcache and print "cache_dir: $cache_dir\n";
$debugcache and print "cache_dir : $cache_dir\n";
$cache_dir =~ s{\\}{\\\\}g;
#$cache_dir =~ s{\\}{\\\\}g;
$cache_dir =~ s/([;<>\*\|`&\$!#\(\)\[\]\{\}:'"\\])/\\$1/g ;
$debugcache and print "cache_dir fix: $cache_dir\n";
my @cache_files = bsd_glob( "$cache_dir/*" ) ;
#$debugcache and print "cache_files: [@cache_files]\n";
@ -3312,7 +3316,7 @@ sub stats {
my $timestart_str = localtime( $timestart ) ;
my $timeend_str = localtime( $timeend ) ;
my $memory_consumption = memory_consumption();
my $memory_consumption = memory_consumption( ) || 0 ;
my $memory_ratio = ($max_msg_size_in_bytes) ?
sprintf('%.1f', $memory_consumption / $max_msg_size_in_bytes) : "NA";
@ -3345,7 +3349,7 @@ sub stats {
print "Reconnections to host2 : $host2_reconnect_count\n";
printf ("Memory consumption : %.1f MB\n", $memory_consumption / 1024 / 1024);
print "Biggest message : $max_msg_size_in_bytes bytes\n";
print "Memory/biggest message ratio : $memory_ratio\n";
# print "Memory/biggest message ratio : $memory_ratio\n";
print "Detected $nb_errors errors\n\n";
print $warn_release, "\n";
@ -3670,7 +3674,7 @@ sub check_last_release {
}
sub imapsync_version {
my $rcs = '$Id: imapsync,v 1.484 2012/02/07 00:19:33 gilles Exp gilles $ ';
my $rcs = '$Id: imapsync,v 1.487 2012/02/29 05:29:21 gilles Exp gilles $ ';
$rcs =~ m/,v (\d+\.\d+)/;
my $VERSION = ($1) ? $1: "UNKNOWN";
return($VERSION);
@ -3973,7 +3977,7 @@ EOF
sub memory_consumption {
# memory consumed by imapsync until now in bytes
return((memory_consumption_of_pids())[0]);
return( ( memory_consumption_of_pids( ) )[0] );
}
sub memory_consumption_of_pids {
@ -4253,16 +4257,16 @@ sub list_folders_in_2_not_in_1 {
return( reverse @h2_folders_not_in_1 );
}
sub delete_folders_in_2_not_in_1 {
sub delete_folders_in_2_not_in_1 {
my $dry_message = '';
$dry_message = "\t(not really since --dry mode)" if $dry;
foreach my $folder (@h2_folders_not_in_1) {
if ( defined($delete2foldersonly) and eval("\$folder !~ $delete2foldersonly" ) ) {
if ( defined( $delete2foldersonly ) and eval( "\$folder !~ \$delete2foldersonly" ) ) {
print "Not deleting $folder because of --delete2foldersonly $delete2foldersonly\n";
next;
}
if ( defined($delete2foldersbutnot) and eval("\$folder =~ $delete2foldersbutnot" ) ) {
if ( defined( $delete2foldersbutnot ) and eval( "\$folder =~ \$delete2foldersbutnot" ) ) {
print "Not deleting $folder because of --delete2foldersbutnot $delete2foldersbutnot\n";
next;
}

View File

@ -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-02-07T11:52:59+0100"/>
<meta name="date" content="2012-02-20T18:40:26+0100"/>
<meta name="copyright" content="None"/>
<meta name="keywords" content="imap, transfert, migration"/>
<meta name="description" content="imap migration tool"/>
@ -168,7 +168,7 @@ See <b><a href="./file.txt">file.txt</a></b> example for <b>batch massive migrat
<h2><a id="buy_source"></a>Buy imapsync source code</h2>
<p>Buy <b>latest</b> imapsync Perl <b>source code</b> for <b>30 EUR</b>
<p>Buy <b>latest</b> imapsync Perl <b>source code</b> for <b>42 EUR</b>
</p>
<p>
@ -178,7 +178,7 @@ See <b><a href="./file.txt">file.txt</a></b> example for <b>batch massive migrat
</p>
<p>
30 EUR is equal to around <b>40 USD</b>, no problem to pay in USD (or any currency) with paypal:
42 EUR is equal to around <b>54 USD</b>, no problem to pay in USD (or any currency) with paypal:
</p>
<p>
@ -233,7 +233,7 @@ name="submit" alt="PayPal - The safer, easier way to pay online!"/>
<p>Struggle free from source code and Perl installation by<br/>
buying the latest win32 <b>standalone imapsync.exe</b> for <b>30 EUR</b>
buying the latest win32 <b>standalone imapsync.exe</b> for <b>42 EUR</b>
</p>
<p>
@ -244,7 +244,7 @@ buying the latest win32 <b>standalone imapsync.exe</b> for <b>30 EUR</b>
<p>
30 EUR is equal to around <b>40 USD</b>, no problem to pay in USD (or any currency) with paypal:
42 EUR is equal to around <b>54 USD</b>, no problem to pay in USD (or any currency) with paypal:
</p>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
@ -476,10 +476,12 @@ Prices are given par mailbox and may be outdated (december 2011).</p>
<ul>
<li> Ovh imapcopy (French) <b>0 USD</b>: <a href="https://ssl0.ovh.net/fr/imapcopy/">https://ssl0.ovh.net/fr/imapcopy/</a></li>
<li> Movemymail free for the first and 5 USD thereafter: <a href="https://movemymail.net">https://movemymail.net</a> .</li>
<li> Mailbox Mover 7 USD: <a href="https://mailboxmover.com/">https://mailboxmover.com/</a></li>
<li> Migrationwiz 10 USD: <a href="http://www.migrationwiz.com/">http://www.migrationwiz.com/</a></li>
<li> Rackspace migration 10 USD: <a href="http://www.rackspace.com/apps/email_hosting/migrations/">http://www.rackspace.com/apps/email_hosting/migrations/</a></li>
<li> Yippiemove 15 USD: <a href="http://www.yippiemove.com">http://www.yippiemove.com/</a></li>
<li>Trueswitch 29.5 USD: <a href="http://www.trueswitch.com">http://www.trueswitch.com</a></li>
</ul>
<hr/>
@ -508,7 +510,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.109 2012/02/07 10:54:11 gilles Exp gilles $)
($Id: index.shtml,v 1.112 2012/02/20 18:23:06 gilles Exp gilles $)
</p>
</body>

View File

@ -1,5 +1,5 @@
REM $Id: test2.bat,v 1.7 2012/01/08 06:39:12 gilles Exp gilles $
REM $Id: test2.bat,v 1.8 2012/02/25 14:42:23 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,3 +26,6 @@ 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

View File

@ -1,6 +1,6 @@
#!/bin/sh
# $Id: tests.sh,v 1.191 2012/02/07 09:27:17 gilles Exp gilles $
# $Id: tests.sh,v 1.192 2012/02/25 14:41:47 gilles Exp gilles $
# Example 1:
# CMD_PERL='perl -I./Mail-IMAPClient-3.25/lib' sh -x tests.sh
@ -1969,6 +1969,17 @@ ll_justlogin_dollar_char() {
--justlogin
}
ll_justlogin_equal_char() {
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 equal \
--passfile2 ../../var/pass/secret.equal \
--justlogin --debugimap2
}
ll_usecache() {
if can_send; then