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 2011-04-24 16:19:36 -05:00
parent 02322d6ed1
commit 09dfa9982d
72 changed files with 11829 additions and 287 deletions

26
CREDITS
View File

@ -1,5 +1,5 @@
#!/bin/cat
# $Id: CREDITS,v 1.155 2011/01/23 23:39:54 gilles Exp gilles $
# $Id: CREDITS,v 1.156 2011/03/15 00:51:57 gilles Exp gilles $
If you want to make a donation to the author, Gilles LAMIRAL,
use any of the following ways:
@ -30,6 +30,21 @@ 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.
Khalid Shakir
Contributed by giving the book
75.00 "Selected Papers on Fun and Games [Hardcover]"
Alexander J. Stein
Contributed by giving the book
22.00 "Weinberg on Writing: The Fieldstone Method"
Doug Ferguson
Contributed by giving the books
35.16 "Test Driven Development: By Example"
13.86 "Gödel, Escher, Bach: An Eternal Golden Braid"
14.49 "The Mind's I: Fantasies and Reflections on Self & Soul"
46.42 "Memory"
Timothy Jay Chambers
Contributed by giving the book
27.32 "Mathematics and Plausible Reasoning: Volume II Patterns of Plausible Inference"
@ -981,6 +996,13 @@ Eric Yung
Total amount of book prices :
c \
75.00+\
\
35.16+\
13.86+\
14.49+\
46.42+\
\
27.32+\
40.90+\
\
@ -1102,4 +1124,4 @@ c \
31.20+\
40.00
=
2779.03
2963.96

View File

@ -1,17 +1,49 @@
RCS file: RCS/imapsync,v
Working file: imapsync
head: 1.404
head: 1.411
branch:
locks: strict
gilles: 1.404
gilles: 1.411
access list:
symbolic names:
keyword substitution: kv
total revisions: 404; selected revisions: 404
total revisions: 411; selected revisions: 411
description:
----------------------------
revision 1.404 locked by: gilles;
revision 1.411 locked by: gilles;
date: 2011/04/19 23:34:30; author: gilles; state: Exp; lines: +19 -11
Bugfix for "Folders in host2 not in host1" list when folders are given by --folder option or equivalent.
The old list listed too many folders with --folder INBOX for example.
----------------------------
revision 1.410
date: 2011/04/19 23:11:42; author: gilles; state: Exp; lines: +9 -8
Updated success list.
----------------------------
revision 1.409
date: 2011/04/16 20:15:05; author: gilles; state: Exp; lines: +7 -6
Added --takebody option.
----------------------------
revision 1.408
date: 2011/04/11 01:37:34; author: gilles; state: Exp; lines: +9 -8
Added Gimap (Gmail imap) success.
Added IMail 11.03 [host1] success
----------------------------
revision 1.407
date: 2011/04/02 23:07:09; author: gilles; state: Exp; lines: +21 -12
Made --delete2 works with --uselib or --usecache
----------------------------
revision 1.406
date: 2011/03/10 01:35:57; author: gilles; state: Exp; lines: +15 -13
No longer --useuid with --fast
Debug output with permanentflags.
----------------------------
revision 1.405
date: 2011/03/07 13:41:54; author: gilles; state: Exp; lines: +13 -11
Added isync url.
Sleep 2 seconds after foldersizes calls.
----------------------------
revision 1.404
date: 2011/02/21 03:35:39; author: gilles; state: Exp; lines: +7 -7
typo
----------------------------

64
FAQ
View File

@ -1,5 +1,5 @@
#!/bin/cat
# $Id: FAQ,v 1.83 2011/01/28 05:14:12 gilles Exp gilles $
# $Id: FAQ,v 1.85 2011/02/28 16:02:17 gilles Exp gilles $
+------------------+
| FAQ for imapsync |
@ -24,7 +24,7 @@ R. http://www.linux-france.org/prj/imapsync/FAQ
Q. How can I have commercial support?
R. Ask the imapsync author and expert: Gilles LAMIRAL
Rates per hour (2010) : 81 euros (111 USD)
Rates per hour (2011) : 84 euros (111 USD)
=======================================================================
Q. How can I have gratis support?
@ -81,7 +81,7 @@ http://www.faqs.org/rfcs/rfc4549.html
=======================================================================
Q. Where I can find old imapsync releases?
R. ftp://www.linux-france.org/pub/prj/imapsync/
R. Search the internet.
=======================================================================
Q. How can I try imapsync with the new Mail::IMAPClient 3.xx perl library?
@ -103,8 +103,7 @@ R. - Download latest Mail::IMAPClient 3.xx at
perl -I./Mail-IMAPClient-3.23/lib /path/imapsync ...
=======================================================================
Q. imapsync does not work with Mail::IMAPClient 3.xx
How can I downgrade to 2.2.9 release?
Q. How can I use imapsync with Mail::IMAPClient 2.2.9 perl module?
R. - Download Mail::IMAPClient 2.2.9 at
http://search.cpan.org/~djkernen/Mail-IMAPClient-2.2.9/
@ -119,12 +118,18 @@ R. - Download Mail::IMAPClient 2.2.9 at
perl -I./Mail-IMAPClient-2.2.9 /path/imapsync [...]
=======================================================================
Q. Can I use imapsync to migrate emails from pop server to imap server?
Q. Can I use imapsync to migrate emails from pop3 server to imap server?
R. No.
R1. No.
You can migrate emails from pop server to imap server with pop2imap:
http://www.linux-france.org/prj/pop2imap/
R2. Yes
Many pop3 servers runs in parallel with an imap server on the
exactly the same mailboxes. They serve the same INBOX
(imap serves INBOX and several other folders, pop3 serves only INBOX)
So have a try with imapsync on the same host1.
=======================================================================
Q. I am interested in creating a local clone of the IMAP on a LAN
server for faster synchronisations, email will always be delivered
@ -178,18 +183,35 @@ d) Use the --syncinternaldates option and keep using Eudora.
Q. imapsync calculates 479 messages in a folder but only transfers 400
messages. What's happen?
R. imapsync considers the header part of a message (as a whole or
R1. imapsync considers the header part of a message (as a whole or
only specific lines depending on --useheader --skipheader)
to identify a message on both sides.
Two consequences:
Consequences:
1) Messages with no header are not transferred.
2) Duplicate messages (identical header) are not transferred
1) Duplicate messages (identical header) are not transferred
several times.
The result is that you can have more messages on host1 than on host2.
R2. With option --useuid imapsync doesn't use headers to identify
messages on both sides but it uses their imap uid. In than case
duplicates are transfered and --delete2 won't work.
=======================================================================
Q. I run multiple imapsync applications at the same time then get a
warning "imapsync.pid already exists, overwriting it".
Is this a potential problem when trying to sync multiple
IMAP account in parallel?
R1. No issue with the file imapsync.pid if you don't use its content.
This file can help you to manage multiple runs by sending
signals to the processes (sigterm or sigkill) using their PID,
each run can have its own pid file with --pidfile option.
The file imapsync.pid contains the PID of the imapsync process.
This file is removed at the end of a normal run.
You can saafely ignore the warning if you don't use imapsync.pid.
=======================================================================
Q. Couldn't create [INBOX.Ops/foo/bar]: NO Invalid mailbox name:
INBOX.Ops/foo/bar
@ -208,7 +230,7 @@ Sometimes the sep1 character is not valid on host2 (character "/" usualy)
R. Try :
--regextrans2 's,/,X,g'
--regextrans2 "s,/,X,g"
It'll convert / character to X
Choose X as you wish: _ or SEP or
@ -267,7 +289,7 @@ R. For some servers, flags have to begin with a \ character.
The flag "NonJunk" may be a invalid flag for your server
so use for example:
imapsync ... --regexflag 's/NonJunk//g'
imapsync ... --regexflag "s/NonJunk//g"
Remark (thanks to Arnt Gulbrandsen):
IMAP system flags have to begin with \ character.
@ -1157,19 +1179,3 @@ Q: How can I write an .rpm with imapsync
R: I don't know but Neil Brown wrote one rpm package and you'll find
his .spec file here :
http://www.linux-france.org/prj/imapsync/learn/rpm/
======================================================================
Q: Problems on win32, Timezone and Date::Manip
R: Comment the code like the following
if ($syncinternaldates) {
$d = $f_idate;
$debug and print "internal date from 1: [$d]\n";
#require Date::Manip;
#Date::Manip->import(qw(ParseDate Date_Cmp UnixDate));
#$d = UnixDate(ParseDate($d), "%d %b %Y %H:%M:%S %z");
#$d = "\"$d\"";
#$debug and print "internal date from 1: [$d] (fixed)\n";
}

View File

@ -5,6 +5,21 @@ Changes from 2.99_01 to 3.16 made by Mark Overmeer
Changes from 0.09 to 2.99_01 made by David Kernen
- Potential compatibility issues from 3.17+ highlighted with '*'
version 3.28_04: Fri Mar 4 00:17:38 EST 2011
- rt.cpan.org#66004: internaldate() return undef if no internaldate in reply
[Jason Long]
- rt.cpan.org#66367: fetch_hash uses Escaped_results() in 3.26/3.27
(redo) rt.cpan.org#63524: fetch_hash() parse errors
[Mathias Reitinger]
+ fetch_hash: only Escape() data in parenthesized list
+ update fetch_hash test and add a new test
- do not touch CRLF in Escape()/Unescape()
- added Escape() method
- rt.cpan.org#66287: flags results truncated due to Maxcommandlength
[Erik Colson]
- rt.cpan.org#65694: SASL PLAIN: bad order of login data
[Willi Mann]
version 3.27: Sun Feb 13 14:37:27 EST 2011
- rt.cpan.org#65694: migrate fails
[Erik Colson]

View File

@ -1,6 +1,6 @@
--- #YAML:1.0
name: Mail-IMAPClient
version: 3.27
version: 3.28
abstract: IMAP4 client library
author:
- Phil Pearl (Lobbes) <phil@zimbra.com>

View File

@ -7,7 +7,7 @@ use strict;
use warnings;
package Mail::IMAPClient;
our $VERSION = '3.27';
our $VERSION = '3.28';
use Mail::IMAPClient::MessageSet;
@ -1708,7 +1708,7 @@ sub Escaped_results {
# literal is appended to previous data
if ( $self->_is_literal($line) ) {
$data =~ s/([\\\(\)"$CRLF])/\\$1/og;
$data = $self->Escape($data);
$a[-1] .= qq( "$data");
$prevwasliteral = 1;
}
@ -1726,10 +1726,16 @@ sub Escaped_results {
return wantarray ? @a : \@a;
}
sub Escape {
my $data = $_[1];
$data =~ s/([\\\"])/\\$1/og;
return $data;
}
sub Unescape {
my $whatever = $_[1];
$whatever =~ s/\\([\\\(\)"$CRLF])/$1/og;
$whatever;
my $data = $_[1];
$data =~ s/\\([\\\"])/$1/og;
return $data;
}
sub logout {
@ -2001,7 +2007,7 @@ s/([\( ])FULL([\) ])/${1}FLAGS INTERNALDATE RFC822\.SIZE ENVELOPE BODY$2/i;
}
my %words = map { uc($_) => 1 } @words;
my $output = $self->fetch( { escaped => 1 }, $msgs, "($what)" )
my $output = $self->fetch( $msgs, "($what)" )
or return undef;
while ( my $l = shift @$output ) {
@ -2025,7 +2031,7 @@ s/([\( ])FULL([\) ])/${1}FLAGS INTERNALDATE RFC822\.SIZE ENVELOPE BODY$2/i;
$l = shift @$output;
next ATTR;
}
elsif ( $l =~ m/\G(?:"([^"]+)"|([^()\s]+))\s*/gc ) {
elsif ( $l =~ m/\G(?:"(.*?)(?:(?<!\\)")|([^()\s]+))\s*/gc ) {
$value = defined $1 ? $1 : $2;
$entry->{$key} = $value;
next ATTR;
@ -2050,6 +2056,13 @@ s/([\( ])FULL([\) ])/${1}FLAGS INTERNALDATE RFC822\.SIZE ENVELOPE BODY$2/i;
else {
$value .= $stuff;
}
# consume literal data if any
if ( $l =~ m/\G\s*$/gc and scalar(@$output) ) {
my $elit = $self->Escape( shift @$output );
$l = shift @$output;
$value .= ( length($value) ? " " : "" ) . qq{"$elit"};
}
}
$l =~ m/\G\s*/gc;
}
@ -2207,13 +2220,13 @@ sub flags {
$msg->cat(@_) if @_;
# Send command
$self->fetch( $msg, "FLAGS" ) or return undef;
my $ref = $self->fetch( $msg, "FLAGS" ) or return undef;
my $u_f = $self->Uid;
my $flagset = {};
# Parse results, setting entry in result hash for each line
foreach my $line ( $self->Results ) {
foreach my $line (@$ref) {
$self->_debug("flags: line = '$line'");
if (
$line =~ /\* \s+ (\d+) \s+ FETCH \s+ # * nnn FETCH
@ -2661,10 +2674,8 @@ sub internaldate {
my ( $self, $msg ) = @_;
$self->_imap_uid_command( FETCH => $msg, 'INTERNALDATE' )
or return undef;
my $internalDate = join '', $self->History;
$internalDate =~ s/^.*INTERNALDATE "//si;
$internalDate =~ s/\".*$//s;
$internalDate;
my $hist = join '', $self->History;
return $hist =~ /\bINTERNALDATE "([^"]*)"/i ? $1 : undef;
}
sub is_parent {
@ -2973,13 +2984,14 @@ sub authenticate {
elsif ( $scheme eq 'PLAIN' ) { # PLAIN SASL
$response ||= sub {
my ( $code, $client ) = @_;
encode_base64(
$client->User
. chr(0)
. $client->Proxy
. chr(0)
. $client->Password,
''
encode_base64( # [authname] user password
join(
chr(0),
defined $client->Proxy
? ( $client->User, $client->Proxy )
: ( "", $client->User ),
defined $client->Password ? $client->Password : "",
),
);
};
}

View File

@ -94,7 +94,13 @@ CRAM-MD5 requires the L<Digest::HMAC_MD5> module.
=item PLAIN (SASL)
PLAIN (SASL) authentication requires the use of the L</Proxy> parameter.
PLAIN (SASL) authentication allows the optional use of the L</Proxy>
parameter. RFC 4616 documents this syntax for SASL PLAIN:
message = [authzid] UTF8NUL authcid UTF8NUL passwd
When L</Proxy> is defined, L</User> is used as 'authzid' and L</Proxy>
is used as 'authcid'. Otherwise, L</User> is used as 'authcid'.
=item NTLM
@ -1056,16 +1062,14 @@ This would result in L<Data::Dumper> output similar to the following:
}
};
By itself this method may be useful for, say, speeding up programs that
want the size of every message in a folder. It issues one command and
receives one (possibly long!) response from the server. However, it's
true power lies in the as-yet-unwritten methods that will rely on this
method to deliver even more powerful result hashes. Look for more new
function in later releases.
By itself this method may be useful for tasks like obtaining the size
of every message in a folder. It issues one command and receives one
(possibly long!) response from the server.
This method is new with version 2.2.3 and is thus still experimental.
If you decide to try this method and run into problems, please see the
section on L</REPORTING BUGS>.
If the fetch request causes the server to return data in a
parenthesized list, the data within the parenthesized list may be
escaped via the Escape() method. Use the Unescape() method to get the
raw values back in this case.
=head2 flags
@ -1308,7 +1312,8 @@ Example:
or die "Could not internaldate: $@\n";
B<internaldate> accepts one argument, a message id (or UID if the
L</Uid> parameter is true), and returns that message's internal date.
L</Uid> parameter is true), and returns that message's internal date
or undef if the call fails or internal date is not returned.
=head2 get_bodystructure

View File

@ -9,7 +9,7 @@
use strict;
use warnings;
use Test::More tests => 19;
use Test::More tests => 20;
BEGIN { use_ok('Mail::IMAPClient') or exit; }
@ -100,26 +100,56 @@ my @tests = (
],
[
"BODY.PEEK[] requests match BODY[] responses",
[ q{* 1 FETCH (BODY[] foo)} ],
[q{* 1 FETCH (BODY[] foo)}],
[ [1], qw(BODY.PEEK[]) ],
{ "1" => { "BODY[]" => q{foo}, }, },
],
[
"BODY.PEEK[] requests match BODY.PEEK[] responses also",
[ q{* 1 FETCH (BODY.PEEK[] foo)} ],
[q{* 1 FETCH (BODY.PEEK[] foo)}],
[ [1], qw(BODY.PEEK[]) ],
{ "1" => { "BODY.PEEK[]" => q{foo}, }, },
],
[
"escaped subject",
[ q{* 1 FETCH (UID 1 X-SAVEDATE "28-Jan-2011 16:52:31 -0500" FLAGS (\Seen) ENVELOPE ("Fri, 28 Jan 2011 00:03:30 -0500" "foo \\"bar\\" baz\'s" (("Phil Pearl" NIL "phil" "dom.loc")) (("Phil Pearl" NIL "phil" "dom.loc")) (("Phil Pearl" NIL "phil" "dom.loc")) ((NIL NIL "phil" "dom.loc")) NIL NIL NIL "<msgid>")) } ],
"escaped ENVELOPE subject",
[
q{* 1 FETCH (UID 1 X-SAVEDATE "28-Jan-2011 16:52:31 -0500" FLAGS (\Seen) ENVELOPE ("Fri, 28 Jan 2011 00:03:30 -0500"},
q{foo "bar\\" (baz\\)},
q{ (("Phil Pearl" NIL "phil" "dom.loc")) (("Phil Pearl" NIL "phil" "dom.loc")) (("Phil Pearl" NIL "phil" "dom.loc")) ((NIL NIL "phil" "dom.loc")) NIL NIL NIL "<msgid>")) }
],
[ [1], qw(UID X-SAVEDATE FLAGS ENVELOPE) ],
{
"1" => {
'X-SAVEDATE' => '28-Jan-2011 16:52:31 -0500',
'UID' => '1',
'FLAGS' => '\\Seen',
'ENVELOPE' => q{"Fri, 28 Jan 2011 00:03:30 -0500" "foo \\"bar\\" baz\'s" (("Phil Pearl" NIL "phil" "dom.loc")) (("Phil Pearl" NIL "phil" "dom.loc")) (("Phil Pearl" NIL "phil" "dom.loc")) ((NIL NIL "phil" "dom.loc")) NIL NIL NIL "<msgid>"}
'UID' => '1',
'FLAGS' => '\\Seen',
'ENVELOPE' =>
q{"Fri, 28 Jan 2011 00:03:30 -0500" "foo \\"bar\\\\\\" (baz\\\\)" (("Phil Pearl" NIL "phil" "dom.loc")) (("Phil Pearl" NIL "phil" "dom.loc")) (("Phil Pearl" NIL "phil" "dom.loc")) ((NIL NIL "phil" "dom.loc")) NIL NIL NIL "<msgid>"}
},
},
],
[
"non-escaped BODY[HEADER.FIELDS (...)]",
[
q{* 1 FETCH (UID 1 FLAGS () BODY[HEADER.FIELDS (TO FROM SUBJECT DATE)]},
'From: Phil Pearl (Lobbes) <phil+from@perkpartners.com>
To: phil+to@perkpartners.com
Subject: foo "bar\" (baz\)
Date: Sat, 22 Jan 2011 20:43:58 -0500
'
],
[ [1], ( qw(FLAGS), 'BODY[HEADER.FIELDS (TO FROM SUBJECT DATE)]' ) ],
{
'1' => {
'BODY[HEADER.FIELDS (TO FROM SUBJECT DATE)]' =>
'From: Phil Pearl (Lobbes) <phil+from@perkpartners.com>
To: phil+to@perkpartners.com
Subject: foo "bar\" (baz\)
Date: Sat, 22 Jan 2011 20:43:58 -0500
',
'FLAGS' => '',
},
},
],
@ -225,6 +255,7 @@ sub fetch {
my ( $self, @args ) = @_;
return $self->{_next_fetch_response} || [];
}
sub Escaped_results {
my ( $self, @args ) = @_;
return $self->{_next_fetch_response} || [];

View File

@ -1,5 +1,5 @@
# $Id: Makefile,v 1.60 2011/02/21 02:20:38 gilles Exp gilles $
# $Id: Makefile,v 1.67 2011/04/20 01:20:06 gilles Exp gilles $
.PHONY: help usage all
@ -90,7 +90,7 @@ test_quick_229: imapsync tests.sh
CMD_PERL='perl -I./Mail-IMAPClient-2.2.9' /usr/bin/time sh tests.sh locallocal 1>/dev/null
test_quick_3xx: imapsync tests.sh
CMD_PERL='perl -I./Mail-IMAPClient-3.27/lib' /usr/bin/time sh tests.sh locallocal 1>/dev/null
CMD_PERL='perl -I./Mail-IMAPClient-3.28/lib' /usr/bin/time sh tests.sh locallocal 1>/dev/null
testv:
nice -40 sh -x tests.sh
@ -108,19 +108,13 @@ test229: .test_229
touch .test_229
.test_3xx: imapsync tests.sh
CMD_PERL='perl -I./Mail-IMAPClient-3.27/lib' /usr/bin/time sh tests.sh 1>/dev/null
CMD_PERL='perl -I./Mail-IMAPClient-3.28/lib' /usr/bin/time sh tests.sh 1>/dev/null
touch .test_3xx
testf: clean_test test
.PHONY: lfo upload_lfo niouze_lfo niouze_fm public imapsync_cidone
upload_index: index.shtml
rcsdiff index.shtml
rsync -avH index.shtml \
../../public_html/www.linux-france.org/html/prj/imapsync/
sh $(HOME)/memo/lfo-rsync
.dosify_bat: build_exe.bat test_exe.bat test.bat test2.bat
unix2dos build_exe.bat test.bat test_exe.bat test2.bat
touch .dosify_bat
@ -164,14 +158,14 @@ imapsync.exe: imapsync build_exe.bat test_exe.bat .dosify_bat
imapsync_elf_x86.bin: imapsync
rcsdiff imapsync
{ test 'vadrouille' = "`hostname`" && \
pp -o imapsync_elf_x86.bin -I Mail-IMAPClient-3.27/lib \
pp -o imapsync_elf_x86.bin -I Mail-IMAPClient-3.28/lib \
-M Mail::IMAPClient -M IO::Socket -M IO::Socket::SSL \
-M Digest::MD5 -M Digest::HMAC_MD5 -M Term::ReadKey \
-M Authen::NTLM \
imapsync ; \
} || :
{ test 'petite' = "`hostname`" && \
pp -o imapsync_elf_x86.bin -I Mail-IMAPClient-3.27/lib \
pp -o imapsync_elf_x86.bin -I Mail-IMAPClient-3.28/lib \
-M Mail::IMAPClient -M IO::Socket -M IO::Socket::SSL \
-M Digest::MD5 -M Digest::HMAC_MD5 -M Term::ReadKey \
-M Authen::NTLM \
@ -180,7 +174,7 @@ imapsync_elf_x86.bin: imapsync
imapsync ; \
} || :
{ test 'ks200821.kimsufi.com' = "`hostname`" && \
pp -o imapsync_elf_x86.bin -I Mail-IMAPClient-3.27/lib \
pp -o imapsync_elf_x86.bin -I Mail-IMAPClient-3.28/lib \
-M Mail::IMAPClient -M IO::Socket -M IO::Socket::SSL \
-M Digest::MD5 -M Digest::HMAC_MD5 -M Term::ReadKey \
-M Authen::NTLM \
@ -195,7 +189,7 @@ lfo: cidone niouze_lfo upload_lfo
dist: cidone test clean all INSTALL tarball
tarball: cidone all imapsync_elf_x86.bin imapsync.exe
tarball: cidone all imapsync.exe
echo making tarball $(DIST_FILE)
mkdir -p dist
mkdir -p ../prepa_dist/$(DIST_NAME)
@ -208,24 +202,43 @@ tarball: cidone all imapsync_elf_x86.bin imapsync.exe
ls -l ../prepa_dist/$(DIST_FILE)
ks:
rsync -av . imapsync@ks.lamiral.info:public_html/imapsync
rsync -avz . imapsync@ks.lamiral.info:public_html/imapsync
{ cd /g/var/paypal_reply/ &&\
rsync -av url_exe url_release url_source imapsync@ks.lamiral.info:/g/var/paypal_reply/ \
; }
PUBLIC_FILES = ./ChangeLog ./COPYING ./CREDITS ./FAQ \
./index.shtml ./INSTALL ./TIME \
./logo_imapsync.png ./logo_imapsync_s.png \
./paypal.shtml ./paypal_return.shtml ./paypal_return_support.shtml \
./README ./style.css ./TODO ./VERSION ./VERSION_EXE
upload_ks:
rsync -lptvHz $(PUBLIC_FILES) \
root@ks.lamiral.info:/var/www/imapsync/
rsync -lptvHz ./dist/index.shtml \
root@ks.lamiral.info:/var/www/imapsync/dist/
upload_lfo:
#rm -rf /home/gilles/public_html/www.linux-france.org/html/prj/imapsync/
#rm -rf /home/gilles/public_html/www.linux-france.org/ftp/prj/imapsync/
rsync -avH ./ChangeLog ./COPYING ./CREDITS ./FAQ \
./index.shtml ./INSTALL ./TIME \
./logo_imapsync.png ./logo_imapsync_s.png \
./paypal.shtml ./README ./style.css ./TODO ./VERSION ./VERSION_EXE \
rsync -avH $(PUBLIC_FILES) \
/home/gilles/public_html/www.linux-france.org/html/prj/imapsync/
rsync -avH ./dist/index.shtml \
/home/gilles/public_html/www.linux-france.org/html/prj/imapsync/dist/
sh ~/memo/lfo-rsync
niouze_lfo : VERSION
upload_index: index.shtml
validate --verbose index.shtml
rcsdiff index.shtml
rsync -avH index.shtml \
../../public_html/www.linux-france.org/html/prj/imapsync/
sh $(HOME)/memo/lfo-rsync
niouze_lfo :
echo "CORRECT ME: . ./memo && lfo_announce"
niouze_fm: VERSION

21
README
View File

@ -3,7 +3,7 @@ NAME
Synchronise mailboxes between two imap servers. Good at IMAP migration.
More than 36 different IMAP server softwares supported with success.
$Revision: 1.404 $
$Revision: 1.411 $
SYNOPSIS
To synchronise imap account "foo" on "imap.truc.org" to imap account
@ -270,13 +270,15 @@ BUG REPORT GUIDELINES
- IMAPClient.pm version.
- the run context. Do you run imapsync.exe, a unix binary or the perl script imapsync.
- operating system running imapsync.
- virtual software context (vmware, xen etc.)
- operating systems on both sides and the third side in case
you run imapsync on a foreign host from the both.
- virtual software context (vmware, xen etc.)
Most of those values can be found as a copy/paste at the begining of the
output.
@ -287,12 +289,12 @@ BUG REPORT GUIDELINES
IMAP SERVERS
Failure stories reported with the following 3 imap servers:
- MailEnable 1.54 (Proprietary) http://www.mailenable.com/
- DBMail 0.9, 2.0.7 (GPL). But DBMail 1.2.1 works.
- MailEnable 1.54 (Proprietary) but MailEnable 4.23 is supported.
- DBMail 0.9, 2.0.7 (GPL). But DBMail 1.2.1 is supported.
Patient and confident testers are welcome.
- Imail 7.04 (maybe).
Success stories reported with the following 40 imap servers (software
Success stories reported with the following 41 imap servers (software
names are in alphabetic order):
- 1und1 H mimap1 84498 [host1]
@ -323,11 +325,13 @@ IMAP SERVERS
- Dovecot 0.99.10.4, 0.99.14, 0.99.14-8.fc4, 1.0-0.beta2.7,
1.0.0 [dest/source] (LGPL) (http://www.dovecot.org/)
- Eudora WorldMail v2
- Gimap (Gmail imap)
- GMX IMAP4 StreamProxy.
- Groupwise IMAP (Novell) 6.x and 7.0. Buggy so see the FAQ.
- hMailServer 5.3.3 [host2], 4.4.1 [host1] (see FAQ)
- iPlanet Messaging server 4.15, 5.1, 5.2
- IMail 7.15 (Ipswitch/Win2003), 8.12
- IMail 7.15 (Ipswitch/Win2003), 8.12, 11.03 [host1]
- MailEnable 4.23 [host1] [host2]
- MDaemon 7.0.1, 8.0.2, 8.1, 9.5.4 (Windows server 2003 R2 platform)
- Mercury 4.1 (Windows server 2000 platform)
- Microsoft Exchange Server 5.5, 6.0.6249.0[host1], 6.0.6487.0[host1],
@ -413,9 +417,10 @@ SIMILAR SOFTWARES
imapmigrate : http://sourceforge.net/projects/cyrus-utils/
wonko_imapsync: http://wonko.com/article/554
see also tools/wonko_ruby_imapsync
isync : http://isync.sourceforge.net/
pop2imap : http://www.linux-france.org/prj/pop2imap/
Feedback (good or bad) will often be welcome.
$Id: imapsync,v 1.404 2011/02/21 03:35:39 gilles Exp gilles $
$Id: imapsync,v 1.411 2011/04/19 23:34:30 gilles Exp gilles $

8
TIME
View File

@ -1,3 +1,11 @@
40 Groupwize and authuser. Does not work.
540 Invoices build.
35 Bug bug_zero_byte() tests.sh No bug found here. email.
200 Prepared change site to ks (apache2 logrotate etc.).
63 "\Forwarded" flag bug in courier. DJ dj@blu...
30 Debug "BAD Command Argument Error. 12" on imapsync mailing-list.
120 Building invoices.
60 Added imapsync on adwords for 75 euros, 1 euro per day max. Free promotional offer from Google Adwords.
200 Added --useuid.
110 Started to allow copy by uid. Added --notakebody
60 Fixed cache, dealing with filenames containing \ characters.

19
TODO
View File

@ -1,5 +1,5 @@
#!/bin/cat
# $Id: TODO,v 1.92 2011/01/18 02:38:48 gilles Exp gilles $
# $Id: TODO,v 1.95 2011/04/16 20:16:47 gilles Exp gilles $
TODO file for imapsync
----------------------
@ -25,6 +25,16 @@ Evaluate
http://www.rackspace.com/apps/email_hosting/migrations
http://www.yippiemove.com/
Make --delete2 works with --useuid
Fix "\Forwarded" flag bug in courier.
Does \lalala can be forbidden (courier does a
"16 NO Error in IMAP command received by server"
with
* OK [PERMANENTFLAGS (\* \Draft \Answered \Flagged \Deleted \Seen)] Limited
Suggestion: it's very difficult to track down messages which are behaving
funny during the sync. It would be great - and presumably easy to code -
to have an option to have imapsync display e.g. the subject of an
@ -148,6 +158,13 @@ http://asg.web.cmu.edu/cyrus/download/imapd/altnamespace.html
===========================================================================
DONE. Read http://bugs.gentoo.org/show_bug.cgi?id=354831
Nice conversation.
DONE. Look https://fedorahosted.org/released/imapsync/
DONE. Take a look at https://bitbucket.org/imapsync/imapsync
DONE. Explain expunge behavior in help message.
DONE. Add --authmd51 --authmd52 to permit authmd5 by host.

View File

@ -1 +1 @@
1.404
1.411

View File

@ -1 +1 @@
1.404
1.411

6
adwords Normal file
View File

@ -0,0 +1,6 @@
IMAP migration tool
Buy imapsync.exe + source for 30 €
30 days money-back guarantee
linux-france.org/prj/imapsync/
www.linux-france.org/prj/imapsync/

5
i2
View File

@ -1,4 +1,7 @@
#!/bin/sh
perl -IMail-IMAPClient-2.2.9 ./imapsync "$@"
# $Id: i2,v 1.2 2011/03/15 01:14:15 gilles Exp gilles $
BASE=`dirname $0`
perl -I${BASE}/Mail-IMAPClient-2.2.9 ${BASE}/imapsync "$@"

5
i3
View File

@ -1,4 +1,7 @@
#!/bin/sh
perl -IMail-IMAPClient-3.27/lib ./imapsync "$@"
# $Id: i3,v 1.7 2011/03/15 01:15:48 gilles Exp gilles $
BASE=`dirname $0`
perl -I${BASE}/Mail-IMAPClient-3.28/lib ${BASE}/imapsync "$@"

View File

@ -15,12 +15,12 @@
=head1 NAME
imapsync - IMAP synchronisation, sync, copy or migration
tool. Synchronise mailboxes between two imap servers. Good
at IMAP migration. More than 36 different IMAP server softwares
imapsync - IMAP synchronisation, sync, copy or migration tool.
Synchronise mailboxes between two imap servers.
Good at IMAP migration. More than 36 different IMAP server softwares
supported with success.
$Revision: 1.404 $
$Revision: 1.411 $
=head1 SYNOPSIS
@ -317,13 +317,15 @@ Help us to help you: in your report, please include:
- IMAPClient.pm version.
- the run context. Do you run imapsync.exe, a unix binary or the perl script imapsync.
- operating system running imapsync.
- virtual software context (vmware, xen etc.)
- operating systems on both sides and the third side in case
you run imapsync on a foreign host from the both.
- virtual software context (vmware, xen etc.)
Most of those values can be found as a copy/paste at the begining of the output.
One time in your life, read the paper
@ -335,12 +337,12 @@ and then forget it.
Failure stories reported with the following 3 imap servers:
- MailEnable 1.54 (Proprietary) http://www.mailenable.com/
- DBMail 0.9, 2.0.7 (GPL). But DBMail 1.2.1 works.
- MailEnable 1.54 (Proprietary) but MailEnable 4.23 is supported.
- DBMail 0.9, 2.0.7 (GPL). But DBMail 1.2.1 is supported.
Patient and confident testers are welcome.
- Imail 7.04 (maybe).
Success stories reported with the following 40 imap servers
Success stories reported with the following 41 imap servers
(software names are in alphabetic order):
- 1und1 H mimap1 84498 [host1]
@ -371,11 +373,13 @@ Success stories reported with the following 40 imap servers
- Dovecot 0.99.10.4, 0.99.14, 0.99.14-8.fc4, 1.0-0.beta2.7,
1.0.0 [dest/source] (LGPL) (http://www.dovecot.org/)
- Eudora WorldMail v2
- Gimap (Gmail imap)
- GMX IMAP4 StreamProxy.
- Groupwise IMAP (Novell) 6.x and 7.0. Buggy so see the FAQ.
- hMailServer 5.3.3 [host2], 4.4.1 [host1] (see FAQ)
- iPlanet Messaging server 4.15, 5.1, 5.2
- IMail 7.15 (Ipswitch/Win2003), 8.12
- IMail 7.15 (Ipswitch/Win2003), 8.12, 11.03 [host1]
- MailEnable 4.23 [host1] [host2]
- MDaemon 7.0.1, 8.0.2, 8.1, 9.5.4 (Windows server 2003 R2 platform)
- Mercury 4.1 (Windows server 2000 platform)
- Microsoft Exchange Server 5.5, 6.0.6249.0[host1], 6.0.6487.0[host1],
@ -486,12 +490,13 @@ Entries for imapsync:
imapmigrate : http://sourceforge.net/projects/cyrus-utils/
wonko_imapsync: http://wonko.com/article/554
see also tools/wonko_ruby_imapsync
isync : http://isync.sourceforge.net/
pop2imap : http://www.linux-france.org/prj/pop2imap/
Feedback (good or bad) will often be welcome.
$Id: imapsync,v 1.404 2011/02/21 03:35:39 gilles Exp gilles $
$Id: imapsync,v 1.411 2011/04/19 23:34:30 gilles Exp gilles $
=cut
@ -599,7 +604,7 @@ my(
# global variables initialisation
$rcs = '$Id: imapsync,v 1.404 2011/02/21 03:35:39 gilles Exp gilles $ ';
$rcs = '$Id: imapsync,v 1.411 2011/04/19 23:34:30 gilles Exp gilles $ ';
$total_bytes_transferred = 0;
$total_bytes_skipped = 0;
@ -644,7 +649,7 @@ $allow3xx = defined($allow3xx) ? $allow3xx : 1;
$takebody = defined($takebody) ? $takebody : 1;
if ( $fast ) {
$useuid = 1 ;
# $useuid = 1 ;
$foldersizes = 0 ;
}
@ -833,7 +838,8 @@ $split2 and $imap2->Split($split2);
my (
@h1_folders_all, %h1_folders_all, @h1_folders_wanted, %requested_folder, %subscribed_folder,
@h2_folders_all, %h2_folders_all, @h2_folders_from_1, %h2_folders_from_1,
@h2_folders_all, %h2_folders_all, @h2_folders_from_1_wanted, %h2_folders_from_1_wanted,
@h2_folders_from_1_all, %h2_folders_from_1_all,
);
@ -929,14 +935,22 @@ print "Host2 separator and prefix: [$h2_sep][$h2_prefix]\n";
foreach my $h1_fold (@h1_folders_wanted) {
my $h2_fold;
$h2_fold = imap2_folder_name($h1_fold);
$h2_folders_from_1{$h2_fold}++;
$h2_folders_from_1_wanted{$h2_fold}++;
}
@h2_folders_from_1_wanted = sort keys(%h2_folders_from_1_wanted);
foreach my $h1_fold (@h1_folders_all) {
my $h2_fold;
$h2_fold = imap2_folder_name($h1_fold);
$h2_folders_from_1_all{$h2_fold}++;
}
#@h2_folders_from_1_all = sort keys(%h2_folders_from_1_all);
@h2_folders_from_1 = sort keys(%h2_folders_from_1);
if ($foldersizes) {
foldersizes("Host1", $imap1, @h1_folders_wanted);
foldersizes("Host2", $imap2, @h2_folders_from_1);
foldersizes( "Host1", $imap1, @h1_folders_wanted ) ;
foldersizes( "Host2", $imap2, @h2_folders_from_1_wanted ) ;
sleep( 2 ) ;
}
@ -983,7 +997,7 @@ FOLDER: foreach my $h1_fold (@h1_folders_wanted) {
#print "%%% @select_results\n";
my $permanentflags2 = permanentflags(@select_results);
$debug and print "permanentflags: $permanentflags2\n" ;
if ($expunge){
print "Expunging host1 $h1_fold\n";
unless($dry) { $imap1->expunge() };
@ -1018,9 +1032,6 @@ FOLDER: foreach my $h1_fold (@h1_folders_wanted) {
print "CACHE h1 h2: ", scalar( keys %$cache_1_2_ref ), " files\n" ;
$debug and print '[',
map ( { "$_->$cache_1_2_ref->{$_} " } keys %$cache_1_2_ref ), " ]\n";
#print "CACHE h2 h1: ", scalar( keys %$cache_2_1_ref ), " files\n" ;
#$debug and print '[',
# map ( { "$_->$cache_2_1_ref->{$_} " } keys %$cache_2_1_ref ), " ]\n";
}
#sleep 4 ;
@ -1043,11 +1054,16 @@ FOLDER: foreach my $h1_fold (@h1_folders_wanted) {
my @h1_msgs_no_cache = keys %h1_msgs_no_cache ;
my @h2_msgs_no_cache = keys %h2_msgs_no_cache ;
my @h2_msgs_delete2_no_cache = () ;
if ( $useuid ) {
# use uid so we have to avoid getting header
@h1_msgs_copy_by_uid{ @h1_msgs_no_cache } = ( ) ;
@h2_msgs_delete2_no_cache = @h2_msgs_no_cache if $usecache ;
@h1_msgs_no_cache = ( ) ;
@h2_msgs_no_cache = ( ) ;
#print "delete2: @h2_msgs_delete2_no_cache\n";
}
$debug and print "Host1 folder [$h1_fold] parsing headers\n";
@ -1136,7 +1152,7 @@ FOLDER: foreach my $h1_fold (@h1_folders_wanted) {
my $h2_msg = $h2_hash{$m_id}{'m'};
my $h2_flags = $h2_hash{$m_id}{'F'} || "";
my $isdel = $h2_flags =~ /\B\\Deleted\b/ ? 1 : 0;
print "msg $h2_fold/$h2_msg deleted on host2 [$m_id]\n"
print "msg $h2_fold/$h2_msg marked \\Deleted on host2 [$m_id]\n"
if ! $isdel;
push(@h2_expunge, $h2_msg) if $uidexpunge2;
unless ($dry or $isdel) {
@ -1146,14 +1162,20 @@ FOLDER: foreach my $h1_fold (@h1_folders_wanted) {
}
}
foreach my $h2_msg (@h2_msgs_duplicate) {
print "msg $h2_fold/$h2_msg deleted [duplicate] on host2\n";
print "msg $h2_fold/$h2_msg marked \\Deleted [duplicate] on host2\n";
push(@h2_expunge, $h2_msg) if $uidexpunge2;
unless ($dry) {
$imap2->delete_message($h2_msg);
$h2_nb_msg_deleted += 1;
}
}
foreach my $h2_msg ( @h2_msgs_delete2_no_cache ) {
print "msg $h2_fold/$h2_msg marked \\Deleted [not in cache] on host2\n";
unless ($dry) {
$imap2->delete_message($h2_msg);
$h2_nb_msg_deleted += 1;
}
}
my $cnt = scalar @h2_expunge;
if(@h2_expunge and !$imap2->can("uidexpunge")) {
warn "uidexpunge not supported (< IMAPClient 3.17)\n";
@ -1273,7 +1295,7 @@ sub sync_flags {
# we need most of the time.
if ( ! $dry and $diff and ! $imap2->store( $h2_msg, "FLAGS.SILENT (@h1_flags)" ) ) {
warn "- msg $h2_fold/$h2_msg could not add flags @h1_flags",
warn "- msg $h2_fold/$h2_msg could not add flags [@h1_flags]: ",
$imap2->LastError, "\n";
#$nb_errors++;
}
@ -1632,8 +1654,8 @@ sub banner_imapsync {
my @argv_copy = @_;
my $banner_imapsync = join("",
'$RCSfile: imapsync,v $ ',
'$Revision: 1.404 $ ',
'$Date: 2011/02/21 03:35:39 $ ',
'$Revision: 1.411 $ ',
'$Date: 2011/04/19 23:34:30 $ ',
"\n",localhost_info(), "\n",
"Command line used:\n",
"$0 ", command_line_nopassword(@argv_copy), "\n",
@ -2227,7 +2249,7 @@ sub permanentflags {
foreach my $line (@lines) {
if ($line =~ m{\[PERMANENTFLAGS \(([^)]+?)\)\]}) {
#print "%%%$1%%%\n";
$debug and print "permanentflags: $line";
my $permanentflags = $1;
if ($permanentflags =~ m{\\\*}) {
$permanentflags = '';
@ -2534,6 +2556,7 @@ sub get_cache {
return ( $cache_1_2_ref, $cache_2_1_ref ) ;
}
sub tests_get_cache {
ok( ! get_cache('/cache_no_exist'), 'get_cache: /cache_no_exist' );
@ -2989,6 +3012,7 @@ sub get_options {
"timeout=i" => \$timeout,
"skipheader=s" => \$skipheader,
"useheader=s" => \@useheader,
"takebody!" => \$takebody,
"skipsize!" => \$skipsize,
"allowsizemismatch!" => \$allowsizemismatch,
"fastio1!" => \$fastio1,
@ -3198,7 +3222,7 @@ sub check_last_release {
}
sub imapsync_version {
my $rcs = '$Id: imapsync,v 1.404 2011/02/21 03:35:39 gilles Exp gilles $ ';
my $rcs = '$Id: imapsync,v 1.411 2011/04/19 23:34:30 gilles Exp gilles $ ';
$rcs =~ m/,v (\d+\.\d+)/;
my $VERSION = ($1) ? $1: "UNKNOWN";
return($VERSION);
@ -3455,7 +3479,7 @@ Several options are mandatory.
--justlogin : just login to both host1 and host2 with users
credentials, then exit.
--justfolders : just do things about folders (ignore messages).
--fast : be faster, equivalent to --useuid --nofoldersizes
--fast : be faster, equivalent to --nofoldersizes
--reconnectretry1 <int>: reconnect to host1 if connection is lost up to
<int> times per imap command (default is 3)
--reconnectretry2 <int>: same as --reconnectretry1 but for host2
@ -3674,7 +3698,7 @@ sub list_folders_in_2_not_in_1 {
my (@h2_folders_not_in_1, %h2_folders_not_in_1);
@h2_folders_not_in_1 = list_keys_in_2_not_in_1( \%h1_folders_all, \%h2_folders_all);
map { $h2_folders_not_in_1{$_} = 1} @h2_folders_not_in_1;
@h2_folders_not_in_1 = list_keys_in_2_not_in_1( \%h2_folders_from_1, \%h2_folders_not_in_1);
@h2_folders_not_in_1 = list_keys_in_2_not_in_1( \%h2_folders_from_1_all, \%h2_folders_not_in_1);
return( reverse @h2_folders_not_in_1 );
}

4310
imapsync-1.366 Executable file

File diff suppressed because it is too large Load Diff

4830
imapsync-1.404 Executable file

File diff suppressed because it is too large Load Diff

Binary file not shown.

View File

@ -2,10 +2,10 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>imapsync <!--#exec cmd="cat VERSION" --> </title>
<title>Imapsync: an IMAP migration tool ( release <!--#exec cmd="cat VERSION"--> )</title>
<meta name="generator" content="Bluefish 1.0.7"/>
<meta name="author" content="Gilles LAMIRAL"/>
<meta name="date" content="2011-02-16T20:47:41+0100"/>
<meta name="date" content="2011-04-20T01:50:31+0200"/>
<meta name="copyright" content="None"/>
<meta name="keywords" content="imap, transfert, migration"/>
<meta name="description" content="imap migration tool"/>
@ -33,6 +33,7 @@
<ul class="none">
<li>Buy <a href="#buy_source">imapsync <b>source code</b></a> (any OS)</li>
<li>Buy <a href="#buy_exe"><b>standalone win32</b></a> imapsync.exe</li>
<li>Buy <a href="#buy_support">imapsync <b>support</b></a> to succeed your migration</li>
<li>Are your <a href="#imap_server_success">imap servers <b>supported</b></a> by imapsync?</li>
</ul>
@ -59,6 +60,27 @@ where the user plays independently on both sides. Use <b>offlineimap</b>
</p>
<h2><a id="latest"></a>Latest release is imapsync
<!--#exec cmd="cat VERSION" -->
</h2>
<p>Written on <!--#flastmod file="VERSION" --></p>
<p>See <a href="ChangeLog">ChangeLog</a> to know what's new in details.</p>
<p>New features since previous releases 1.404:</p>
<ul>
<li>Updated imapsync.exe to last <b>Mail-IMAPClient 3.28</b> (thanks to Phil Pearl Lobbes)</li>
<li>Option <b>--useuid</b> now works also with <b>--delete2</b> option.</li>
</ul>
<p>The next imapsync release should see:</p>
<ul>
<li>An option to sync to and from files (local backup)</li>
</ul>
<h2><a id="AUTHOR"></a>Who is the author?</h2>
<p>Gilles LAMIRAL<br/>
@ -72,32 +94,6 @@ where the user plays independently on both sides. Use <b>offlineimap</b>
imapsync mailing-list (see below section <a href="#MAILING-LIST">Mailing-List</a>).
</p>
<h2><a id="latest"></a>Latest release is imapsync
<!--#exec cmd="cat VERSION" -->
</h2>
<p>Written on <!--#flastmod file="VERSION" --></p>
<p>See <a href="ChangeLog">ChangeLog</a> to know what's new.</p>
<p>New features since previous release 1.383:</p>
<ul>
<li>new option <b>--usecache</b> to speedup transfers when using multiple runs.</li>
<li>new option <b>--delete2foldersonly</b> to select which host2 folder hierarchy can be removed if it is away from host1.</li>
<li>new option <b>--delete2foldersbutnot</b> to avoid removing host2 folder hierarchy even if it is away from host1.</li>
<li>Added info about the biggest messages (imapsync uses about 18 times in RAM the size of the biggest transfered message)</li>
</ul>
<p>The next imapsync release should see:</p>
<ul>
<li>An option to sync to and from files (local backup)</li>
</ul>
<h2><a id="buy_source"></a>Buy imapsync source code</h2>
<p>
@ -107,22 +103,28 @@ The Perl <b>imapsync</b> source code will run anywhere a <b>Perl interpreter can
<p>Buy <b>latest</b> imapsync Perl <b>source code</b> for <b>30 EUR</b>
</p>
<p>
30 EUR is about <b>40 USD</b>, no problem to pay in USD with paypal:
30 EUR is equal to around <b>45 USD</b>, no problem to pay in USD (or any currency) with paypal:
</p>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<p>
<input type="hidden" name="cmd" value="_s-xclick"/>
<input type="hidden" name="encrypted" value="-----BEGIN PKCS7-----MIIHZwYJKoZIhvcNAQcEoIIHWDCCB1QCAQExggEwMIIBLAIBADCBlDCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb20CAQAwDQYJKoZIhvcNAQEBBQAEgYArEqh58oczNTo19VGeZ6gWyAS5qdCUI8qW67/5236gwtJ0AyKGaVpKvC4dIOCRb8uhwMnjQDDetr1El11EXdlZtevR2Us6JwqjGuNws5ExW6HiphHU3LwaUfhsqM5Rb/2C+a0k4jcyD9jV9H8PEkZiPvhwwOT6NwZluVk9DCxzzzELMAkGBSsOAwIaBQAwgeQGCSqGSIb3DQEHATAUBggqhkiG9w0DBwQIyx1dE9Tyi8CAgcA7d4xtl+YU+nJPMXny5IYG0163Bibn0QUSECoqyJ5NwGZEWOmWpU34P6X8peyUTMqvrZNt79tP0N2rsTveNX2riVfi+3UIWB+6PJ9ETwUu/OTQ7dekI1BCUwEObL7WfZOM2qQ5RoAqowFxQvXe1cFnZe+G6nVFkMTo/Q91azbvIB47Hv3xmLs7K6zLCsfYAnf0JcerSu1bQUxD86x3KL+5XPWCLmuURnpw1Zwo7pWxR4Pj4PNNMEfYIdiZ33YAdyugggOHMIIDgzCCAuygAwIBAgIBADANBgkqhkiG9w0BAQUFADCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb20wHhcNMDQwMjEzMTAxMzE1WhcNMzUwMjEzMTAxMzE1WjCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb20wgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAMFHTt38RMxLXJyO2SmS+Ndl72T7oKJ4u4uw+6awntALWh03PewmIJuzbALScsTS4sZoS1fKciBGoh11gIfHzylvkdNe/hJl66/RGqrj5rFb08sAABNTzDTiqqNpJeBsYs/c2aiGozptX2RlnBktH+SUNpAajW724Nv2Wvhif6sFAgMBAAGjge4wgeswHQYDVR0OBBYEFJaffLvGbxe9WT9S1wob7BDWZJRrMIG7BgNVHSMEgbMwgbCAFJaffLvGbxe9WT9S1wob7BDWZJRroYGUpIGRMIGOMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExFjAUBgNVBAcTDU1vdW50YWluIFZpZXcxFDASBgNVBAoTC1BheVBhbCBJbmMuMRMwEQYDVQQLFApsaXZlX2NlcnRzMREwDwYDVQQDFAhsaXZlX2FwaTEcMBoGCSqGSIb3DQEJARYNcmVAcGF5cGFsLmNvbYIBADAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBBQUAA4GBAIFfOlaagFrl71+jq6OKidbWFSE+Q4FqROvdgIONth+8kSK//Y/4ihuE4Ymvzn5ceE3S/iBSQQMjyvb+s2TWbQYDwcp129OPIbD9epdr4tJOUNiSojw7BHwYRiPh58S1xGlFgHFXwrEBb3dgNbMUa+u4qectsMAXpVHnD9wIyfmHMYIBmjCCAZYCAQEwgZQwgY4xCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJDQTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEUMBIGA1UEChMLUGF5UGFsIEluYy4xEzARBgNVBAsUCmxpdmVfY2VydHMxETAPBgNVBAMUCGxpdmVfYXBpMRwwGgYJKoZIhvcNAQkBFg1yZUBwYXlwYWwuY29tAgEAMAkGBSsOAwIaBQCgXTAYBgkqhkiG9w0BCQMxCwYJKoZIhvcNAQcBMBwGCSqGSIb3DQEJBTEPFw0xMTAyMDEyMTQwMDJaMCMGCSqGSIb3DQEJBDEWBBQ4O9eBJ0P7M09R7uD+x9Z5oJJ6WTANBgkqhkiG9w0BAQEFAASBgHm4cCbnOplJjY9vGD60J3klgZF9LS6azfZsUpVEM5+KUT7LOrWGyM2k6+/V5R7k+MrEEmfChqeg9WSsFWYYenPulHwsMdCtu66RW1ZaMOH82nTw4hty5jTOO+hBHKvH7lyF0z693aBuBKB8BmJbdOGiTS7J8exPYq+HCGySAuyp-----END PKCS7-----
<input type="hidden" name="on0" value="imapsync usage"/>imapsync usage
<select name="os0">
<option value="professional">professional </option>
<option value="individual">individual </option>
</select><br/>
<input type="hidden" name="encrypted" value="-----BEGIN PKCS7-----MIIHTwYJKoZIhvcNAQcEoIIHQDCCBzwCAQExggEwMIIBLAIBADCBlDCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb20CAQAwDQYJKoZIhvcNAQEBBQAEgYAchu3LIZtVxaYuj/u7uTvXyx7zzq6JMGAUPDBA7sHzco9Icr9XcMupJTswbs/YcccF904Q81cuUnKwJY/0SfVPvN5M8iEHTpGHWykepq+qq6MM/tfYiw31lFzp6GUDhH0WTI9vSuOPOVXSSa6ZvAgALf/cHS1OqtijFobur20n9zELMAkGBSsOAwIaBQAwgcwGCSqGSIb3DQEHATAUBggqhkiG9w0DBwQIfe1OE36bwJuAgaiYHnr5A7vACtCk0a4U92DDR2ftiXk/TSVjIl381VknV3HsuiKV2U/JpXjWoNWRUM9tereRaFxOW4tOimy7KLR/lszHfV22UKQyQ2d1I7BiIJjTlJjYVuDDUnKuhjWN0zu2+VJBhPD3/ILA6T8olswg1aUQYWcRdyuu9je78FWrYXl/GfGYAP9WoDBDcGXBUfrSW4E3yzn/Vw9tOJ5CQML/nF2h9cwrSA6gggOHMIIDgzCCAuygAwIBAgIBADANBgkqhkiG9w0BAQUFADCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb20wHhcNMDQwMjEzMTAxMzE1WhcNMzUwMjEzMTAxMzE1WjCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb20wgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAMFHTt38RMxLXJyO2SmS+Ndl72T7oKJ4u4uw+6awntALWh03PewmIJuzbALScsTS4sZoS1fKciBGoh11gIfHzylvkdNe/hJl66/RGqrj5rFb08sAABNTzDTiqqNpJeBsYs/c2aiGozptX2RlnBktH+SUNpAajW724Nv2Wvhif6sFAgMBAAGjge4wgeswHQYDVR0OBBYEFJaffLvGbxe9WT9S1wob7BDWZJRrMIG7BgNVHSMEgbMwgbCAFJaffLvGbxe9WT9S1wob7BDWZJRroYGUpIGRMIGOMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExFjAUBgNVBAcTDU1vdW50YWluIFZpZXcxFDASBgNVBAoTC1BheVBhbCBJbmMuMRMwEQYDVQQLFApsaXZlX2NlcnRzMREwDwYDVQQDFAhsaXZlX2FwaTEcMBoGCSqGSIb3DQEJARYNcmVAcGF5cGFsLmNvbYIBADAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBBQUAA4GBAIFfOlaagFrl71+jq6OKidbWFSE+Q4FqROvdgIONth+8kSK//Y/4ihuE4Ymvzn5ceE3S/iBSQQMjyvb+s2TWbQYDwcp129OPIbD9epdr4tJOUNiSojw7BHwYRiPh58S1xGlFgHFXwrEBb3dgNbMUa+u4qectsMAXpVHnD9wIyfmHMYIBmjCCAZYCAQEwgZQwgY4xCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJDQTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEUMBIGA1UEChMLUGF5UGFsIEluYy4xEzARBgNVBAsUCmxpdmVfY2VydHMxETAPBgNVBAMUCGxpdmVfYXBpMRwwGgYJKoZIhvcNAQkBFg1yZUBwYXlwYWwuY29tAgEAMAkGBSsOAwIaBQCgXTAYBgkqhkiG9w0BCQMxCwYJKoZIhvcNAQcBMBwGCSqGSIb3DQEJBTEPFw0xMTAyMjEyMzUyNTJaMCMGCSqGSIb3DQEJBDEWBBQpfaQml7ZBWxF9LPNuhemrd9wRIjANBgkqhkiG9w0BAQEFAASBgKId9kb4mA0nuwOvirTPd9tEx19KF3EWPrUYchsNCqUgM49YY2U2PtmnHTK6nIcseVVveWfcifJJMti1XoUG11Y6D0KrpJkxLw7Si+K/BKZ3z8z+ZBvlkoA/dPJ+cHRNxL19Wy7EJ8oM8DdYB4QxPXLvYxzbP+Fb/l3g5tWPti5x-----END PKCS7-----
"/>
<input type="image" src="https://www.paypal.com/en_US/i/btn/btn_buynowCC_LG.gif" name="submit" alt="PayPal - The safer, easier way to pay online!"/>
<img alt="" src="https://www.paypal.com/fr_FR/i/scr/pixel.gif" width="1" height="1"/>
</p>
</form>
<p>You will receive a download link in few minutes (contact me if the delay is over a couple of hours).<br/>
<b>30 days money-back guarantee.</b></p>
<p>You will receive a download link <b>just after</b> the payment.<br/>
<b>30 days money-back guarantee!</b></p>
<h2><a id="buy_exe"></a>Standalone imapsync.exe for win32</h2>
@ -130,30 +132,61 @@ The Perl <b>imapsync</b> source code will run anywhere a <b>Perl interpreter can
buying the latest win32 <b>standalone imapsync.exe</b> for <b>30 EUR</b></p>
<p>
30 EUR is about <b>40 USD</b>, no problem to pay in USD with paypal:
30 EUR is equal to around <b>45 USD</b>, no problem to pay in USD (or any currency) with paypal:
</p>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<p>
<input type="hidden" name="cmd" value="_s-xclick"/>
<input type="hidden" name="encrypted" value="-----BEGIN PKCS7-----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-----END PKCS7-----
<input type="hidden" name="on0" value="imapsync usage"/>imapsync usage
<select name="os0">
<option value="professional">professional </option>
<option value="individual">individual </option>
</select><br/>
<input type="hidden" name="encrypted"
value="-----BEGIN PKCS7-----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-----END PKCS7-----
"/>
<input type="image" src="https://www.paypal.com/en_US/i/btn/btn_buynowCC_LG.gif" name="submit" alt="PayPal - The safer, easier way to pay online!"/>
<input type="image" src="https://www.paypal.com/en_US/i/btn/btn_buynowCC_LG.gif"
name="submit" alt="PayPal - The safer, easier way to pay online!"/>
<img alt="" src="https://www.paypal.com/fr_FR/i/scr/pixel.gif" width="1" height="1"/>
</p>
</form>
<p>You will receive a download link in few minutes (contact me if the delay is over a couple of hours).<br/>
<b>30 days money-back guarantee.</b></p>
<p>You will receive a download link <b>just after</b> the payment.<br/>
<b>30 days money-back guarantee!</b></p>
<!--
<p>
thanks to Strawberry Perl 5.12 and Par::Packer module.<br/>
The imapsync.exe built time is .<br/>
The build system for imapsync.exe is XP Pro SP2 on a Intel Celeron 400 MHz 256 Mo RAM. </p>
-->
<h2><a id="buy_support"></a>Support for imapsync</h2>
<p>For <b>90 EUR</b> buy imapsync <b>support</b> by the developper who wrote and maintains imapsync.
</p>
<p>
90 EUR is equal to around <b>125 USD</b>, no problem to pay in USD (or any currency) with paypal:
</p>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<p>
<input type="hidden" name="cmd" value="_s-xclick" />
<input type="hidden" name="hosted_button_id" value="E25UVGFNDJWW8" />
<input type="image"
src="https://www.paypalobjects.com/WEBSCR-640-20110401-1/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/WEBSCR-640-20110401-1/fr_FR/i/scr/pixel.gif" width="1" height="1" />
<input name="return" type="hidden" value="http://www.linux-france.org/prj/imapsync/paypal_return_support.shtml?utm_nooverride=1" />
</p>
</form>
<p>Then you will be able to expose your issues by email or phone and to converse until your issues are solved.
</p>
<h2>Documentation</h2>
<p>Read the <a href="INSTALL">INSTALL</a> file to know how to install imapsync on your system.
@ -231,7 +264,7 @@ If you really want a feature or a fix you can donate money and my next developme
will be to code it or fix it.<br/>
</p>
<p>On february 2011: <b>1 EUR ~ 1.3 USD</b>.</p>
<p>On april 2011: <b>1 EUR ~ 1.48 USD</b>.</p>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
@ -251,6 +284,7 @@ will be to code it or fix it.<br/>
<tr align="right"><th>DONE</th><th>Feature </th><th>Time guessed</th><th>Time spent</th><th>Money received</th><th>Money needed</th></tr>
<tr align="right"><td> No</td><td>Backup to files </td><td>20 hours </td><td> 60 min </td><td> 0 $ </td><td>800 $ </td></tr>
<tr align="right"><td> No</td><td>Efficient Gmail backup </td><td>20 hours </td><td> 80 min </td><td> 0 $ </td><td>800 $ </td></tr>
<tr align="right"><td> No</td><td>Better error reporting </td><td> 5 hours </td><td> 0 min </td><td> 0 $ </td><td>200 $ </td></tr>
<tr align="right"><td> Yes</td><td>Add cache </td><td>10 hours </td><td>1310 min </td><td>400 $ </td><td>400 $ </td></tr>
<tr align="right"><td> Yes</td><td>Speedup 50% </td><td>10 hours </td><td> 80 min </td><td> 10 $ </td><td>400 $ </td></tr>
<tr align="right"><td> Yes</td><td>--delete2folders </td><td> 3 hours </td><td> 270 min </td><td> 90 $ </td><td> 0 $ </td></tr>
@ -270,14 +304,13 @@ will be to code it or fix it.<br/>
</p>
<ul>
<li>DBMail 0.9, 2.0.7 (GPL). But most other DBMail releases work (see below)</li>
<li>DBMail 0.9, 2.0.7 (GPL). But most other DBMail releases are supported (see below)</li>
<li>Imail 7.04 (maybe).</li>
<li>MailEnable 1.54 (Proprietary) http://www.mailenable.com/</li>
<li>MailEnable 1.54 (Proprietary) but MailEnable 4.23 is supported. </li>
</ul>
<p>Now the long reported <b>success stories</b> list
([host1] means "source server",
[host2] means "destination server"):
<p>Now the long reported <b>success stories</b> list (41 different imap server softwares)
([host1] means "source server", [host2] means "destination server"):
</p>
<ul>
@ -309,11 +342,14 @@ will be to code it or fix it.<br/>
<li>Dovecot 0.99.10.4, 0.99.14, 0.99.14-8.fc4, 1.0-0.beta2.7,
1.0.0 [dest/source] (LGPL) (http://www.dovecot.org/)</li>
<li>Eudora WorldMail v2</li>
<li>Gimap (Gmail imap) [host1] [host2]</li>
<li>GMX IMAP4 StreamProxy.</li>
<li>Goddy IMAP (since Goddy runs Courier)</li>
<li>Groupwise IMAP (Novell) 6.x and 7.0. Buggy so see the FAQ.</li>
<li>hMailServer 5.3.3 [host2], 4.4.1 [host1], HMAILSERVER 5.3.2-B1769 on windows 2003 [hsot2]</li>
<li>iPlanet Messaging server 4.15, 5.1, 5.2</li>
<li>IMail 7.15 (Ipswitch/Win2003), 8.12</li>
<li>IMail 7.15 (Ipswitch/Win2003), 8.12, 11.03 [host1]</li>
<li>MailEnable 4.23 [host1] [host2]</li>
<li>MDaemon 7.0.1, 8.0.2, 8.1, 9.5.4 (Windows server 2003 R2 platform)</li>
<li>Mercury 4.1 (Windows server 2000 platform)</li>
<li>Microsoft Exchange Server 5.5, 6.0.6249.0[host1], 6.0.6487.0[host1],
@ -368,7 +404,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.55 2011/02/21 02:16:36 gilles Exp gilles $)
($Id: index.shtml,v 1.63 2011/04/19 23:51:09 gilles Exp gilles $)
</p>
</body>

10
memo
View File

@ -1,6 +1,6 @@
#!/bin/sh
# $Id: memo,v 1.29 2010/12/14 15:14:46 gilles Exp gilles $
# $Id: memo,v 1.30 2011/03/23 19:14:37 gilles Exp gilles $
software_version() {
@ -13,11 +13,11 @@ statistics_lfo() {
#grep prj/imapsync/VERSION /usr/local/apache/logs/access_log | sort -n | cut -d ' ' -f 1,12,13|uniq -c | sort -n # list ip
cat <<EOFF
grep -h prj/imapsync/VERSION /usr/local/apache/logs/access_log*|cut -d ' ' -f 1,12,13,18,19|sort -n|uniq -c|sort -n # list ip
grep -h prj/imapsync/VERSION /usr/local/apache/logs/access_log*|cut -d ' ' -f 1,12,13,18,19|sort -n|uniq -c|sort -n |grep MSWin32 # Win32
ssh glamiral@linux-france.org "grep -h prj/imapsync/VERSION /usr/local/apache/logs/access_log*|cut -d ' ' -f 1,12,13,18,19|sort -n|uniq -c|sort -n" # list ip
ssh glamiral@linux-france.org "grep -h prj/imapsync/VERSION /usr/local/apache/logs/access_log*|cut -d ' ' -f 1,12,13,18,19|sort -n|uniq -c|sort -n |grep MSWin32" # Win32
grep -h prj/imapsync/VERSION /usr/local/apache/logs/access_log*|cut -d ' ' -f 13,18,19 |sort -n|uniq -c| sort -n # OS usage+basename
grep -h prj/imapsync/VERSION /usr/local/apache/logs/access_log*|cut -d ' ' -f 12 |sort -n|uniq -c| sort -n # imapsync release
ssh glamiral@linux-france.org "grep -h prj/imapsync/VERSION /usr/local/apache/logs/access_log*|cut -d ' ' -f 13,18,19 |sort -n|uniq -c| sort -n" # OS usage+basename
ssh glamiral@linux-france.org "grep -h prj/imapsync/VERSION /usr/local/apache/logs/access_log*|cut -d ' ' -f 12 |sort -n|uniq -c| sort -n" # imapsync release
tail -f /usr/local/apache/logs/access_log|cat -n|grep prj/imapsync/VERSION|cat -n |grep VERSION # lfo frequency'

147
paypal_reply/memo Normal file
View File

@ -0,0 +1,147 @@
#!/bin/sh
# $Id: memo,v 1.3 2011/03/28 02:14:47 gilles Exp gilles $
echo paypal_bilan_tests_refact_2
paypal_bilan_tests_refact_2() {
# DID output no diff between paypal_bilan_1.22 and 1.23
(
set -x
for f in /g/paypal/paypal_201?_??_complet.csv; do
fb=`basename "$f"`
f1=/g/var/paypal_bilan/tests/${fb}_1.22.out1
f2=/g/var/paypal_bilan/tests/${fb}_1.22.out2
rm "$f2"
/g/public_html/imapsync/paypal_reply/paypal_bilan_1.22 \
--bnc --debug --debug_csv "$f" \
> "$f1"
/g/public_html/imapsync/paypal_reply/paypal_bilan \
--bnc --debug --debug_csv "$f" \
> "$f2"
echo diff "$f1" "$f2"
diff "$f1" "$f2"
done
for f in /g/paypal/paypal_201?_??_complet.csv; do
fb=`basename "$f"`
f1=/g/var/paypal_bilan/tests/${fb}_tva.out1
f2=/g/var/paypal_bilan/tests/${fb}_tva.out2
rm "$f2"
/g/public_html/imapsync/paypal_reply/paypal_bilan_1.22 \
"$f" \
> "$f1"
/g/public_html/imapsync/paypal_reply/paypal_bilan \
"$f" \
> "$f2"
echo diff "$f1" "$f2"
diff "$f1" "$f2"
done
)
}
#echo paypal_bilan_tests_refact_1
paypal_bilan_tests_refact_1() {
# DID output no diff between paypal_bilan_1.11 and 1.13
(
#set -x
for f in /g/paypal/paypal_201?_??.csv; do
fb=`basename "$f"`
f1=/g/var/paypal_bilan/tests/$fb.out1
f2=/g/var/paypal_bilan/tests/$fb.out2
rm "$f2"
/g/public_html/imapsync/paypal_reply/paypal_bilan_1.11 \
--bnc --debug "$f" \
> "$f1"
/g/public_html/imapsync/paypal_reply/paypal_bilan \
--bnc --debug "$f" \
> "$f2"
echo diff "$f1" "$f2"
diff "$f1" "$f2"
done
for f in /g/paypal/paypal_201?_??.csv; do
fb=`basename "$f"`
f1=/g/var/paypal_bilan/tests/$fb.out1
f2=/g/var/paypal_bilan/tests/$fb.out2_usd_eur
rm "$f2"
/g/public_html/imapsync/paypal_reply/paypal_bilan_1.11 \
--bnc --debug "$f" \
> "$f1"
/g/public_html/imapsync/paypal_reply/paypal_bilan \
--bnc --debug --usdeur 1.2981 "$f" \
> "$f2"
echo diff "$f1" "$f2"
diff "$f1" "$f2"
done
for f in /g/paypal/paypal_201?_??.csv; do
fb=`basename "$f" .csv`
#echo $fb
f1i=/g/paypal/$fb.csv
f2i=/g/paypal/${fb}_complet.csv
f1o=/g/var/paypal_bilan/tests/t03_$fb.out1
f2o=/g/var/paypal_bilan/tests/t03_$fb.out2
#echo $f1i
#echo $f2i
#echo $f1o
#echo $f2o
rm -f "$f1o" "$f2o"
/g/public_html/imapsync/paypal_reply/paypal_bilan \
--bnc --debug "$f1i" \
> "$f1o"
/g/public_html/imapsync/paypal_reply/paypal_bilan \
--bnc --debug "$f2i" \
> "$f2o"
echo diff "$f1o" "$f2o"
diff "$f1o" "$f2o"
done
)
}
#echo paypal_bilan_tests_dev
paypal_bilan_tests_dev() {
/g/public_html/imapsync/paypal_reply/paypal_bilan \
/g/paypal/paypal_201?_??_complet.csv --invoices '1 50 200'
# Strange characters
/g/public_html/imapsync/paypal_reply/paypal_bilan \
/g/paypal/paypal_201?_??_complet.csv --invoices '389 234 96'
# France
/g/public_html/imapsync/paypal_reply/paypal_bilan \
/g/paypal/paypal_201?_??_complet.csv --invoices '9 392'
# individual
/g/public_html/imapsync/paypal_reply/paypal_bilan \
/g/paypal/paypal_201?_??_complet.csv --invoices '313 415'
# /g/public_html/imapsync/paypal_reply/paypal_bilan /g/paypal/paypal_2011_03_complet.csv
# pb with latex
# Ok 10 # character
# 65 clientAdrB Keyboard character used is undefined YOSHITO YONEI
# Ok 84 Missing $ inserted. clientEmail victor_su@yahoo.com
# 92 Dr. Westernacher & Partner GmbH
# /g/public_html/imapsync/paypal_reply/paypal_bilan --first_in 147 --invoices '242' /g/paypal/paypal_2010_1?_complet.csv
}

View File

@ -1,70 +1,98 @@
#!/usr/bin/perl
# $Id: paypal_bilan,v 1.23 2011/04/19 14:59:43 gilles Exp gilles $
use strict;
use warnings;
use Getopt::Long;
use Text::CSV_XS ;
use IO::Handle ;
use Data::Dumper ;
use Unicode::MapUTF8 qw(to_utf8 from_utf8 utf8_supported_charset);
my $total_usd_received ;
my $total_usd_invoice ;
die unless (utf8_supported_charset('ISO-8859-1'));
my $total_eur_received ;
my $total_eur_invoice ;
my $nb_invoice ;
my $line ;
my $total_usd_received = 0 ;
my $total_usd_invoice = 0 ;
my $total_HT_EUR_exo = 0 ;
my $total_HT_EUR_ass = 0 ;
my $total_TVA_EUR = 0 ;
my $total_eur_received = 0 ;
my $total_eur_invoice = 0 ;
my $nb_invoice = 0 ;
my $nb_invoice_refund = 0 ;
while( $line = <> ) {
next if ( $line =~ /^Date, Heure, Fuseau horaire, Nom, Type, Etat, Devise, Montant, Numéro d'avis de réception, Solde,/ ) ;
#print( "A1 $line" ) ;
chomp( $line ) ;
#print ("A2 $line\n" );
my $debug ;
my $debug_csv ;
my $debug_dev ;
my $first_invoice = 1 ;
my $print_details = '' ;
my $bnc = '';
my $usdeur = 1.2981 ;
my $invoices ;
my %invoice_refund ;
my $write_invoices = 0;
my $dir_invoices = '/g/var/paypal_invoices' ;
my $option_ret = GetOptions (
'debug' => \$debug,
'debug_csv' => \$debug_csv,
'debug_dev' => \$debug_dev,
'first_invoice=i' => \$first_invoice,
'print_details|details' => \$print_details,
'bnc' => \$bnc,
'usdeur=f' => \$usdeur,
'invoices=s' => \$invoices,
'write_invoices!' => \$write_invoices,
);
my @files = @ARGV ;
my %action_of_invoice ;
my @invoices = split( /\s+/, $invoices ) if $invoices ;
#print "@invoices\n" ;
foreach my $file ( @files ) {
my @actions = parse_file( $file ) ;
my $line2 = '",' . $line . '"' ;
my( $Nothing, $Date, $Heure, $Fuseau_horaire, $Nom, $Type, $Etat, $Devise, $Montant, $Numero_davis_de_reception, $Solde )
= split( '","', $line2 ) ;
#print ( "[$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 'USD' eq $Devise
and 'Terminé' eq $Etat
) {
$Montant =~tr/,/./;
#print "$Montant\n" ;
my $Montant2_usd;
$Montant2_usd = 15 if ( 14.11 == $Montant or 14.19 == $Montant ) ;
$Montant2_usd = 25 if ( 23.72 == $Montant or 23.85 == $Montant ) ;
$Montant2_usd = 35 if ( 33.33 == $Montant or 33.51 == $Montant ) ;
$Montant2_usd = 50 if ( 47.75 == $Montant or 14.19 == $Montant ) ;
$Montant2_usd = 125 if ( 119.82 == $Montant or 119.82 == $Montant ) ;
$Montant2_usd = 135 if ( 129.43 == $Montant or 129.43 == $Montant ) ;
#print "$Montant $Montant2_usd\n" ;
$total_usd_received += $Montant ;
$total_usd_invoice += $Montant2_usd ;
$nb_invoice++ ;
}
if (
'Paiement sur site marchand reçu' eq $Type
and 'EUR' eq $Devise
and 'Terminé' eq $Etat
) {
$Montant =~tr/,/./;
#print "$Montant\n" ;
my $Montant2_eur;
$Montant2_eur = 22 if ( 20.88 == $Montant or 20.99 == $Montant ) ;
$Montant2_eur = 30 if ( 28.58 == $Montant or 28.73 == $Montant ) ;
$Montant2_eur = 110 if ( 105.46 == $Montant ) ;
#print "$Montant $Montant2_eur\n" ;
$total_eur_received += $Montant ;
$total_eur_invoice += $Montant2_eur ;
$nb_invoice++ ;
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 )
= @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') } ;
#print "$Nom\n" ;
my $invoice = 'NONE' ;
$Montant = $action->{ Net } if not defined $Montant;
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 ) ;
# index by invoice number
$action_of_invoice{ $action->{ 'invoice' } } = $action ;
}
delete $action_of_invoice{ 'NONE' } ;
}
@invoices = ( $first_invoice .. $first_invoice + $nb_invoice -1 ) if ( ! @invoices ) ;
foreach my $invoice ( @invoices ) {
build_invoice( $invoice ) ;
}
print "USD banque $total_usd_received\n" ;
print "USD invoice $total_usd_invoice\n" ;
my $total_eur_from_usd ;
$total_eur_from_usd = int( ( $total_usd_invoice / 1.2981 ) + 0.5 ) ; # au 30 nov 2010 http://fr.finance.yahoo.com/devises/convertisseur/#from=EUR;to=USD;amt=1
$total_eur_from_usd = int( ( $total_usd_invoice / $usdeur ) + 0.5 ) ; # au 30 nov 2010 http://fr.finance.yahoo.com/devises/convertisseur/#from=EUR;to=USD;amt=1
print "EUR from USD $total_eur_from_usd\n" ;
#$total_eur = int( ( $total_eur_invoice / 1.3 ) + 0.5 ) ;
#print "EUR $total_eur_from_usd\n" ;
@ -72,10 +100,674 @@ print "EUR banque $total_eur_received\n" ;
print "EUR invoice $total_eur_invoice\n" ;
my $total_eur = $total_eur_from_usd + $total_eur_invoice ;
print "EUR total $total_eur\n" ;
print "Nb invoice $nb_invoice\n" ;
$total_HT_EUR_exo = sprintf('%2.f', $total_HT_EUR_exo) ;
$total_HT_EUR_ass = sprintf('%2.f', $total_HT_EUR_ass) ;
$total_TVA_EUR = sprintf('%2.f', $total_TVA_EUR) ;
$total_eur = sprintf('%2.f', $total_eur) ;
print "EUR total $total_eur\n" ;
print "EUR total HT exo $total_HT_EUR_exo\n" ;
print "EUR total HT assuj $total_HT_EUR_ass\n" ;
print "EUR total TVA $total_TVA_EUR\n" ;
print "Nb invoice $nb_invoice\n" ;
print "Nb invoice refund $nb_invoice_refund\n" ;
print "$total_eur != $total_HT_EUR_exo + $total_HT_EUR_ass + $total_TVA_EUR\n"
if ( $total_eur != $total_HT_EUR_exo + $total_HT_EUR_ass + $total_TVA_EUR ) ;
sub parse_one_line_io {
my $csv = shift ;
my $io = shift ;
my $line = $csv->getline($io) ;
return if ( $csv->eof( ) ) ;
if ( not defined( $line ) ) {
my($cde, $str, $pos) = $csv->error_diag () ;
print "[$cde] [$str] [$pos]\n" ;
}
return( $line ) ;
}
sub hash_and_count_dupplicate {
my @columns = @_ ;
my %columns ;
#@columns_def{ @columns_def } = ( ) ;
foreach my $col ( @columns ) {
$columns{ $col } += 1 ;
}
$debug_csv and print "Nb columns: ", scalar( keys %columns ), " ", scalar( @columns ), "\n" ;
# debug how many time a title is defined
foreach my $col (1 .. scalar( @columns )) {
$debug_csv and print "$col | ",
deci_to_AA( $col ) , " | ",
$columns{ $columns[ $col - 1 ] }, " | ",
$columns[ $col - 1 ], "\n" ;
}
# exit in case two columns have the same name
die "Erreur : doublons dans les titres\n" if ( scalar( keys %columns ) != scalar( @columns ) ) ;
return( %columns ) ;
}
sub deci_to_AA {
my $deci = shift ;
my $AA = '';
while ( $deci > 0 ) {
my $quot = int( ( $deci - 1 ) / 26 ) ;
my $rest = $deci - 1 - ( 26 * $quot ) ;
my $char = chr ( ord('A') + $rest ) ;
$AA = $char . $AA ;
$deci = $quot ;
}
#print "col=$AA\n" ;
return( $AA ) ;
}
sub remove_first_blank {
my $string = shift ;
$string =~ s/^ +// ;
return( $string ) ;
}
sub parse_file {
my $file = shift ;
open my $io, "<", $file or die "$file: $!" ;
my $csv = Text::CSV_XS->new( {
sep_char => ',',
binary => 1,
keep_meta_info => 1,
eol => $/,
} ) ;
my $line_1 = parse_one_line_io( $csv, $io ) ;
die if ( not defined $line_1 ) ; # first line must have no problem
my @columns_def_orig = @$line_1 ;
my @columns_def = map { remove_first_blank( $_ ) } @columns_def_orig ;
$debug_csv and print "columns_def = ", map( { "[$_]" } @columns_def ), "\n";
my %columns_def = hash_and_count_dupplicate( @columns_def ) ;
my $nb_columns_def = scalar @columns_def ;
my $line_counter = 2 ;
my @actions ;
while ( 1 ) {
$debug_csv and print "ligne $line_counter ", $csv->eof( ), "\n" ;
my $line = parse_one_line_io( $csv, $io ) ;
last if ( $csv->eof( ) ) ;
if ( not defined $line ) {
print "Erreur ligne $line_counter : ", $csv->error_diag, "\n\n";
++$line_counter ;
next ;
}
my @columns = @$line ;
if ( $nb_columns_def != scalar @columns ) {
print "Erreur ligne $line_counter : nombre de colonnes = ", scalar @columns, " != $nb_columns_def\n" ;
++$line_counter ;
next ;
}
my %columns ;
@columns{ @columns_def } = @columns ;
$columns{ 'file_csv' } = $file ;
$columns{ 'line_number' } = $line_counter ;
$csv->combine( @columns ) ;
my $line_csv = $csv->string();
$columns{ 'line_csv' } = $line_csv ;
$debug_csv and print map( { "[$_] = [" . $columns{$_} . "]\n" }
@columns_def, 'line_number', 'line_csv', 'file_csv' ),
"\n";
++$line_counter ;
push( @actions, \%columns ) ;
}
close( $io );
return( reverse @actions ) ;
}
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 ) = @_ ;
$debug and print( "[$Date] [$Heure] [$Fuseau_horaire] [$Nom] [$Type] [$Etat] [$Devise] [$Montant] [$Numero_davis_de_reception] [$Solde]\n",
"[$Pays] [$Nom_Option_1] [$Valeur_Option_1]\n" ) ;
#$debug_dev and print "$Hors_taxe_paypal\n" ;
$Montant =~ s/[^0-9-,.]//g ;
$Montant =~ s/,/./g ;
#$debug and print "MM[$Montant]\n" ;
$Hors_taxe_paypal =~ s/,/./g ;
my $MontantEUR;
my( $montant_HT_EUR_exo, $montant_HT_EUR_ass, $montant_TVA_EUR ) ;
if ( $bnc ) {
$MontantEUR = $Montant ;
$MontantEUR = sprintf( "%.4f", $Montant/$usdeur ) if ($Devise eq 'USD') ;
print( "\n", "=" x 60, "\n" ) ;
print( "[$Date] [$Nom] [$Type] [$Etat] [$Devise] [$Montant] [EUR $MontantEUR]\n",
"[$Pays] [$Nom_Option_1] [$Valeur_Option_1]\n" ) ;
}
if (
'Paiement sur site marchand reçu' eq $Type
and 'USD' eq $Devise
and ( 'Terminé' eq $Etat or 'Compensé' eq $Etat )
) {
$Montant =~tr/,/./;
#print "$Montant\n" ;
my $Montant2_usd;
$Montant2_usd = $Hors_taxe_paypal ;
$total_usd_received += $Montant ;
$total_usd_invoice += $Montant2_usd ;
( $montant_HT_EUR_exo, $montant_HT_EUR_ass, $montant_TVA_EUR ) = tva_line( $Devise, $Montant2_usd, $Pays, $Nom_Option_1, $Valeur_Option_1 ) ;
$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 ;
$nb_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 ( 'Terminé' eq $Etat or 'Compensé' eq $Etat )
) {
$Montant =~tr/,/./;
#print "$Montant\n" ;
my $Montant2_eur;
$Montant2_eur = $Hors_taxe_paypal ;
$total_eur_received += $Montant ;
$total_eur_invoice += $Montant2_eur ;
( $montant_HT_EUR_exo, $montant_HT_EUR_ass, $montant_TVA_EUR ) = tva_line( $Devise, $Montant2_eur, $Pays, $Nom_Option_1, $Valeur_Option_1 ) ;
$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 ;
$nb_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 'Remboursé' eq $Etat
) {
$invoice = $first_invoice + $nb_invoice ;
$nb_invoice++ ;
$nb_invoice_refund++;
$invoice_refund{ $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 'Non compensé' eq $Etat
) {
$invoice = $first_invoice + $nb_invoice ;
$nb_invoice++ ;
$print_details and print ( "[$invoice] [$Date] [$Heure] [$Fuseau_horaire] [$Nom] [$Type] [$Etat] [$Devise] [$Montant] [$Numero_davis_de_reception] [$Solde]\n" ) ;
}
$action->{ 'invoice' } = $invoice ;
if ( $bnc ) {
my $FR_flag = '' ;
$FR_flag = ' FR' if $Pays eq 'France' ;
my $IND_flag = '' ;
$IND_flag = ' IND' if ('imapsync usage' eq $Nom_Option_1 and 'individual' eq $Valeur_Option_1 ) ;
print "FE $invoice$FR_flag$IND_flag\n" ;
print "Facture $invoice imapsync$FR_flag $Nom\n" ;
printf( "%.2f [EUR %.2f]\n", $Montant, $MontantEUR ) ;
}
}
sub build_invoice {
my $invoice = shift ;
return if ! $invoice ;
my $action = $action_of_invoice{ $invoice } ;
my $refund = '' ;
$refund = 'REFUND ' if $invoice_refund{ $invoice } ;
my %action = %$action if $action ;
#print Data::Dumper->Dump( [$action] ) ;
my( $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_reference,
$Adresse_1, $Adresse_2_district_quartier, $Ville,
$Etat_Province, $Code_postal, $Pays, $line_number, $line_csv, $file_csv )
= @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' ) } ;
#print "$Hors_taxe $Devise\n" ;
my $Hors_taxe_num = $Hors_taxe ;
$Hors_taxe_num =~ s{,}{.} ;
if ($Hors_taxe_num > 100) {
print "invoice $invoice $Hors_taxe_num > 100\n" ;
#return() ;
}
my ( $email_message_header, $email_message_body )
= build_email_message( $Date, $Nom, $De_l_adresse_email, $invoice ) ;
if ( $write_invoices ) {
write_email_message( $dir_invoices, $invoice,
$email_message_header, $email_message_body,
$De_l_adresse_email) ;
write_csv_info( $dir_invoices, $invoice, $file_csv, $line_number, $line_csv ) ;
}
#print "==== $invoice $refund=================================================" ;
#print $email_message ;
my(
$clientAdrA,
$clientAdrB,
$clientAdrC,
$clientAdrD,
$clientAdrE,
$clientAdrF,
)
= build_adress(
$Nom,
$Adresse_1,
$Adresse_2_district_quartier,
$Ville,
$Code_postal,
$Etat_Province,
$Pays,
) ;
foreach my $str (
$De_l_adresse_email,
$Nom,
$clientAdrA,
$clientAdrB,
$clientAdrC,
$clientAdrD,
$clientAdrE,
$clientAdrF,
) {
$str =~ s{#}{\\#}g ;
$str =~ s{_}{\\_}g ;
$str =~ s{&}{\\&}g ;
}
my ( $clientTypeEN, $clientTypeFR ) = client_type( $Nom_Option_1, $Valeur_Option_1 ) ;
my (
$priceHT,
$tvaFR,
$tvaEN,
$priceTVA,
$priceTTC,
$messageTVAFR,
$messageTVAEN,
$priceTTCusd
)
= tva_stuff( $clientTypeEN, $Pays, $Hors_taxe, $Devise ) ;
my ( $urlSrc, $urlExe ) = download_urls( $Date ) ;
my $tex_variables = qq{
%% Begin input from $0
\\providecommand{\\invoiceNumber}{$invoice}
\\providecommand{\\clientName}{$Nom}
\\providecommand{\\clientEmail}{$De_l_adresse_email}
\\providecommand{\\clientTypeEN}{$clientTypeEN}
\\providecommand{\\clientTypeFR}{$clientTypeFR}
\\providecommand{\\clientAdrA}{$clientAdrA}
\\providecommand{\\clientAdrB}{$clientAdrB}
\\providecommand{\\clientAdrC}{$clientAdrC}
\\providecommand{\\clientAdrD}{$clientAdrD}
\\providecommand{\\clientAdrE}{$clientAdrE}
\\providecommand{\\clientAdrF}{$clientAdrF}
\\providecommand{\\invoiceDate}{$Date}
\\providecommand{\\invoiceHour}{$Heure}
\\providecommand{\\priceHT}{$priceHT}
\\providecommand{\\tvaFR}{$tvaFR}
\\providecommand{\\tvaEN}{$tvaEN}
\\providecommand{\\priceTVA}{$priceTVA}
\\providecommand{\\priceTTC}{$priceTTC}
\\providecommand{\\priceTTCusd}{$priceTTCusd}
\\providecommand{\\messageTVAFR}{$messageTVAFR}
\\providecommand{\\messageTVAEN}{$messageTVAEN}
\\providecommand{\\urlSrc}{\\url{$urlSrc}}
\\providecommand{\\urlExe}{\\url{$urlExe}}
%% End input from $0
} ;
#print $tex_variables ;
write_tex_variables_file( $dir_invoices,
$invoice, $Date, $tex_variables ) if $write_invoices ;
}
sub build_email_message {
my ( $date, $name, $email, $invoice ) = @_ ;
my $message_header = qq{X-imapsync: invoice $invoice
From: Gilles LAMIRAL <gilles.lamiral\@laposte.net>
Bcc: gilles\@lamiral.info
Subject: [imapsync invoice] $invoice ($date)
Disposition-Notification-To: Gilles LAMIRAL <gilles.lamiral\@laposte.net>
} ;
my $message_body = qq{
Hello $name,
First I'm sorry for the delay to prepare and send you this message.
Attached is the invoice of imapsync software you bought ($date).
The invoice file is named facture_imapsync-${invoice}.pdf
This invoice is in PDF format, ready to be print.
If you need this invoice on paper, just ask me then
I will send it to you by postal mail.
In order to respect the law, this numeric invoice PDF
file is signed with my private gpg key.
The resulting gpg signature is in the file named
facture_imapsync-${invoice}.pdf.asc
also attached in this email message.
You can verify I (Gilles LAMIRAL) really generated
this invoice with the following command line
gpg --verify facture_imapsync-${invoice}.pdf.asc facture_imapsync-${invoice}.pdf
or any other gpg graphical tool.
I thank you again for buying and using imapsync.
Any feedback is welcome.
--
Au revoir, 09 51 84 42 42
Gilles Lamiral. France, Baulon (35580) 06 20 79 76 06
} ;
my $message_body_blabla = qq{
Here is the fingerprint of my public key
pub 1024D/FDA2B3DC 2002-05-08
Key fingerprint = 7906 F53D 0D62 0C67 304A 4CF0 6928 869B FDA2 B3DC
uid Gilles LAMIRAL <gilles.lamiral\@laposte.net>
sub 1024g/A2C4CB42 2002-05-08
Of course the verification doesn't prove anything until
all the following conditions are met:
- you met me,
- I agree that the fingerprint above is really mine
- I prove I'm Gilles LAMIRAL with an official paper.
Normally we won't have to verify anything unless
I disagree with this invoice and the payment
you made for imapsync.
} ;
return( $message_header, $message_body ) ;
}
sub write_csv_info {
my( $dir_invoices, $invoice, $file_csv, $line_number, $line_csv ) = @_ ;
open( CSVINFO, "> $dir_invoices/$invoice/csv_info.txt") or die ;
print CSVINFO join( "\n", $file_csv, $line_number, $line_csv ) ;
close( CSVINFO ) ;
}
sub write_email_message {
my ( $dir_invoices, $invoice, $message_header, $message_body, $email_address ) = @_ ;
my $message_body_utf8 = to_utf8({ -string => $message_body, -charset => 'ISO-8859-1' });
mkdir( "$dir_invoices/$invoice" ) or die if ! -d "$dir_invoices/$invoice" ;
open( HEADER, "> $dir_invoices/$invoice/facture_message_header.txt") or die ;
print HEADER $message_header ;
close( HEADER ) ;
open( BODY, "> $dir_invoices/$invoice/facture_message_body.txt") or die ;
print BODY $message_body_utf8 ;
close( BODY ) ;
open( ADDRESS, "> $dir_invoices/$invoice/email_address.txt") or die ;
print ADDRESS "$email_address\n" ;
close( ADDRESS ) ;
}
sub write_tex_variables_file {
my ( $dir_invoices, $invoice, $date_jjSmmSaaaa, $tex_variables ) = @_ ;
my $tex_variables_utf8 = to_utf8({ -string => $tex_variables, -charset => 'ISO-8859-1' });
mkdir( "$dir_invoices/$invoice" ) or die if ! -d "$dir_invoices/$invoice" ;
open( FILE, "> $dir_invoices/$invoice/imapsync_var.tex") or die ;
print FILE $tex_variables_utf8 ;
close( FILE ) ;
}
sub download_urls {
my $date_jjSmmSaaaa = shift ;
my $date_aaaa_mm_jj = date_aaaa_mm_jj( $date_jjSmmSaaaa ) ;
# print "$date_aaaa_mm_jj $date_jjSmmSaaaa\n" ;
my ( $urlSrc, $urlExe ) ;
if ('2011_03_24' le $date_aaaa_mm_jj) {
$urlSrc = 'http://www.linux-france.org/prj/imapsync/paypal_return.shtml' ;
$urlExe = '' ;
return( $urlSrc, $urlExe ) ;
}
if ('2011_02_21' le $date_aaaa_mm_jj) {
$urlSrc = 'http://www.linux-france.org/depot/2011_02_21/OUMbo7/' ;
$urlExe = 'http://www.linux-france.org/depot/2011_02_21/rHSVNs/' ;
return( $urlSrc, $urlExe ) ;
}
if ('2011_01_18' le $date_aaaa_mm_jj) {
$urlSrc = 'http://www.linux-france.org/depot/2011_01_18/zPRRNt/' ;
$urlExe = 'http://www.linux-france.org/depot/2011_01_18/FO1QzG/' ;
return( $urlSrc, $urlExe ) ;
}
if ('2011_01_18' le $date_aaaa_mm_jj) {
$urlSrc = 'http://www.linux-france.org/depot/2010_11_28/SiNdlZ/' ;
$urlExe = 'http://www.linux-france.org/depot/2010_11_28/R3ZAyr/' ;
return( $urlSrc, $urlExe ) ;
}
$urlSrc = 'http://www.linux-france.org/depot/2010_11_08/X2PWMe/' ;
$urlExe = 'http://www.linux-france.org/depot/2010_11_08/ZZ7zSc/' ;
return( $urlSrc, $urlExe ) ;
}
sub date_aaaa_mm_jj {
my $date_jjSmmSaaaa = shift ;
if ( $date_jjSmmSaaaa =~ m{(\d\d)/(\d\d)/(\d\d\d\d)} ) {
my( $jj, $mm, $aaaa ) = ( $1, $2, $3 ) ;
return( join( '_', $aaaa, $mm, $jj ) ) ;
}else{
return( '9999_12_31' ) ;
}
}
sub tva_line {
my( $Devise, $Montant2, $Pays, $Nom_Option_1, $Valeur_Option_1 ) = @_ ;
my( $montant_HT_EUR_exo, $montant_HT_EUR_ass, $montant_TVA_EUR ) ;
$Montant2 = $Montant2/$usdeur if 'USD' eq $Devise ;
if (
( 'imapsync usage' eq $Nom_Option_1 and 'individual' eq $Valeur_Option_1 )
or
( 'France' eq $Pays )
) {
$montant_HT_EUR_exo = 0 ;
$montant_HT_EUR_ass = $Montant2 / 1.196 ;
$montant_TVA_EUR = $Montant2 / 1.196 * 0.196 ;
$debug_dev and print "$Montant2 $Pays $Valeur_Option_1\n" ;
}else{
$montant_HT_EUR_exo = $Montant2 ;
$montant_HT_EUR_ass = 0 ;
$montant_TVA_EUR = 0 ;
}
return( $montant_HT_EUR_exo, $montant_HT_EUR_ass, $montant_TVA_EUR ) ;
}
sub tva_stuff {
my( $clientTypeEN, $Pays, $Hors_taxe, $Devise ) = @_ ;
my $priceTTCusd = '' ;
$Hors_taxe =~ s{,}{.} ;
if ( $Devise eq 'USD' ) {
$priceTTCusd = "(USD $Hors_taxe)" ;
$Hors_taxe = ( $Hors_taxe/$usdeur ) ;
}
my (
$priceHT,
$tvaFR,
$tvaEN,
$priceTVA,
$priceTTC,
$messageTVAFR,
$messageTVAEN,
) ;
if ( ( 'individual' eq $clientTypeEN)
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) ;
$priceTTC = sprintf('%2.2f', $Hors_taxe) ;
$messageTVAFR = '';
$messageTVAEN = '';
}else{
$priceHT = sprintf('%2.2f', $Hors_taxe) ;
$tvaFR = 'néant';
$tvaEN = '(none)';
$priceTVA = 0 ;
$priceTTC = $priceHT;
$messageTVAFR = 'Exonération de TVA, article 259 B-1 du Code Général des Impôts';
$messageTVAEN = '(VAT tax-exempt, article 259 B-1 French General Tax Code)';
}
foreach my $price ( $priceHT, $priceTVA, $priceTTC, $priceTTCusd ) {
#print "[$price]\n" ;
$price =~ s{\.}{, } ;
}
return(
$priceHT,
$tvaFR,
$tvaEN,
$priceTVA,
$priceTTC,
$messageTVAFR,
$messageTVAEN,
$priceTTCusd
) ;
}
sub client_type {
my ( $Nom_Option_1, $Valeur_Option_1 ) = @_ ;
my ( $clientTypeEN, $clientTypeFR ) = ( 'professional', 'professionnel' ) ;
if ('imapsync usage' eq $Nom_Option_1 and 'individual' eq $Valeur_Option_1 ) {
$clientTypeEN = 'individual' ;
$clientTypeFR = 'individuel' ;
}elsif ('imapsync usage' eq $Nom_Option_1 and 'professional' eq $Valeur_Option_1 ) {
$clientTypeEN = 'professional' ;
$clientTypeFR = 'professionnel' ;
}
return( $clientTypeEN, $clientTypeFR ) ;
}
sub build_adress {
my(
$Nom,
$Adresse_1,
$Adresse_2_district_quartier,
$Ville,
$Code_postal,
$Etat_Province,
$Pays,
) = @_ ;
my $addr = "
===========================================================
Nom $Nom
Adresse_1 $Adresse_1
Adresse_2_district_quartier $Adresse_2_district_quartier
Ville Code_postal $Ville $Code_postal
Etat_Province $Etat_Province
Pays $Pays
" ;
#print $addr ;
my @address ;
$Nom = '' if ( $Nom =~ m/^\s+$/ ) ;
push( @address, $Nom ) if $Nom ;
push( @address, $Adresse_1 ) if $Adresse_1 ;
push( @address, $Adresse_2_district_quartier ) if $Adresse_2_district_quartier ;
push( @address, "$Ville $Code_postal" ) if ( $Ville or $Code_postal );
push( @address, $Etat_Province ) if $Etat_Province ;
push( @address, $Pays, ) if $Pays ;
my $clientAdrA = shift( @address ) || '' ;
my $clientAdrB = shift( @address ) || '' ;
my $clientAdrC = shift( @address ) || '' ;
my $clientAdrD = shift( @address ) || '' ;
my $clientAdrE = shift( @address ) || '' ;
my $clientAdrF = shift( @address ) || '' ;
$addr = "
[$clientAdrA]
[$clientAdrB]
[$clientAdrC]
[$clientAdrD]
[$clientAdrE]
[$clientAdrF]
";
#print $addr ;
return(
$clientAdrA,
$clientAdrB,
$clientAdrC,
$clientAdrD,
$clientAdrE,
$clientAdrF,
) ;
}

756
paypal_reply/paypal_bilan_1.22 Executable file
View File

@ -0,0 +1,756 @@
#!/usr/bin/perl
# $Id: paypal_bilan,v 1.22 2011/04/19 12:52:27 gilles Exp gilles $
use strict;
use warnings;
use Getopt::Long;
use Text::CSV_XS ;
use IO::Handle ;
use Data::Dumper ;
use Unicode::MapUTF8 qw(to_utf8 from_utf8 utf8_supported_charset);
die unless (utf8_supported_charset('ISO-8859-1'));
my $total_usd_received = 0 ;
my $total_usd_invoice = 0 ;
my $total_eur_received = 0 ;
my $total_eur_invoice = 0 ;
my $nb_invoice = 0 ;
my $nb_invoice_refund = 0 ;
my $debug ;
my $debug_csv ;
my $debug_dev ;
my $first_invoice = 1 ;
my $print_details = '' ;
my $bnc = '';
my $usdeur = 1.2981 ;
my $invoices ;
my %invoice_refund ;
my $write_invoices = 0;
my $dir_invoices = '/g/var/paypal_invoices' ;
my $option_ret = GetOptions (
'debug' => \$debug,
'debug_csv' => \$debug_csv,
'debug_dev' => \$debug_dev,
'first_invoice=i' => \$first_invoice,
'print_details|details' => \$print_details,
'bnc' => \$bnc,
'usdeur=f' => \$usdeur,
'invoices=s' => \$invoices,
'write_invoices!' => \$write_invoices,
);
my @files = @ARGV ;
my %action_of_invoice ;
my @invoices = split( /\s+/, $invoices ) if $invoices ;
#print "@invoices\n" ;
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 )
= @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') } ;
#print "$Nom\n" ;
my $invoice = 'NONE' ;
$Montant = $action->{ Net } if not defined $Montant;
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 ) ;
# index by invoice number
$action_of_invoice{ $action->{ 'invoice' } } = $action ;
}
delete $action_of_invoice{ 'NONE' } ;
}
@invoices = ( $first_invoice .. $first_invoice + $nb_invoice -1 ) if ( ! @invoices ) ;
foreach my $invoice ( @invoices ) {
build_invoice( $invoice ) ;
}
print "USD banque $total_usd_received\n" ;
print "USD invoice $total_usd_invoice\n" ;
my $total_eur_from_usd ;
$total_eur_from_usd = int( ( $total_usd_invoice / $usdeur ) + 0.5 ) ; # au 30 nov 2010 http://fr.finance.yahoo.com/devises/convertisseur/#from=EUR;to=USD;amt=1
print "EUR from USD $total_eur_from_usd\n" ;
#$total_eur = int( ( $total_eur_invoice / 1.3 ) + 0.5 ) ;
#print "EUR $total_eur_from_usd\n" ;
print "EUR banque $total_eur_received\n" ;
print "EUR invoice $total_eur_invoice\n" ;
my $total_eur = $total_eur_from_usd + $total_eur_invoice ;
print "EUR total $total_eur\n" ;
print "Nb invoice $nb_invoice\n" ;
print "Nb invoice refund $nb_invoice_refund\n" ;
sub parse_one_line_io {
my $csv = shift ;
my $io = shift ;
my $line = $csv->getline($io) ;
return if ( $csv->eof( ) ) ;
if ( not defined( $line ) ) {
my($cde, $str, $pos) = $csv->error_diag () ;
print "[$cde] [$str] [$pos]\n" ;
}
return( $line ) ;
}
sub hash_and_count_dupplicate {
my @columns = @_ ;
my %columns ;
#@columns_def{ @columns_def } = ( ) ;
foreach my $col ( @columns ) {
$columns{ $col } += 1 ;
}
$debug_csv and print "Nb columns: ", scalar( keys %columns ), " ", scalar( @columns ), "\n" ;
# debug how many time a title is defined
foreach my $col (1 .. scalar( @columns )) {
$debug_csv and print "$col | ",
deci_to_AA( $col ) , " | ",
$columns{ $columns[ $col - 1 ] }, " | ",
$columns[ $col - 1 ], "\n" ;
}
# exit in case two columns have the same name
die "Erreur : doublons dans les titres\n" if ( scalar( keys %columns ) != scalar( @columns ) ) ;
return( %columns ) ;
}
sub deci_to_AA {
my $deci = shift ;
my $AA = '';
while ( $deci > 0 ) {
my $quot = int( ( $deci - 1 ) / 26 ) ;
my $rest = $deci - 1 - ( 26 * $quot ) ;
my $char = chr ( ord('A') + $rest ) ;
$AA = $char . $AA ;
$deci = $quot ;
}
#print "col=$AA\n" ;
return( $AA ) ;
}
sub remove_first_blank {
my $string = shift ;
$string =~ s/^ +// ;
return( $string ) ;
}
sub parse_file {
my $file = shift ;
open my $io, "<", $file or die "$file: $!" ;
my $csv = Text::CSV_XS->new( {
sep_char => ',',
binary => 1,
keep_meta_info => 1,
eol => $/,
} ) ;
my $line_1 = parse_one_line_io( $csv, $io ) ;
die if ( not defined $line_1 ) ; # first line must have no problem
my @columns_def_orig = @$line_1 ;
my @columns_def = map { remove_first_blank( $_ ) } @columns_def_orig ;
$debug_csv and print "columns_def = ", map( { "[$_]" } @columns_def ), "\n";
my %columns_def = hash_and_count_dupplicate( @columns_def ) ;
my $nb_columns_def = scalar @columns_def ;
my $line_counter = 2 ;
my @actions ;
while ( 1 ) {
$debug_csv and print "ligne $line_counter ", $csv->eof( ), "\n" ;
my $line = parse_one_line_io( $csv, $io ) ;
last if ( $csv->eof( ) ) ;
if ( not defined $line ) {
print "Erreur ligne $line_counter : ", $csv->error_diag, "\n\n";
++$line_counter ;
next ;
}
my @columns = @$line ;
if ( $nb_columns_def != scalar @columns ) {
print "Erreur ligne $line_counter : nombre de colonnes = ", scalar @columns, " != $nb_columns_def\n" ;
++$line_counter ;
next ;
}
my %columns ;
@columns{ @columns_def } = @columns ;
$columns{ 'file_csv' } = $file ;
$columns{ 'line_number' } = $line_counter ;
$csv->combine( @columns ) ;
my $line_csv = $csv->string();
$columns{ 'line_csv' } = $line_csv ;
$debug_csv and print map( { "[$_] = [" . $columns{$_} . "]\n" }
@columns_def, 'line_number', 'line_csv', 'file_csv' ),
"\n";
++$line_counter ;
push( @actions, \%columns ) ;
}
close( $io );
return( reverse @actions ) ;
}
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 ) = @_ ;
$debug and print( "[$Date] [$Heure] [$Fuseau_horaire] [$Nom] [$Type] [$Etat] [$Devise] [$Montant] [$Numero_davis_de_reception] [$Solde]\n",
"[$Pays] [$Nom_Option_1] [$Valeur_Option_1]\n" ) ;
#$debug_dev and print "$Hors_taxe_paypal\n" ;
$Montant =~ s/[^0-9-,.]//g ;
$Montant =~ s/,/./g ;
#$debug and print "MM[$Montant]\n" ;
$Hors_taxe_paypal =~ s/,/./g ;
my $MontantEUR;
if ( $bnc ) {
$MontantEUR = $Montant ;
$MontantEUR = sprintf( "%.4f", $Montant/$usdeur ) if ($Devise eq 'USD') ;
print( "\n", "=" x 60, "\n" ) ;
print( "[$Date] [$Nom] [$Type] [$Etat] [$Devise] [$Montant] [EUR $MontantEUR]\n",
"[$Pays] [$Nom_Option_1] [$Valeur_Option_1]\n" ) ;
}
if (
'Paiement sur site marchand reçu' eq $Type
and 'USD' eq $Devise
and 'Terminé' eq $Etat
) {
$Montant =~tr/,/./;
#print "$Montant\n" ;
my $Montant2_usd;
$Montant2_usd = $Hors_taxe_paypal ;
$total_usd_received += $Montant ;
$total_usd_invoice += $Montant2_usd ;
$invoice = $first_invoice + $nb_invoice ;
$nb_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 'USD' eq $Devise
and 'Compensé' eq $Etat
) {
$Montant =~tr/,/./;
#print "$Montant\n" ;
my $Montant2_usd;
$Montant2_usd = $Hors_taxe_paypal ;
$total_usd_received += $Montant ;
$total_usd_invoice += $Montant2_usd ;
$invoice = $first_invoice + $nb_invoice ;
$nb_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 'Terminé' eq $Etat
) {
$Montant =~tr/,/./;
#print "$Montant\n" ;
my $Montant2_eur;
$Montant2_eur = $Hors_taxe_paypal ;
$total_eur_received += $Montant ;
$total_eur_invoice += $Montant2_eur ;
$invoice = $first_invoice + $nb_invoice ;
$nb_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 'Remboursé' eq $Etat
) {
$invoice = $first_invoice + $nb_invoice ;
$nb_invoice++ ;
$nb_invoice_refund++;
$invoice_refund{ $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 'Compensé' eq $Etat
) {
$Montant =~tr/,/./;
#print "$Montant\n" ;
my $Montant2_eur;
$Montant2_eur = 21.99 if ( 20.88 == $Montant or 20.99 == $Montant ) ;
$Montant2_eur = 30 if ( 28.58 == $Montant or 28.73 == $Montant ) ;
$Montant2_eur = 110 if ( 105.46 == $Montant ) ;
#print "$Montant $Montant2_eur\n" ;
$total_eur_received += $Montant ;
$total_eur_invoice += $Montant2_eur ;
$invoice = $first_invoice + $nb_invoice ;
$nb_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 'Non compensé' eq $Etat
) {
$invoice = $first_invoice + $nb_invoice ;
$nb_invoice++ ;
$print_details and print ( "[$invoice] [$Date] [$Heure] [$Fuseau_horaire] [$Nom] [$Type] [$Etat] [$Devise] [$Montant] [$Numero_davis_de_reception] [$Solde]\n" ) ;
}
$action->{ 'invoice' } = $invoice ;
if ( $bnc ) {
my $FR_flag = '' ;
$FR_flag = ' FR' if $Pays eq 'France' ;
my $IND_flag = '' ;
$IND_flag = ' IND' if ('imapsync usage' eq $Nom_Option_1 and 'individual' eq $Valeur_Option_1 ) ;
print "FE $invoice$FR_flag$IND_flag\n" ;
print "Facture $invoice imapsync$FR_flag $Nom\n" ;
printf( "%.2f [EUR %.2f]\n", $Montant, $MontantEUR ) ;
}
}
sub build_invoice {
my $invoice = shift ;
return if ! $invoice ;
my $action = $action_of_invoice{ $invoice } ;
my $refund = '' ;
$refund = 'REFUND ' if $invoice_refund{ $invoice } ;
my %action = %$action if $action ;
#print Data::Dumper->Dump( [$action] ) ;
my( $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_reference,
$Adresse_1, $Adresse_2_district_quartier, $Ville,
$Etat_Province, $Code_postal, $Pays, $line_number, $line_csv, $file_csv )
= @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' ) } ;
#print "$Hors_taxe $Devise\n" ;
my $Hors_taxe_num = $Hors_taxe ;
$Hors_taxe_num =~ s{,}{.} ;
if ($Hors_taxe_num > 100) {
print "invoice $invoice $Hors_taxe_num > 100\n" ;
#return() ;
}
my ( $email_message_header, $email_message_body )
= build_email_message( $Date, $Nom, $De_l_adresse_email, $invoice ) ;
if ( $write_invoices ) {
write_email_message( $dir_invoices, $invoice,
$email_message_header, $email_message_body,
$De_l_adresse_email) ;
write_csv_info( $dir_invoices, $invoice, $file_csv, $line_number, $line_csv ) ;
}
#print "==== $invoice $refund=================================================" ;
#print $email_message ;
my(
$clientAdrA,
$clientAdrB,
$clientAdrC,
$clientAdrD,
$clientAdrE,
$clientAdrF,
)
= build_adress(
$Nom,
$Adresse_1,
$Adresse_2_district_quartier,
$Ville,
$Code_postal,
$Etat_Province,
$Pays,
) ;
foreach my $str (
$De_l_adresse_email,
$Nom,
$clientAdrA,
$clientAdrB,
$clientAdrC,
$clientAdrD,
$clientAdrE,
$clientAdrF,
) {
$str =~ s{#}{\\#}g ;
$str =~ s{_}{\\_}g ;
$str =~ s{&}{\\&}g ;
}
my ( $clientTypeEN, $clientTypeFR ) = client_type( $Nom_Option_1, $Valeur_Option_1 ) ;
my (
$priceHT,
$tvaFR,
$tvaEN,
$priceTVA,
$priceTTC,
$messageTVAFR,
$messageTVAEN,
$priceTTCusd
)
= tva_stuff( $clientTypeEN, $Pays, $Hors_taxe, $Devise ) ;
my ( $urlSrc, $urlExe ) = download_urls( $Date ) ;
my $tex_variables = qq{
%% Begin input from $0
\\providecommand{\\invoiceNumber}{$invoice}
\\providecommand{\\clientName}{$Nom}
\\providecommand{\\clientEmail}{$De_l_adresse_email}
\\providecommand{\\clientTypeEN}{$clientTypeEN}
\\providecommand{\\clientTypeFR}{$clientTypeFR}
\\providecommand{\\clientAdrA}{$clientAdrA}
\\providecommand{\\clientAdrB}{$clientAdrB}
\\providecommand{\\clientAdrC}{$clientAdrC}
\\providecommand{\\clientAdrD}{$clientAdrD}
\\providecommand{\\clientAdrE}{$clientAdrE}
\\providecommand{\\clientAdrF}{$clientAdrF}
\\providecommand{\\invoiceDate}{$Date}
\\providecommand{\\invoiceHour}{$Heure}
\\providecommand{\\priceHT}{$priceHT}
\\providecommand{\\tvaFR}{$tvaFR}
\\providecommand{\\tvaEN}{$tvaEN}
\\providecommand{\\priceTVA}{$priceTVA}
\\providecommand{\\priceTTC}{$priceTTC}
\\providecommand{\\priceTTCusd}{$priceTTCusd}
\\providecommand{\\messageTVAFR}{$messageTVAFR}
\\providecommand{\\messageTVAEN}{$messageTVAEN}
\\providecommand{\\urlSrc}{\\url{$urlSrc}}
\\providecommand{\\urlExe}{\\url{$urlExe}}
%% End input from $0
} ;
#print $tex_variables ;
write_tex_variables_file( $dir_invoices,
$invoice, $Date, $tex_variables ) if $write_invoices ;
}
sub build_email_message {
my ( $date, $name, $email, $invoice ) = @_ ;
my $message_header = qq{X-imapsync: invoice $invoice
From: Gilles LAMIRAL <gilles.lamiral\@laposte.net>
Bcc: gilles\@lamiral.info
Subject: [imapsync invoice] $invoice ($date)
Disposition-Notification-To: Gilles LAMIRAL <gilles.lamiral\@laposte.net>
} ;
my $message_body = qq{
Hello $name,
First I'm sorry for the delay to prepare and send you this message.
Attached is the invoice of imapsync software you bought ($date).
The invoice file is named facture_imapsync-${invoice}.pdf
This invoice is in PDF format, ready to be print.
If you need this invoice on paper, just ask me then
I will send it to you by postal mail.
In order to respect the law, this numeric invoice PDF
file is signed with my private gpg key.
The resulting gpg signature is in the file named
facture_imapsync-${invoice}.pdf.asc
also attached in this email message.
You can verify I (Gilles LAMIRAL) really generated
this invoice with the following command line
gpg --verify facture_imapsync-${invoice}.pdf.asc facture_imapsync-${invoice}.pdf
or any other gpg graphical tool.
I thank you again for buying and using imapsync.
Any feedback is welcome.
--
Au revoir, 09 51 84 42 42
Gilles Lamiral. France, Baulon (35580) 06 20 79 76 06
} ;
my $message_body_blabla = qq{
Here is the fingerprint of my public key
pub 1024D/FDA2B3DC 2002-05-08
Key fingerprint = 7906 F53D 0D62 0C67 304A 4CF0 6928 869B FDA2 B3DC
uid Gilles LAMIRAL <gilles.lamiral\@laposte.net>
sub 1024g/A2C4CB42 2002-05-08
Of course the verification doesn't prove anything until
all the following conditions are met:
- you met me,
- I agree that the fingerprint above is really mine
- I prove I'm Gilles LAMIRAL with an official paper.
Normally we won't have to verify anything unless
I disagree with this invoice and the payment
you made for imapsync.
} ;
return( $message_header, $message_body ) ;
}
sub write_csv_info {
my( $dir_invoices, $invoice, $file_csv, $line_number, $line_csv ) = @_ ;
open( CSVINFO, "> $dir_invoices/$invoice/csv_info.txt") or die ;
print CSVINFO join( "\n", $file_csv, $line_number, $line_csv ) ;
close( CSVINFO ) ;
}
sub write_email_message {
my ( $dir_invoices, $invoice, $message_header, $message_body, $email_address ) = @_ ;
my $message_body_utf8 = to_utf8({ -string => $message_body, -charset => 'ISO-8859-1' });
mkdir( "$dir_invoices/$invoice" ) or die if ! -d "$dir_invoices/$invoice" ;
open( HEADER, "> $dir_invoices/$invoice/facture_message_header.txt") or die ;
print HEADER $message_header ;
close( HEADER ) ;
open( BODY, "> $dir_invoices/$invoice/facture_message_body.txt") or die ;
print BODY $message_body_utf8 ;
close( BODY ) ;
open( ADDRESS, "> $dir_invoices/$invoice/email_address.txt") or die ;
print ADDRESS "$email_address\n" ;
close( ADDRESS ) ;
}
sub write_tex_variables_file {
my ( $dir_invoices, $invoice, $date_jjSmmSaaaa, $tex_variables ) = @_ ;
my $tex_variables_utf8 = to_utf8({ -string => $tex_variables, -charset => 'ISO-8859-1' });
mkdir( "$dir_invoices/$invoice" ) or die if ! -d "$dir_invoices/$invoice" ;
open( FILE, "> $dir_invoices/$invoice/imapsync_var.tex") or die ;
print FILE $tex_variables_utf8 ;
close( FILE ) ;
}
sub download_urls {
my $date_jjSmmSaaaa = shift ;
my $date_aaaa_mm_jj = date_aaaa_mm_jj( $date_jjSmmSaaaa ) ;
# print "$date_aaaa_mm_jj $date_jjSmmSaaaa\n" ;
my ( $urlSrc, $urlExe ) ;
if ('2011_03_24' le $date_aaaa_mm_jj) {
$urlSrc = 'http://www.linux-france.org/prj/imapsync/paypal_return.shtml' ;
$urlExe = '' ;
return( $urlSrc, $urlExe ) ;
}
if ('2011_02_21' le $date_aaaa_mm_jj) {
$urlSrc = 'http://www.linux-france.org/depot/2011_02_21/OUMbo7/' ;
$urlExe = 'http://www.linux-france.org/depot/2011_02_21/rHSVNs/' ;
return( $urlSrc, $urlExe ) ;
}
if ('2011_01_18' le $date_aaaa_mm_jj) {
$urlSrc = 'http://www.linux-france.org/depot/2011_01_18/zPRRNt/' ;
$urlExe = 'http://www.linux-france.org/depot/2011_01_18/FO1QzG/' ;
return( $urlSrc, $urlExe ) ;
}
if ('2011_01_18' le $date_aaaa_mm_jj) {
$urlSrc = 'http://www.linux-france.org/depot/2010_11_28/SiNdlZ/' ;
$urlExe = 'http://www.linux-france.org/depot/2010_11_28/R3ZAyr/' ;
return( $urlSrc, $urlExe ) ;
}
$urlSrc = 'http://www.linux-france.org/depot/2010_11_08/X2PWMe/' ;
$urlExe = 'http://www.linux-france.org/depot/2010_11_08/ZZ7zSc/' ;
return( $urlSrc, $urlExe ) ;
}
sub date_aaaa_mm_jj {
my $date_jjSmmSaaaa = shift ;
if ( $date_jjSmmSaaaa =~ m{(\d\d)/(\d\d)/(\d\d\d\d)} ) {
my( $jj, $mm, $aaaa ) = ( $1, $2, $3 ) ;
return( join( '_', $aaaa, $mm, $jj ) ) ;
}else{
return( '9999_12_31' ) ;
}
}
sub tva_stuff {
my( $clientTypeEN, $Pays, $Hors_taxe, $Devise ) = @_ ;
my $priceTTCusd = '' ;
$Hors_taxe =~ s{,}{.} ;
if ( $Devise eq 'USD' ) {
$priceTTCusd = "(USD $Hors_taxe)" ;
$Hors_taxe = ( $Hors_taxe/$usdeur ) ;
}
my (
$priceHT,
$tvaFR,
$tvaEN,
$priceTVA,
$priceTTC,
$messageTVAFR,
$messageTVAEN,
) ;
if ( ( 'individual' eq $clientTypeEN)
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) ;
$priceTTC = sprintf('%2.2f', $Hors_taxe) ;
$messageTVAFR = '';
$messageTVAEN = '';
}else{
$priceHT = sprintf('%2.2f', $Hors_taxe) ;
$tvaFR = 'néant';
$tvaEN = '(none)';
$priceTVA = 0 ;
$priceTTC = $priceHT;
$messageTVAFR = 'Exonération de TVA, article 259 B-1 du Code Général des Impôts';
$messageTVAEN = '(VAT tax-exempt, article 259 B-1 French General Tax Code)';
}
foreach my $price ( $priceHT, $priceTVA, $priceTTC, $priceTTCusd ) {
#print "[$price]\n" ;
$price =~ s{\.}{, } ;
}
return(
$priceHT,
$tvaFR,
$tvaEN,
$priceTVA,
$priceTTC,
$messageTVAFR,
$messageTVAEN,
$priceTTCusd
) ;
}
sub client_type {
my ( $Nom_Option_1, $Valeur_Option_1 ) = @_ ;
my ( $clientTypeEN, $clientTypeFR ) = ( 'professional', 'professionnel' ) ;
if ('imapsync usage' eq $Nom_Option_1 and 'individual' eq $Valeur_Option_1 ) {
$clientTypeEN = 'individual' ;
$clientTypeFR = 'individuel' ;
}elsif ('imapsync usage' eq $Nom_Option_1 and 'professional' eq $Valeur_Option_1 ) {
$clientTypeEN = 'professional' ;
$clientTypeFR = 'professionnel' ;
}
return( $clientTypeEN, $clientTypeFR ) ;
}
sub build_adress {
my(
$Nom,
$Adresse_1,
$Adresse_2_district_quartier,
$Ville,
$Code_postal,
$Etat_Province,
$Pays,
) = @_ ;
my $addr = "
===========================================================
Nom $Nom
Adresse_1 $Adresse_1
Adresse_2_district_quartier $Adresse_2_district_quartier
Ville Code_postal $Ville $Code_postal
Etat_Province $Etat_Province
Pays $Pays
" ;
#print $addr ;
my @address ;
$Nom = '' if ( $Nom =~ m/^\s+$/ ) ;
push( @address, $Nom ) if $Nom ;
push( @address, $Adresse_1 ) if $Adresse_1 ;
push( @address, $Adresse_2_district_quartier ) if $Adresse_2_district_quartier ;
push( @address, "$Ville $Code_postal" ) if ( $Ville or $Code_postal );
push( @address, $Etat_Province ) if $Etat_Province ;
push( @address, $Pays, ) if $Pays ;
my $clientAdrA = shift( @address ) || '' ;
my $clientAdrB = shift( @address ) || '' ;
my $clientAdrC = shift( @address ) || '' ;
my $clientAdrD = shift( @address ) || '' ;
my $clientAdrE = shift( @address ) || '' ;
my $clientAdrF = shift( @address ) || '' ;
$addr = "
[$clientAdrA]
[$clientAdrB]
[$clientAdrC]
[$clientAdrD]
[$clientAdrE]
[$clientAdrF]
";
#print $addr ;
return(
$clientAdrA,
$clientAdrB,
$clientAdrC,
$clientAdrD,
$clientAdrE,
$clientAdrF,
) ;
}

View File

@ -0,0 +1,83 @@
#!/bin/sh
# usage: sh paypal_build_invoices/g/var/paypal_invoices/???
cp /home/gilles/public_html/AGIL/factures/000/facture_imapsync-000.tex /g/var/paypal_invoices/
set -x
/g/public_html/imapsync/paypal_reply/paypal_bilan --write_invoices --first_in 147 /g/paypal/paypal_2010_11_complet.csv
/g/public_html/imapsync/paypal_reply/paypal_bilan --write_invoices --first_in 214 /g/paypal/paypal_2010_12_complet.csv
/g/public_html/imapsync/paypal_reply/paypal_bilan --write_invoices --first_in 294 /g/paypal/paypal_2011_01_complet.csv
/g/public_html/imapsync/paypal_reply/paypal_bilan --write_invoices --first_in 382 /g/paypal/paypal_2011_02_complet.csv
/g/public_html/imapsync/paypal_reply/paypal_bilan --write_invoices --first_in 473 /g/paypal/paypal_2011_03_complet.csv
set +x
# USD de 147 à 340
# EUR de 341 à ...
# 20110413 Found problems with 189 199 249 258 263 359 537
# 20110412 Found problems with 189 199 242 249 258 263 359 382 537
# cen cen JAP cen cen cen cen TCH JAP
# cen
# 155 TVA 1,89
# 171 TVA 4,42
# 220 TVA 3,16
# 225 TVA 3,16
# 236 TVA 4,42
# 298 TVA 3,16
# 307 TVA 4,42
# 312 TVA 4,42
# 324 TVA 4,42
# 351 TVA 4,92
# 395 TVA 4,92
# 408 TVA 4,92
# 419 TVA 4,92
# 432 TVA 4,92
# 435 TVA 4,92
# 452 TVA 4,92
# 460 TVA 4,92
# 461 TVA 4,92
# 463 TVA 4,92
# 464 TVA 4,92
# 475 TVA 4,92
# 487 TVA 4,92
# 489 TVA 4,92
# 502 TVA 4,92
# 504 TVA 4,92
# 511 TVA 4,92
# 522 TVA 4,92
# 523 TVA 4,92
# 533 TVA 4,92
# 537 TVA 4,92
# 540 TVA 4,92
# 543 TVA 4,92
# 549 TVA 4,92
# 551 TVA 4,92
# 552 TVA 4,92
# 556 TVA 4,92
# 563 TVA 4,92
for d in "$@"; do
echo "==== $d ===="
cd $d
bd=`basename $d`
ln -f ../facture_imapsync-000.tex facture_imapsync-$bd.tex;
if ! pdflatex facture_imapsync-$bd.tex < /dev/null > /dev/null; then
echo "PB $bd"
if test -f facture_imapsync-${bd}_good.tex \
&& pdflatex facture_imapsync-${bd}_good.tex < /dev/null > /dev/null
then
ln -f facture_imapsync-${bd}_good.pdf facture_imapsync-$bd.pdf
echo "PB $bd solved with manual facture_imapsync-${bd}_good.tex"
PB_LIST_MANUAL="$PB_LIST_MANUAL $bd"
else
PB_LIST="$PB_LIST $bd"
rm -f facture_imapsync-$bd.pdf
continue
fi
fi
gpg --use-agent --armor --detach-sign --yes facture_imapsync-$bd.pdf
done
echo "Found problems with $PB_LIST"
echo "Manual invoices for $PB_LIST_MANUAL"

View File

@ -1,9 +1,10 @@
#!/usr/bin/perl
# $Id: paypal_build_reply,v 1.10 2011/02/02 22:31:41 gilles Exp gilles $
# $Id: paypal_build_reply,v 1.12 2011/03/23 18:31:52 gilles Exp gilles $
use warnings;
use strict;
use Getopt::Long;
my ($msg_id_file, $msg_id);
my ($amount, $name, $email);
@ -13,23 +14,39 @@ my (
$url_source, $url_exe, $url, $release,
);
my $help ;
my $debug ;
my $numopt = scalar(@ARGV);
my $opt_ret = GetOptions(
"help" => \$help,
"debug!" => \$debug,
);
usage() and exit if ($help or ! $numopt) ;
$msg_id_file = $ARGV[1];
$msg_id = firstline($msg_id_file);
$debug and print "Hi!\n" ;
while(<>) {
next if ( ! /^(.*Num.+ro de transaction :.*)$/ );
next if ( ! /^(.*Num.+ro de transaction.*)$/ );
$paypal_line = $1;
$paypal_info = "===== Paypal id =====\n$paypal_line\n";
$debug and print "$paypal_info" ;
last;
}
while(<>) {
next if ( ! /^Vous avez re.*paiement d'un montant de (.*) de la part de (.*) \((.*)\)/);
($amount, $name, $email) = ($1, $2, $3);
last;
if ( /^Vous avez re.*paiement d'un montant de (.*) de la part de (.*) \((.*)\)/) {
($amount, $name, $email) = ($1, $2, $3);
last;
}
if ( /^Vous avez re.*paiement d'un montant de (.*) de la part de (.*)/) {
($amount, $name, $email) = ($1, "", $2);
last;
}
}
$url_source = firstline('/g/var/paypal_reply/url_source');
$url_exe = firstline('/g/var/paypal_reply/url_exe');
$release = firstline('/g/var/paypal_reply/url_release');
@ -37,18 +54,25 @@ $release = firstline('/g/var/paypal_reply/url_release');
#print "[$amount] [$name] [$email] [$paypal_line]\n";
while(<>) {
next if ( ! /^Acheteur/ );
$buyer .= "===== Acheteur =====\n";
last;
if ( /^Acheteur/ ) {
$buyer .= "===== Acheteur =====\n";
last;
}
if ( /^Informations sur l'acheteur/ ) {
$buyer .= "===== Acheteur =====\n";
chomp( $name = <> );
$buyer .= "$name\n" ;
last;
}
}
while(<>) {
$buyer .= $_ if ( ! /^Instructions/ );
last if ( /^Instructions/ );
$buyer .= $_ if ( ! /^-----------------------------------/ );
last if ( /^-----------------------------------/ );
}
while(<>) {
next if ( ! /^Description :(.*)/ );
$description = "===== Details =====\n";
@ -57,13 +81,16 @@ while(<>) {
}
while(<>) {
$debug and print "LINE:$_" ;
$description .= $_;
last if ( /^Paiement envoy/ );
last if ( /^N.*d'avis de r.*ception/ );
}
my $address = 'gilles.lamiral@laposte.net';
my $address2 = 'gilles@lamiral.info';
my $rcstag = '$Id: paypal_build_reply,v 1.10 2011/02/02 22:31:41 gilles Exp gilles $';
my $rcstag = '$Id: paypal_build_reply,v 1.12 2011/03/23 18:31:52 gilles Exp gilles $';
my $message = <<EOM
X-Comment: $rcstag
@ -81,6 +108,8 @@ $url_source
You will find the latest imapsync.exe binary release $release at the following link:
$url_exe
You will receive an invoice soon.
Next imapsync releases will be available for one year without extra payment.
Just keep this message and ask for the new links.
(I will build an automatic subscription tool later)

View File

@ -1,8 +1,6 @@
#!/bin/sh
# $Id: paypal_functions,v 1.12 2011/02/02 22:32:26 gilles Exp gilles $
# $Id: paypal_functions,v 1.15 2011/03/23 19:10:56 gilles Exp gilles $
paypal_prerequisites() {
perl -mMIME::Lite -e '' || echo 'sudo aptitude install libmime-lite-perl'
@ -35,16 +33,15 @@ paypal_init_petite_INBOX() {
}
paypal_init_test() {
paypal_init_petite_dev() {
user=gilles@est.belle
passfile=/g/var/pass/secret.gilles_mbox
host=p
tmpdir=/g/var/paypal_reply_test
folder='INBOX.03_imapsync.imapsync_paypal'
tmpdir=/g/var/paypal_reply_dev
folder='INBOX.03_imapsync.imapsync_paypal_dev'
}
get_mail() {
# creation des répertoires
mkdir -p $tmpdir/msg_in/
@ -58,6 +55,19 @@ get_mail() {
)
}
get_mail_PP1470() {
# creation des répertoires
mkdir -p $tmpdir/msg_in/
mkdir -p $tmpdir/msg_id/
(
cd $tmpdir/msg_in/
# recuperation des messages de la boite sans destruction des messages
# transférés
paypal_imapget --host $host --user $user --passfile $passfile \
--folder $folder --search TEXT --search PP1470
)
}
extract_mail() {
mkdir -p $tmpdir/msg_out/
@ -123,9 +133,8 @@ build_reply_arg() {
bd=`basename "$d"`
file_id=`troncate_last_2_chars $bd`
d_reply="$tmpdir/msg_reply/$file_id"
test -f "$d_reply/$file_id.txt" && continue
mkdir -p "$d_reply"
echo building "$d_reply/$file_id.txt"
echo paypal_build_reply "$f" "$tmpdir/msg_id/$file_id"
paypal_build_reply "$f" "$tmpdir/msg_id/$file_id"
done
}
@ -151,8 +160,8 @@ paypal_all() {
paypal_prerequisites
echo "Will get messages in $tmpdir/msg_in/"
get_mail
get_mail_PP1470
echo "Done get messages in $tmpdir/msg_in/"
echo "Will extract_mail in $tmpdir/msg_out/"
extract_mail
echo "Done extract_mail in $tmpdir/msg_out/"
@ -188,4 +197,31 @@ paypal_reply_laposte() {
echo "Done paypal_reply_laposte"
}
paypal_all_dev() {
paypal_prerequisites
echo "Will get messages in $tmpdir/msg_in/"
get_mail_PP1470
echo "Done get messages in $tmpdir/msg_in/"
echo "Will extract_mail in $tmpdir/msg_out/"
extract_mail
echo "Done extract_mail in $tmpdir/msg_out/"
echo "Will converting to utf8 in $tmpdir/msg_out_utf8/"
convert_utf8
echo "Done converting to utf8 in $tmpdir/msg_out_utf8/"
echo "Will build_reply in $tmpdir/msg_reply/"
build_reply
echo "Done build_reply in $tmpdir/msg_reply/"
echo "Will send_reply $@"
send_reply "$@"
echo "Done send_reply $@"
}
paypal_reply_petite_dev() {
echo "Doing paypal_reply_petite_dev"
echo paypal_init_petite_dev
paypal_init_petite_dev
paypal_all_dev "$@"
echo "Done paypal_reply_petite_dev"
}

View File

@ -1,6 +1,6 @@
#!/usr/bin/perl -w
# $Id: paypal_imapget,v 1.6 2010/12/29 23:50:45 gilles Exp gilles $
# $Id: paypal_imapget,v 1.7 2011/03/23 17:05:24 gilles Exp gilles $
use Getopt::Long;
use Mail::IMAPClient;
@ -15,6 +15,7 @@ my $user;
my $password;
my $passfile;
my $folder = 'INBOX';
my @search ;
my $help;
my $numopt = scalar(@ARGV);
@ -24,6 +25,7 @@ my $opt_ret = GetOptions(
"password=s" => \$password,
"passfile=s" => \$passfile,
"folder=s" => \$folder,
"search=s" => \@search,
"help" => \$help,
"delete!" => \$delete,
"expunge!" => \$expunge,
@ -51,7 +53,10 @@ $imap->select($folder) or die "Error select folder [$folder] host [$host] user [
#my @uids = $imap->search('HEADER', 'SUBJECT',"=?windows-1252?Q?Avis_de_r=E9ception_d=27un_paiement?=");
#my @uids = $imap->search('HEADER', 'Sender','sendmail@paypal.com');
my @uids = $imap->search('TEXT', 'PP341');
#my @uids = $imap->search('TEXT', 'PP341');
print "@search\n" ;
@search = ('TEXT', 'PP341') if not @search ;
my @uids = $imap->search('HEADER', 'Sender','sendmail@paypal.com', @search );
print "Search: [@uids]\n";
foreach $msg (@uids) {

View File

@ -1,6 +1,6 @@
#!/bin/sh
# $Id: paypal_run_test,v 1.1 2010/11/28 01:00:45 gilles Exp gilles $
# $Id: paypal_run_dev,v 1.4 2011/03/23 19:08:30 gilles Exp gilles $
set -e
#set -x
@ -8,7 +8,7 @@ set -e
# Add path to commands at home
PATH=$PATH:/g/public_html/imapsync/paypal_reply
PERL5LIB=/g/public_html/imapsync/Mail-IMAPClient-3.25/lib
PERL5LIB=/g/public_html/imapsync/Mail-IMAPClient-3.28/lib
export PERL5LIB
test -f /g/public_html/imapsync/paypal_reply/paypal_functions \
@ -18,7 +18,7 @@ test -f /g/public_html/imapsync/paypal_reply/paypal_functions \
DATE_1=`date`
echo "==== paypal_reply_test ===="
paypal_reply_test
paypal_reply_petite_dev "$@"
echo

View File

@ -1,6 +1,6 @@
#!/bin/sh
# $Id: paypal_run_laposte,v 1.2 2010/11/28 05:27:12 gilles Exp gilles $
# $Id: paypal_run_laposte,v 1.3 2011/03/23 17:02:39 gilles Exp $
set -e
#set -x
@ -8,7 +8,7 @@ set -e
# Add path to commands at home
PATH=$PATH:/g/public_html/imapsync/paypal_reply
PERL5LIB=/g/public_html/imapsync/Mail-IMAPClient-3.25/lib
PERL5LIB=/g/public_html/imapsync/Mail-IMAPClient-3.28/lib
export PERL5LIB
test -f /g/public_html/imapsync/paypal_reply/paypal_functions \

View File

@ -1,6 +1,6 @@
#!/bin/sh
# $Id: paypal_run_petite,v 1.4 2010/12/14 15:40:13 gilles Exp gilles $
# $Id: paypal_run_petite,v 1.5 2011/03/23 17:02:39 gilles Exp $
set -e
#set -x
@ -8,7 +8,7 @@ set -e
# Add path to commands at home
PATH=$PATH:/g/public_html/imapsync/paypal_reply
PERL5LIB=/g/public_html/imapsync/Mail-IMAPClient-3.25/lib
PERL5LIB=/g/public_html/imapsync/Mail-IMAPClient-3.28/lib
export PERL5LIB
test -f /g/public_html/imapsync/paypal_reply/paypal_functions \

View File

@ -0,0 +1,43 @@
#!/bin/sh
# usages:
# sh paypal_send_invoices /g/var/paypal_invoices/147
# sh paypal_send_invoices /g/var/paypal_invoices/15?
send_invoice() {
test X"" = X"$1" && { echo "usage: send_invoice /g/var/paypal_invoices/147 vince@norestech.net"; return; }
d="$1"
echo "====== $d ======"
#echo
cd $d || return
bd=`basename $d`
#echo "$bd"
invoice="$bd"
test -f facture_imapsync-${invoice}.pdf || { echo NO facture_imapsync-${invoice}.pdf ; return; }
test -f facture_imapsync-${invoice}.pdf.asc || { echo NO facture_imapsync-${invoice}.pdf.asc ; return; }
test -f facture_message_header.txt || { echo NO facture_message_header.txt ; return; }
test -f facture_message_body.txt || { echo NO facture_message_body.txt ; return; }
test -f email_address.txt || { echo NO email_address.txt ; return; }
email=${2:-`cat email_address.txt`}
> facture_message_to.txt
egrep '^To: ' facture_message_header.txt > /dev/null || echo "To: $email" > facture_message_to.txt
cat facture_message_header.txt facture_message_to.txt facture_message_body.txt > facture_message.txt
more facture_message.txt
echo '====== END of message ======'
test -f "SENT_TO_$email" && { echo "Already SENT_TO_$email"; }
test -f "SENT_TO_$email" || acroread facture_imapsync-${invoice}.pdf&
echo "Send this invoice ${invoice} to $email?"
read r < /dev/tty
echo SAID "[$r]"
test X"$r" = Xy && {
echo | mutt -H facture_message.txt -a facture_imapsync-${invoice}.pdf facture_imapsync-${invoice}.pdf.asc --
touch SENT_TO_$email
}
}
for d in "$@"; do
send_invoice "$d"
done

113
paypal_return.shtml Normal file
View File

@ -0,0 +1,113 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>imapsync download</title>
<meta name="generator" content="Bluefish 1.0.7"/>
<meta name="author" content="Gilles LAMIRAL"/>
<meta name="date" content="2011-03-24T02:20:46+0100"/>
<meta name="copyright" content=""/>
<meta name="keywords" content=""/>
<meta name="description" content=""/>
<meta name="ROBOTS" content="NOINDEX, NOFOLLOW"/>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<meta http-equiv="content-type" content="application/xhtml+xml; charset=UTF-8"/>
<meta http-equiv="content-style-type" content="text/css"/>
<meta http-equiv="expires" content="0"/>
<style type="text/css">
body {
color: black;
background-color: #ccdddd
}
div.center {
text-align: center;
}
img{
border:0px;
}
</style>
</head>
<body>
<h1>imapsync download</h1>
<p><b>I thank you for buying Imapsync!</b></p>
<p>The payment has been made and the transaction has been completed.<br/>
A receipt for your purchase has been emailed to you.<br/>
You may log into your account at <a href="http://www.paypal.com/">www.paypal.com</a>
to view details of this transaction.
</p>
<p>You will find the latest <b>imapsync source code</b> release 1.404 at the following link:<br/>
<a href="http://www.linux-france.org/depot/2011_02_21/OUMbo7/">http://www.linux-france.org/depot/2011_02_21/OUMbo7/</a>
</p>
<p>You will find the latest <b>imapsync.exe binary</b> release 1.404 at the following link:<br/>
<a href="http://www.linux-france.org/depot/2011_02_21/rHSVNs/">http://www.linux-france.org/depot/2011_02_21/rHSVNs/</a>
</p>
<p>You will receive an invoice soon.</p>
<p>Next imapsync releases will be available for one year without extra payment.<br/>
I will send you a message explaining how to get them</p>
<p>I thank you again for buying and using imapsync,
I wish you successful imap transfers!</p>
<p><a href="./">imapsync homepage</a></p>
<p><b>Gilles LAMIRAL</b><br/>
gilles.lamiral@laposte.net</p>
<hr/>
<p>
<a href="http://validator.w3.org/check?uri=referer"><img
src="http://www.w3.org/Icons/valid-xhtml10"
alt="Valid XHTML 1.0 Strict" height="31" width="88" /></a>
<a href="http://jigsaw.w3.org/css-validator/check/referer">
<img style="border:0;width:88px;height:31px"
src="http://jigsaw.w3.org/css-validator/images/vcss-blue"
alt="CSS Valide !" />
</a>
<br/>
<!--#config timefmt="%D" -->
<!--#config timefmt="%A %B %d, %Y" -->
<b>This document last modified on <!--#echo var="LAST_MODIFIED" --></b><br/>
($Id: paypal_return.shtml,v 1.2 2011/03/24 01:21:27 gilles Exp gilles $)
</p>
<!-- Google Code for Achat imapsync Conversion Page -->
<script type="text/javascript">
/* <![CDATA[ */
var google_conversion_id = 992916412;
var google_conversion_language = "en";
var google_conversion_format = "2";
var google_conversion_color = "ffffff";
var google_conversion_label = "hVVWCKzApQIQvOe62QM";
var google_conversion_value = 0;
if (30) {
google_conversion_value = 30;
}
/* ]]> */
</script>
<script type="text/javascript" src="http://www.googleadservices.com/pagead/conversion.js">
</script>
<noscript>
<div style="display:inline;">
<img height="1" width="1" style="border-style:none;" alt="" src="http://www.googleadservices.com/pagead/conversion/992916412/?value=30&amp;label=hVVWCKzApQIQvOe62QM&amp;guid=ON&amp;script=0"/>
</div>
</noscript>
</body>
</html>

109
paypal_return_support.shtml Normal file
View File

@ -0,0 +1,109 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>imapsync support</title>
<meta name="generator" content="Bluefish 1.0.7"/>
<meta name="author" content="Gilles LAMIRAL"/>
<meta name="date" content="2011-04-16T21:59:41+0200"/>
<meta name="copyright" content=""/>
<meta name="keywords" content=""/>
<meta name="description" content=""/>
<meta name="ROBOTS" content="NOINDEX, NOFOLLOW"/>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<meta http-equiv="content-type" content="application/xhtml+xml; charset=UTF-8"/>
<meta http-equiv="content-style-type" content="text/css"/>
<meta http-equiv="expires" content="0"/>
<style type="text/css">
body {
color: black;
background-color: #ccdddd
}
div.center {
text-align: center;
}
img{
border:0px;
}
</style>
</head>
<body>
<h1>imapsync support</h1>
<p><b>I thank you for buying Imapsync support!</b></p>
<p>The payment has been made and the transaction has been completed.<br/>
A receipt for your purchase has been emailed to you.<br/>
You may log into your account at <a href="http://www.paypal.com/">www.paypal.com</a>
to view details of this transaction.
</p>
<p>You will receive an invoice soon.</p>
<p>Now you can contact me (Gilles LAMIRAL) by email or phone</p>
<ul>
<li>Email address: <b>gilles.lamiral@laposte.net</b>.</li>
<li>Professionnal phone number: <b>+33 9 51 84 42 42</b> (in France) I can <b>call you back</b> for free in many countries.</li>
<li>Mobile phone number: <b>+33 620 79 76 06</b> (in France).</li>
</ul>
<p>I thank you again for buying imapsync support,
I wish you successful imap transfers and I will help you until you reach this goal!</p>
<p><a href="./">imapsync homepage</a></p>
<p><b>Gilles LAMIRAL</b><br/>
gilles.lamiral@laposte.net</p>
<hr/>
<p>
<a href="http://validator.w3.org/check?uri=referer"><img
src="http://www.w3.org/Icons/valid-xhtml10"
alt="Valid XHTML 1.0 Strict" height="31" width="88" /></a>
<a href="http://jigsaw.w3.org/css-validator/check/referer">
<img style="border:0;width:88px;height:31px"
src="http://jigsaw.w3.org/css-validator/images/vcss-blue"
alt="CSS Valide !" />
</a>
<br/>
<!--#config timefmt="%D" -->
<!--#config timefmt="%A %B %d, %Y" -->
<b>This document last modified on <!--#echo var="LAST_MODIFIED" --></b><br/>
($Id: paypal_return_support.shtml,v 1.2 2011/04/19 13:09:12 gilles Exp gilles $)
</p>
<!-- Google Code for Achat imapsync Conversion Page -->
<script type="text/javascript">
/* <![CDATA[ */
var google_conversion_id = 992916412;
var google_conversion_language = "en";
var google_conversion_format = "2";
var google_conversion_color = "ffffff";
var google_conversion_label = "hVVWCKzApQIQvOe62QM";
var google_conversion_value = 0;
if (30) {
google_conversion_value = 30;
}
/* ]]> */
</script>
<script type="text/javascript" src="http://www.googleadservices.com/pagead/conversion.js">
</script>
<noscript>
<div style="display:inline;">
<img height="1" width="1" style="border-style:none;" alt="" src="http://www.googleadservices.com/pagead/conversion/992916412/?value=30&amp;label=hVVWCKzApQIQvOe62QM&amp;guid=ON&amp;script=0"/>
</div>
</noscript>
</body>
</html>

View File

@ -3,5 +3,12 @@ REM $Id: test.bat,v 1.8 2011/01/15 06:30:33 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
perl ./imapsync --host1 p --user1 tata --passfile1 secret.tata --host2 p --user2 titi --passfile2 secret.titi --delete2 --expunge1 --expunge2 --folder INBOX --usecache
REM perl ./imapsync --host1 p --user1 tata --passfile1 secret.tata --host2 p --user2 titi --passfile2 secret.titi --delete2 --expunge1 --expunge2 --folder INBOX --usecache
REM imapsync --host1 p --user1 tata --passfile1 secret.tata --host2 p --user2 titi --passfile2 secret.titi --justfolders --nofoldersize --folder INBOX.yop.yap --sep1 / --regextrans2 "s,/,_,"
imapsync --host1 p --user1 tata --passfile1 secret.tata --host2 p --user2 titi --passfile2 secret.titi --nofoldersize --folder INBOX.yop.yap --regexflag 's/\\Answered//g' --debug > out.txt

160
tests.sh
View File

@ -1,6 +1,6 @@
#!/bin/sh
# $Id: tests.sh,v 1.149 2011/02/21 02:13:52 gilles Exp gilles $
# $Id: tests.sh,v 1.159 2011/04/20 01:18:40 gilles Exp gilles $
# Example 1:
# CMD_PERL='perl -I./Mail-IMAPClient-3.25/lib' sh -x tests.sh
@ -24,7 +24,7 @@ CMD_PERL=${CMD_PERL:-'perl -I./Mail-IMAPClient-2.2.9'}
# few debugging tests use:
CMD_PERL_2xx='perl -I./Mail-IMAPClient-2.2.9'
CMD_PERL_3xx='perl -I./Mail-IMAPClient-3.27/lib'
CMD_PERL_3xx='perl -I./Mail-IMAPClient-3.28/lib'
#### Shell pragmas
@ -922,7 +922,7 @@ ll_regex_flag()
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--folder INBOX.yop.yap \
--debug --regexflag 's/\\Answered/\\Seen/g'
--regexflag 's/\\Answered/\$Forwarded/g'
echo 'rm -f /home/vmail/titi/.yop.yap/cur/*'
}
@ -994,9 +994,9 @@ ll_tls_justlogin() {
ll_tls_devel() {
CMD_PERL='perl -I./Mail-IMAPClient-2.2.9' ll_justlogin ll_ssl_justlogin \
&& CMD_PERL='perl -I./Mail-IMAPClient-3.27/lib' ll_justlogin ll_ssl_justlogin \
&& CMD_PERL='perl -I./Mail-IMAPClient-3.28/lib' ll_justlogin ll_ssl_justlogin \
&& CMD_PERL='perl -I./Mail-IMAPClient-2.2.9' ll_tls_justconnect ll_tls_justlogin \
&& CMD_PERL='perl -I./Mail-IMAPClient-3.27/lib' ll_tls_justconnect ll_tls_justlogin
&& CMD_PERL='perl -I./Mail-IMAPClient-3.28/lib' ll_tls_justconnect ll_tls_justlogin
}
ll_tls() {
@ -1099,6 +1099,17 @@ ll_authuser() {
--authuser2 titi
}
ll_authuser_2() {
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 anything \
--passfile2 ../../var/pass/secret.titi \
--justfoldersizes \
--authuser2 titi --folder INBOX.lalala
}
ll_authmech_LOGIN() {
@ -1214,6 +1225,65 @@ xxxxx_gmail() {
--justfolders --dry --prefix2 '[Gmail]/'
}
xxxxx_gmail_2() {
! ping -c1 imap.gmail.com || $CMD_PERL ./imapsync \
--host1 $HOST2 \
--user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 imap.gmail.com \
--ssl2 \
--user2 gilles.lamiral@gmail.com \
--passfile2 ../../var/pass/secret.gilles_gmail \
--nofoldersizes \
--regextrans2 's,(.*),SMS,'
#--dry --prefix2 '[Gmail]/'
}
xxxxx_gmail_3() {
! ping -c1 imap.gmail.com || $CMD_PERL ./imapsync \
--host1 $HOST2 \
--user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 imap.gmail.com \
--ssl2 \
--user2 gilles.lamiral@gmail.com \
--passfile2 ../../var/pass/secret.gilles_gmail \
--nofoldersizes \
--folder INBOX.few_emails --justfolders --debug \
--regextrans2 's,few_emails,Gmail/Messages envoyes,'
}
xxxxx_gmail_4() {
! ping -c1 imap.gmail.com || $CMD_PERL ./imapsync \
--host1 $HOST2 \
--user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 imap.gmail.com \
--ssl2 \
--user2 gilles.lamiral@gmail.com \
--passfile2 ../../var/pass/secret.gilles_gmail \
--nofoldersizes \
--folder INBOX.Sent \
--regextrans2 's{Sent}{Gmail/Messages envoyes}'
}
xxxxx_gmail_5_justlogin() {
! ping -c1 imap.gmail.com || $CMD_PERL ./imapsync \
--host1 $HOST2 \
--user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 imap.gmail.com \
--ssl2 \
--user2 gilles.lamiral@gmail.com \
--passfile2 ../../var/pass/secret.gilles_gmail \
--justlogin
}
gmail_xxxxx() {
! ping -c1 imap.gmail.com || $CMD_PERL ./imapsync \
@ -1292,7 +1362,7 @@ allow3xx() {
}
noallow3xx() {
! perl -I./Mail-IMAPClient-3.27/lib ./imapsync \
! perl -I./Mail-IMAPClient-3.28/lib ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
@ -1480,6 +1550,59 @@ ll_useuid_nousecache()
# specific tests
##########################
godaddy_1_justlogin() {
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 imap.secureserver.net --user2 migrationtest@overnightmac.com \
--passfile2 ../../var/pass/secret.overnightmac --tls2 \
--folder INBOX.oneemail --folder INBOX.few_emails
}
mailenable_1() {
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 email.avonvalley.wilts.sch.uk --user2 "GLamiral" \
--passfile2 ../../var/pass/secret.avonvalley \
--sep2 / --prefix2 '' --useuid \
--folder INBOX.Junk --folder INBOX.few_emails \
--delete2 --expunge2
}
mailenable_2_justfolders() {
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 email.avonvalley.wilts.sch.uk --user2 "GLamiral" \
--passfile2 ../../var/pass/secret.avonvalley \
--sep2 / --prefix2 '' --useuid \
--justfolders --exclude "Gmail" --exclude ' '
}
mailenable_3_reverse() {
$CMD_PERL ./imapsync \
--host2 $HOST1 --user2 tata \
--passfile2 ../../var/pass/secret.tata \
--host1 email.avonvalley.wilts.sch.uk --user1 "GLamiral" \
--passfile1 ../../var/pass/secret.avonvalley \
--sep1 / --prefix1 '' \
--folder few_emails \
--delete2 --expunge2 --debug --useuid
}
bug_zero_byte() {
$CMD_PERL ./imapsync \
--host1 buzon.us.es --user1 rafaeltovar \
--passfile1 ../../var/pass/secret.rafaeltovar \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--folder INBOX --regextrans2 s/INBOX/INBOX.rafaeltovar/
}
exchange_1() {
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
@ -1489,11 +1612,32 @@ exchange_1() {
--folder INBOX.oneemail --folder INBOX.few_emails --folder INBOX -maxage 1
}
exchange_2() {
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 mail.ethz.ch --ssl2 --user2 glamiral \
--passfile2 ../../var/pass/secret.ethz.ch \
--folder INBOX.Junk --useuid
}
exchange_3_delete2() {
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 mail.ethz.ch --ssl2 --user2 glamiral \
--passfile2 ../../var/pass/secret.ethz.ch \
--folder INBOX.Junk --useuid --delete2
}
jong_1() {
$CMD_PERL ./imapsync \
--host1 mail.y-publicaties.nl --user1 gillesl --passfile1 ../../var/pass/secret.jong \
--host2 $HOST2 --user2 titi --passfile2 ../../var/pass/secret.titi --sep1 / --prefix1 '' \
--delete2 --expunge2 --folder INBOX --nofoldersizes
--delete2 --expunge2 --expunge1 --expunge \
--foldersizes --folder Junk/2009 --useuid
# --debugimap1 --dry
}
@ -1502,7 +1646,7 @@ $CMD_PERL ./imapsync \
--host2 mail.y-publicaties.nl --user2 gillesl --passfile2 ../../var/pass/secret.jong \
--host1 $HOST2 --user1 gilles@est.belle --passfile1 ../../var/pass/secret.gilles_mbox \
--sep2 / --prefix2 '' \
--folder INBOX.Junk.2009 --delete2 --expunge2 --debug > zzz 2>&1
--folder INBOX.Junk.2009 --delete2 --expunge2 --expunge1 --expunge --useuid
#--nofoldersizes
# --debugimap1 --dry
}