This commit is contained in:
Nick Bebout 2013-07-05 17:26:28 -05:00
parent e7c65ee6de
commit 6ff9b67554
67 changed files with 747 additions and 354 deletions

View file

@ -1,5 +1,5 @@
#!/bin/cat #!/bin/cat
# $Id: CREDITS,v 1.173 2013/05/06 08:16:53 gilles Exp gilles $ # $Id: CREDITS,v 1.174 2013/06/07 10:05:12 gilles Exp gilles $
If you want to make a donation to the author, Gilles LAMIRAL, If you want to make a donation to the author, Gilles LAMIRAL,
use any of the following ways: use any of the following ways:
@ -30,6 +30,9 @@ I thank very much all of these people.
I thank also very much all people who bought imapsync from the homepage I thank also very much all people who bought imapsync from the homepage
but I don't cite them here. but I don't cite them here.
Jim Klimov
Gave patch to handle proxyauth failures.
Eduardo Bortoluzzi Junior Eduardo Bortoluzzi Junior
Write the XOAUTH code and FAQ item. Write the XOAUTH code and FAQ item.

View file

@ -1,17 +1,44 @@
RCS file: RCS/imapsync,v RCS file: RCS/imapsync,v
Working file: imapsync Working file: imapsync
head: 1.542 head: 1.547
branch: branch:
locks: strict locks: strict
gilles: 1.542 gilles: 1.547
access list: access list:
symbolic names: symbolic names:
keyword substitution: kv keyword substitution: kv
total revisions: 542; selected revisions: 542 total revisions: 547; selected revisions: 547
description: description:
---------------------------- ----------------------------
revision 1.542 locked by: gilles; revision 1.547 locked by: gilles;
date: 2013/07/03 01:24:34; author: gilles; state: Exp; lines: +11 -8
DBOX 2.41 success.
Kerio 8 success.
----------------------------
revision 1.546
date: 2013/07/02 03:49:32; author: gilles; state: Exp; lines: +14 -8
Fixed IO::Socket::IP bug on Win32?
Removed SSL::DEBUG
Added "copying.." in dry mode.
----------------------------
revision 1.545
date: 2013/06/06 20:43:56; author: gilles; state: Exp; lines: +27 -125
Rmoved sub starttls()
Removed sub myconnect()
Removed sub RawSocket2()
Applied patch from Jim Klimov to handle proxyauth failures
----------------------------
revision 1.544
date: 2013/06/02 23:36:16; author: gilles; state: Exp; lines: +25 -24
Remove myconnect() use. Replaced by $imap->connect()
Removed sub Split add in Mail::IMAPClient
----------------------------
revision 1.543
date: 2013/05/22 01:22:03; author: gilles; state: Exp; lines: +12 -7
SSL_verify_mode 0 to avoid warning about Man-In-The-Middle.
----------------------------
revision 1.542
date: 2013/05/06 08:30:35; author: gilles; state: Exp; lines: +7 -7 date: 2013/05/06 08:30:35; author: gilles; state: Exp; lines: +7 -7
Syntax with "" fix. Syntax with "" fix.
---------------------------- ----------------------------

15
FAQ
View file

@ -1,5 +1,5 @@
#!/bin/cat #!/bin/cat
# $Id: FAQ,v 1.133 2013/05/06 08:17:13 gilles Exp gilles $ # $Id: FAQ,v 1.134 2013/06/02 23:34:02 gilles Exp gilles $
+------------------+ +------------------+
| FAQ for imapsync | | FAQ for imapsync |
@ -301,7 +301,7 @@ Q. How can I try imapsync with Mail::IMAPClient 3.xx perl module?
R. The answer R2 deals with any Perl module use. R. The answer R2 deals with any Perl module use.
R1 - Look at the script named i3 in the tarball, it can be used to R1 - Look at the script named i3 in the tarball, it can be used to
run imapsync with included Mail-IMAPClient-3.32/ wherever you run imapsync with included Mail-IMAPClient-3.33/ wherever you
unpacked the imapsync tarball unpacked the imapsync tarball
R2 - Download latest Mail::IMAPClient 3.xx at R2 - Download latest Mail::IMAPClient 3.xx at
@ -314,10 +314,10 @@ R2 - Download latest Mail::IMAPClient 3.xx at
- run imapsync with perl and -I option tailing to use the perl - run imapsync with perl and -I option tailing to use the perl
module Mail-IMAPClient-3.xx. Example: module Mail-IMAPClient-3.xx. Example:
perl -I./Mail-IMAPClient-3.32/lib ./imapsync ... perl -I./Mail-IMAPClient-3.33/lib ./imapsync ...
or if imapsync is in directory /path/ or if imapsync is in directory /path/
perl -I./Mail-IMAPClient-3.32/lib /path/imapsync ... perl -I./Mail-IMAPClient-3.33/lib /path/imapsync ...
======================================================================= =======================================================================
@ -1208,7 +1208,12 @@ Examples:
--regextrans2 's/^INBOX\.(.+)/$1/' --regextrans2 's/^INBOX\.(.+)/$1/'
2) To sync a complete account in a subfolder called FOO: 2a) To sync all folders to INBOX:
imapsync ... --regextrans2 "s/.*/INBOX/"
2b) To sync a complete account in a subfolder called FOO:
a) Seperator is dot character "." and "INBOX" prefixes every folder a) Seperator is dot character "." and "INBOX" prefixes every folder

View file

@ -1,4 +1,4 @@
# $Id: INSTALL,v 1.28 2013/05/14 08:19:08 gilles Exp gilles $ # $Id: INSTALL,v 1.30 2013/07/03 04:13:52 gilles Exp gilles $
# #
# INSTALL file for imapsync # INSTALL file for imapsync
# imapsync : IMAP sync or copy tool. # imapsync : IMAP sync or copy tool.
@ -55,7 +55,7 @@ b) Hard way:
c) How to build imapsync.exe? c) How to build imapsync.exe?
- Do the hard stuff in b) - Do the hard stuff in b)
- Run W/build_exe.bat (found in the tarball) - Run build_exe.bat (found in the tarball)
PREREQUISITES PREREQUISITES
------------- -------------
@ -94,10 +94,10 @@ Here is some individual module help:
New Mail-IMAPClient-3.xx works very well with imapsync, New Mail-IMAPClient-3.xx works very well with imapsync,
Use at least Mail-IMAPClient-3.25 (previous may bug). Use at least Mail-IMAPClient-3.25 (previous may bug).
Don't hesitate to use latest Mail-IMAPClient-3.xx Don't hesitate to use latest Mail-IMAPClient-3.xx
(3.xx >= 3.32 at the time of this writing) (3.xx >= 3.33 at the time of this writing)
Look at the script named "i3" in the tarball, it can be used to Look at the script named "i3" in the tarball, it can be used to
run imapsync with included Mail-IMAPClient-3.32/ wherever you run imapsync with included Mail-IMAPClient-3.33/ wherever you
unpacked the imapsync tarball. unpacked the imapsync tarball.

View file

@ -1,5 +1,5 @@
# $Id: Makefile,v 1.118 2013/05/14 05:59:55 gilles Exp gilles $ # $Id: Makefile,v 1.121 2013/06/02 23:34:14 gilles Exp gilles $
.PHONY: help usage all .PHONY: help usage all
@ -11,9 +11,10 @@ usage:
@echo "make testf # run tests" @echo "make testf # run tests"
@echo "make testv # run tests verbosely" @echo "make testv # run tests verbosely"
@echo "make test_quick # few tests verbosely" @echo "make test_quick # few tests verbosely"
@echo "make tests_win32 # run tests on win32" @echo "make tests_win32 # run --test and W/test.bat on win32"
@echo "make tests_win32_dev # run test2.bat on win32" @echo "make tests_win32_dev # run W/test2.bat on win32"
@echo "make prereq_win32 # run W/install_modules.bat on win32" @echo "make tests_win32_dev3 # run W/test3.bat on win32"
@echo "make prereq_win32 # run examples/install_modules.bat on win32"
@echo "make all " @echo "make all "
@echo "make upload_index" @echo "make upload_index"
@echo "make upload_ks" @echo "make upload_ks"
@ -31,7 +32,7 @@ VERSION=$(shell perl -I$(IMAPClient) ./imapsync --version)
VERSION_EXE=$(shell cat ./VERSION_EXE) VERSION_EXE=$(shell cat ./VERSION_EXE)
HELLO=$(shell date;uname -a) HELLO=$(shell date;uname -a)
IMAPClient_3xx=./W/Mail-IMAPClient-3.32/lib IMAPClient_3xx=./W/Mail-IMAPClient-3.33/lib
IMAPClient=$(IMAPClient_3xx) IMAPClient=$(IMAPClient_3xx)
hello: hello:
@ -143,19 +144,25 @@ tests_win32_dev: dosify_bat
scp imapsync examples/file.txt W/test2.bat Admin@c:'C:/msys/1.0/home/Admin/imapsync/' scp imapsync examples/file.txt W/test2.bat Admin@c:'C:/msys/1.0/home/Admin/imapsync/'
ssh Admin@c 'C:/msys/1.0/home/Admin/imapsync/test2.bat' ssh Admin@c 'C:/msys/1.0/home/Admin/imapsync/test2.bat'
tests_win32_dev3: dosify_bat
scp imapsync W/test3.bat Admin@c:'C:/msys/1.0/home/Admin/imapsync/'
ssh Admin@c 'C:/msys/1.0/home/Admin/imapsync/test3.bat'
test_imapsync_exe: dosify_bat test_imapsync_exe: dosify_bat
scp W/test_exe.bat Admin@c:'C:/msys/1.0/home/Admin/imapsync/' scp W/test_exe.bat Admin@c:'C:/msys/1.0/home/Admin/imapsync/'
time ssh Admin@c 'C:/msys/1.0/home/Admin/imapsync/test_exe.bat' time ssh Admin@c 'C:/msys/1.0/home/Admin/imapsync/test_exe.bat'
prereq_win32: imapsync examples/install_modules.bat .dosify_bat prereq_win32: examples/install_modules.bat .dosify_bat
scp examples/install_modules.bat Admin@c:'C:/msys/1.0/home/Admin/imapsync/' scp examples/install_modules.bat Admin@c:'C:/msys/1.0/home/Admin/imapsync/'
time ssh Admin@c 'C:/msys/1.0/home/Admin/imapsync/install_modules.bat' ssh Admin@c 'C:/msys/1.0/home/Admin/imapsync/install_modules.bat'
imapsync.exe: imapsync W/build_exe.bat .dosify_bat imapsync.exe: imapsync prereq_win32 build_exe.bat .dosify_bat
rcsdiff imapsync rcsdiff imapsync
ssh Admin@c 'perl -V' ssh Admin@c 'perl -V'
(date "+%s"| tr "\n" " "; echo -n "BEGIN " $(VERSION) ": "; date) >> W/.BUILD_EXE_TIME (date "+%s"| tr "\n" " "; echo -n "BEGIN " $(VERSION) ": "; date) >> W/.BUILD_EXE_TIME
scp imapsync W/build_exe.bat W/test_exe.bat \ scp imapsync build_exe.bat W/test_exe.bat \
Admin@c:'C:/msys/1.0/home/Admin/imapsync/' Admin@c:'C:/msys/1.0/home/Admin/imapsync/'
ssh Admin@c 'C:/msys/1.0/home/Admin/imapsync/build_exe.bat' ssh Admin@c 'C:/msys/1.0/home/Admin/imapsync/build_exe.bat'
ssh Admin@c 'C:/msys/1.0/home/Admin/imapsync/test_exe.bat' ssh Admin@c 'C:/msys/1.0/home/Admin/imapsync/test_exe.bat'
@ -164,6 +171,18 @@ imapsync.exe: imapsync W/build_exe.bat .dosify_bat
dos2unix ./VERSION_EXE dos2unix ./VERSION_EXE
(date "+%s"| tr "\n" " "; echo -n "END " $(VERSION) ": "; date) >> W/.BUILD_EXE_TIME (date "+%s"| tr "\n" " "; echo -n "END " $(VERSION) ": "; date) >> W/.BUILD_EXE_TIME
exe: imapsync build_exe.bat .dosify_bat
(date "+%s"| tr "\n" " "; echo -n "BEGIN " $(VERSION) ": "; date) >> W/.BUILD_EXE_TIME
scp imapsync build_exe.bat Admin@c:'C:/msys/1.0/home/Admin/imapsync/'
ssh Admin@c 'C:/msys/1.0/home/Admin/imapsync/build_exe.bat'
ssh Admin@c 'C:/msys/1.0/home/Admin/imapsync/imapsync.exe --modules_version'
scp Admin@c:'C:/msys/1.0/home/Admin/imapsync/imapsync.exe' .
(date "+%s"| tr "\n" " "; echo -n "END " $(VERSION) ": "; date) >> W/.BUILD_EXE_TIME
# C:\Users\mansour\Desktop\imapsync
# vadrouille or petite # vadrouille or petite
imapsync_elf_x86.bin: imapsync imapsync_elf_x86.bin: imapsync

9
README
View file

@ -4,7 +4,7 @@ NAME
More than 52 different IMAP server softwares supported with success, few More than 52 different IMAP server softwares supported with success, few
failures. failures.
$Revision: 1.542 $ $Revision: 1.547 $
SYNOPSIS SYNOPSIS
To synchronize imap account "foo" on "imap.truc.org" to imap account To synchronize imap account "foo" on "imap.truc.org" to imap account
@ -317,7 +317,7 @@ IMAP SERVERS
- Hotmail since hotmail.com does not provide IMAP access - Hotmail since hotmail.com does not provide IMAP access
- Outlook.com since outlook.com does not provide IMAP access - Outlook.com since outlook.com does not provide IMAP access
Success stories reported with the following 52 imap servers (software Success stories reported with the following 53 imap servers (software
names are in alphabetic order): names are in alphabetic order):
- 1und1 H mimap1 84498 [host1] H mibap4 95231 [host1] - 1und1 H mimap1 84498 [host1] H mibap4 95231 [host1]
@ -340,6 +340,7 @@ IMAP SERVERS
- Deerfield VisNetic MailServer 5.8.6 [host1] (http://www.deerfield.net/products/visnetic-mailserver/) - Deerfield VisNetic MailServer 5.8.6 [host1] (http://www.deerfield.net/products/visnetic-mailserver/)
- DBMail 1.2.1, 2.0.4, 2.0.9, 2.2rc1 (GPL) (http://www.dbmail.org/). - DBMail 1.2.1, 2.0.4, 2.0.9, 2.2rc1 (GPL) (http://www.dbmail.org/).
2.0.7 seems buggy. 2.0.7 seems buggy.
- DBOX 2.41 System [host1] (http://www.dbox.handshake.de/).
- Deerfield VisNetic MailServer 5.8.6 [host1] - Deerfield VisNetic MailServer 5.8.6 [host1]
- dkimap4 [host1] - dkimap4 [host1]
- Domino (Notes) 4.61[host1], 6.5[host1], 5.0.6, 5.0.7, 7.0.2, 6.0.2CF1, - Domino (Notes) 4.61[host1], 6.5[host1], 5.0.6, 5.0.7, 7.0.2, 6.0.2CF1,
@ -353,7 +354,7 @@ IMAP SERVERS
- hMailServer 5.3.3 [host2], 4.4.1 [host1] (see FAQ) - hMailServer 5.3.3 [host2], 4.4.1 [host1] (see FAQ)
- iPlanet Messaging server 4.15, 5.1, 5.2 - iPlanet Messaging server 4.15, 5.1, 5.2
- IMail 7.15 (Ipswitch/Win2003), 8.12, 11.03 [host1] - IMail 7.15 (Ipswitch/Win2003), 8.12, 11.03 [host1]
- Kerio 7.2.0 Patch 1 [host1] [host2] - Kerio 7.2.0 Patch 1 [host12], Kerio 8 [host1]
- Mail2World IMAP4 Server 2.5 [host1] (http://www.mail2world.com/) - Mail2World IMAP4 Server 2.5 [host1] (http://www.mail2world.com/)
- MailEnable 4.23 [host1] [host2], 4.26 [host1][host2], 5 [host1] - MailEnable 4.23 [host1] [host2], 4.26 [host1][host2], 5 [host1]
- MDaemon 7.0.1, 8.0.2, 8.1, 9.5.4 (Windows server 2003 R2 platform), - MDaemon 7.0.1, 8.0.2, 8.1, 9.5.4 (Windows server 2003 R2 platform),
@ -463,5 +464,5 @@ SIMILAR SOFTWARES
Feedback (good or bad) will often be welcome. Feedback (good or bad) will often be welcome.
$Id: imapsync,v 1.542 2013/05/06 08:30:35 gilles Exp gilles $ $Id: imapsync,v 1.547 2013/07/03 01:24:34 gilles Exp gilles $

View file

@ -1 +1 @@
1.542 1.547

View file

@ -1 +1 @@
1.542 1.547

View file

@ -188,3 +188,38 @@
1366592337 END 1.538 : lundi 22 avril 2013, 02:58:57 (UTC+0200) 1366592337 END 1.538 : lundi 22 avril 2013, 02:58:57 (UTC+0200)
1367829058 BEGIN 1.542 : lundi 6 mai 2013, 10:30:58 (UTC+0200) 1367829058 BEGIN 1.542 : lundi 6 mai 2013, 10:30:58 (UTC+0200)
1367829799 END 1.542 : lundi 6 mai 2013, 10:43:19 (UTC+0200) 1367829799 END 1.542 : lundi 6 mai 2013, 10:43:19 (UTC+0200)
1369002420 BEGIN 1.542 : lundi 20 mai 2013, 00:27:00 (UTC+0200)
1369002592 BEGIN 1.542 : lundi 20 mai 2013, 00:29:52 (UTC+0200)
1369003347 END 1.542 : lundi 20 mai 2013, 00:42:27 (UTC+0200)
1369004592 BEGIN 1.542 : lundi 20 mai 2013, 01:03:12 (UTC+0200)
1369005205 BEGIN 1.542 : lundi 20 mai 2013, 01:13:25 (UTC+0200)
1369007256 BEGIN 1.542 : lundi 20 mai 2013, 01:47:36 (UTC+0200)
1369007618 END 1.542 : lundi 20 mai 2013, 01:53:38 (UTC+0200)
1369008471 BEGIN 1.542 : lundi 20 mai 2013, 02:07:51 (UTC+0200)
1369008871 END 1.542 : lundi 20 mai 2013, 02:14:31 (UTC+0200)
1369009301 BEGIN 1.542 : lundi 20 mai 2013, 02:21:41 (UTC+0200)
1369009684 END 1.542 : lundi 20 mai 2013, 02:28:04 (UTC+0200)
1369066181 BEGIN 1.542 : lundi 20 mai 2013, 18:09:41 (UTC+0200)
1369066684 END 1.542 : lundi 20 mai 2013, 18:18:04 (UTC+0200)
1369091275 BEGIN 1.542 : mardi 21 mai 2013, 01:07:55 (UTC+0200)
1369091715 END 1.542 : mardi 21 mai 2013, 01:15:15 (UTC+0200)
1369093368 BEGIN 1.542 : mardi 21 mai 2013, 01:42:48 (UTC+0200)
1369093884 END 1.542 : mardi 21 mai 2013, 01:51:24 (UTC+0200)
1369185777 BEGIN 1.543 : mercredi 22 mai 2013, 03:22:57 (UTC+0200)
1369186219 END 1.543 : mercredi 22 mai 2013, 03:30:19 (UTC+0200)
1369217503 BEGIN 1.543 : mercredi 22 mai 2013, 12:11:43 (UTC+0200)
1369218286 END 1.543 : mercredi 22 mai 2013, 12:24:46 (UTC+0200)
1369236897 BEGIN 1.543 : mercredi 22 mai 2013, 17:34:57 (UTC+0200)
1369237336 END 1.543 : mercredi 22 mai 2013, 17:42:16 (UTC+0200)
1369237945 BEGIN 1.543 : mercredi 22 mai 2013, 17:52:25 (UTC+0200)
1369238373 END 1.543 : mercredi 22 mai 2013, 17:59:33 (UTC+0200)
1370216259 BEGIN 1.544 : lundi 3 juin 2013, 01:37:39 (UTC+0200)
1370216695 END 1.544 : lundi 3 juin 2013, 01:44:55 (UTC+0200)
1372753674 BEGIN 1.546 : mardi 2 juillet 2013, 10:27:54 (UTC+0200)
1372754442 END 1.546 : mardi 2 juillet 2013, 10:40:42 (UTC+0200)
1372815752 BEGIN 1.547 : mercredi 3 juillet 2013, 03:42:32 (UTC+0200)
1372816528 END 1.547 : mercredi 3 juillet 2013, 03:55:28 (UTC+0200)
1372851174 BEGIN 1.547 : mercredi 3 juillet 2013, 13:32:54 (UTC+0200)
1372851958 END 1.547 : mercredi 3 juillet 2013, 13:45:58 (UTC+0200)
1372852860 BEGIN 1.547 : mercredi 3 juillet 2013, 14:01:00 (UTC+0200)
1372853599 END 1.547 : mercredi 3 juillet 2013, 14:13:19 (UTC+0200)

View file

@ -5,6 +5,18 @@ Changes from 2.99_01 to 3.16 made by Mark Overmeer
Changes from 0.09 to 2.99_01 made by David Kernen Changes from 0.09 to 2.99_01 made by David Kernen
- Potential compatibility issues from 3.17+ highlighted with '*' - Potential compatibility issues from 3.17+ highlighted with '*'
version 3.33: Tue, May 14, 2013 10:12:43 AM
- more cleanup on use of $@ and $!
- cleanup get_bodystructure / get_envelope
- allow Ssl arg as an arrayref to pass args to IO::Socket::SSL
[Ramana V Mokkapati]
- no need to Massage() the folder name in uidnext()
- rt.cpan.org#84028: get_envelope() fails when subject ends w/backslash
[Andy Lyttle]
- rt.cpan.org#79476: move()/copy() with sequence causes numeric warning
[Oleg G]
- *move()/copy() no longer sort message(s) provided by caller
version 3.32: Fri, Aug 10, 2012 4:43:24 PM version 3.32: Fri, Aug 10, 2012 4:43:24 PM
- document RFC2087 quota related calls - document RFC2087 quota related calls
[Mathias Reitinger] documentation request [Mathias Reitinger] documentation request

View file

@ -1,10 +1,10 @@
--- #YAML:1.0 --- #YAML:1.0
name: Mail-IMAPClient name: Mail-IMAPClient
version: 3.32 version: 3.33
abstract: IMAP4 client library abstract: IMAP4 client library
author: author:
- Phil Pearl (Lobbes) <phil@zimbra.com> - Phil Pearl (Lobbes) <phil@zimbra.com>
license: unknown license: perl
distribution_type: module distribution_type: module
configure_requires: configure_requires:
ExtUtils::MakeMaker: 0 ExtUtils::MakeMaker: 0
@ -24,6 +24,15 @@ requires:
Parse::RecDescent: 1.94 Parse::RecDescent: 1.94
perl: 5.008 perl: 5.008
Test::More: 0 Test::More: 0
resources:
bugtracker:
mailto: bug-Mail-IMAPClient@rt.cpan.org
web: http://rt.cpan.org/Public/Dist/Display.html?Name=Mail-IMAPClient
homepage: http://sourceforge.net/projects/mail-imapclient/
repository:
type: git
url: git://git.code.sf.net/p/mail-imapclient/git
web: http://sourceforge.net/p/mail-imapclient/git/
no_index: no_index:
directory: directory:
- t - t

View file

@ -47,8 +47,10 @@ do {
my $broke = version->parse("1.966002"); my $broke = version->parse("1.966002");
my $fixed = version->parse("1.967009"); my $fixed = version->parse("1.967009");
if ( $found < $fixed and $found >= $broke ) { if ( $found < $fixed and $found >= $broke ) {
die("Found broken Parse::RecDescent $found in your environment.\n", die(
"Please upgrade to version $fixed or greater.\n"); "Found broken Parse::RecDescent $found in your environment.\n",
"Please upgrade to version $fixed or greater.\n"
);
} }
} }
}; };
@ -58,6 +60,22 @@ WriteMakefile(
AUTHOR => 'Phil Pearl (Lobbes) <phil@zimbra.com>', AUTHOR => 'Phil Pearl (Lobbes) <phil@zimbra.com>',
ABSTRACT => 'IMAP4 client library', ABSTRACT => 'IMAP4 client library',
VERSION_FROM => 'lib/Mail/IMAPClient.pm', VERSION_FROM => 'lib/Mail/IMAPClient.pm',
LICENSE => 'perl',
META_MERGE => {
resources => {
bugtracker => {
web =>
'http://rt.cpan.org/Public/Dist/Display.html?Name=Mail-IMAPClient',
mailto => 'bug-Mail-IMAPClient@rt.cpan.org',
},
homepage => 'http://sourceforge.net/projects/mail-imapclient/',
repository => {
url => 'git://git.code.sf.net/p/mail-imapclient/git',
web => 'http://sourceforge.net/p/mail-imapclient/git/',
type => 'git',
},
},
},
MIN_PERL_VERSION => '5.008', MIN_PERL_VERSION => '5.008',
PREREQ_PM => { PREREQ_PM => {
'Carp' => 0, 'Carp' => 0,

View file

@ -58,13 +58,13 @@ Project Links
- CPAN releases: - CPAN releases:
http://search.cpan.org/dist/Mail-IMAPClient/ http://search.cpan.org/dist/Mail-IMAPClient/
- Project website - Project website
http://mail-imapclient.sf.net/ http://sourceforge.net/projects/mail-imapclient/
COPYRIGHT AND LICENSE COPYRIGHT AND LICENSE
===================== =====================
Copyright (C) 1999-2003 The Kernen Group, Inc. Copyright (C) 1999-2003 The Kernen Group, Inc.
Copyright (C) 2007-2009 Mark Overmeer Copyright (C) 2007-2009 Mark Overmeer
Copyright (C) 2010-2012 Phil Pearl (Lobbes) Copyright (C) 2010-2013 Phil Pearl (Lobbes)
All rights reserved. All rights reserved.
This library is free software; you can redistribute it and/or modify This library is free software; you can redistribute it and/or modify

View file

@ -7,7 +7,7 @@ use strict;
use warnings; use warnings;
package Mail::IMAPClient; package Mail::IMAPClient;
our $VERSION = '3.32'; our $VERSION = '3.33';
use Mail::IMAPClient::MessageSet; use Mail::IMAPClient::MessageSet;
@ -59,9 +59,13 @@ sub _load_module {
my $modkey = shift; my $modkey = shift;
my $module = $Load_Module{$modkey} || $modkey; my $module = $Load_Module{$modkey} || $modkey;
my $err = do {
local ($@);
eval "require $module"; eval "require $module";
if ($@) { $@;
$self->LastError("Unable to load '$module': $@"); };
if ($err) {
$self->LastError("Unable to load '$module': $err");
return undef; return undef;
} }
return $module; return $module;
@ -118,6 +122,8 @@ sub LastError {
Carp::cluck($emsg); Carp::cluck($emsg);
} }
} }
# 2.x API support requires setting $@
$@ = $self->{LastError} = $err; $@ = $self->{LastError} = $err;
} }
@ -129,7 +135,7 @@ sub Fast_io(;$) {
my $socket = $self->{Socket} my $socket = $self->{Socket}
or return undef; or return undef;
local ($@); # avoid stomping on global $@ local ( $@, $! ); # avoid stomping on globals
unless ($use) { unless ($use) {
eval { fcntl( $socket, F_SETFL, delete $self->{_fcntl} ) } eval { fcntl( $socket, F_SETFL, delete $self->{_fcntl} ) }
if exists $self->{_fcntl}; if exists $self->{_fcntl};
@ -331,7 +337,17 @@ sub connect(@) {
} }
else { else {
my $ioclass = "IO::Socket::INET"; my $ioclass = "IO::Socket::INET";
$ioclass = $self->_load_module("SSL") if ( $self->Ssl ); my @args;
if ( $self->Ssl ) {
$ioclass = $self->_load_module("SSL");
# give caller control of args to new if desired
@args =
( ref( $self->Ssl ) eq "ARRAY" )
? ( @{ $self->Ssl } )
: ();
}
if ($ioclass) { if ($ioclass) {
$self->_debug("Connecting via $ioclass to $server:$port @timeout"); $self->_debug("Connecting via $ioclass to $server:$port @timeout");
@ -340,7 +356,8 @@ sub connect(@) {
PeerPort => $port, PeerPort => $port,
Proto => 'tcp', Proto => 'tcp',
Debug => $self->Debug, Debug => $self->Debug,
@timeout @timeout,
@args
); );
} }
} }
@ -350,7 +367,8 @@ sub connect(@) {
return $self->Socket($sock); return $self->Socket($sock);
} }
else { else {
$self->LastError("Unable to connect to $server: $@"); my $lasterr = $self->LastError || "";
$self->LastError("Unable to connect to $server: $lasterr");
return undef; return undef;
} }
} }
@ -889,6 +907,7 @@ sub message_to_file {
} }
else { else {
$$file = "" if ( ref $file eq "SCALAR" and !defined $$file ); $$file = "" if ( ref $file eq "SCALAR" and !defined $$file );
local ($!);
open( $fh, ">>", $file ); open( $fh, ">>", $file );
unless ( defined($fh) ) { unless ( defined($fh) ) {
$self->LastError("Unable to open file '$file': $!"); $self->LastError("Unable to open file '$file': $!");
@ -1883,7 +1902,7 @@ sub _disconnect {
delete $self->{_IMAP4REV1}; delete $self->{_IMAP4REV1};
$self->State(Unconnected); $self->State(Unconnected);
if ( my $sock = delete $self->{Socket} ) { if ( my $sock = delete $self->{Socket} ) {
local ($@); # avoid stomping on global $@ local ($@);
eval { $sock->close }; eval { $sock->close };
} }
return $self; return $self;
@ -1948,32 +1967,34 @@ sub get_bodystructure {
my $out = $self->fetch( $msg, "BODYSTRUCTURE" ) or return undef; my $out = $self->fetch( $msg, "BODYSTRUCTURE" ) or return undef;
my $bs = ""; my $bs = "";
my $output = first { /BODYSTRUCTURE\s+\(/i } @$out; # Wee! ;-) my $output = first { /BODYSTRUCTURE\s+\(/i } @$out;
if ( $output =~ /$CRLF$/o ) {
$bs = eval { $class->new($output) }; # BUG? localize $@ here? unless ( $output =~ /$CRLF$/o ) {
} $output = '';
else {
$self->_debug("get_bodystructure: reassembling original response"); $self->_debug("get_bodystructure: reassembling original response");
my $started = 0; my $started = 0;
my $output = '';
foreach my $o ( $self->_transaction ) { foreach my $o ( $self->_transaction ) {
next unless $self->_is_output_or_literal($o); next unless $self->_is_output_or_literal($o);
$started++ if $o->[DATA] =~ /BODYSTRUCTURE \(/i; $started++ if $o->[DATA] =~ /BODYSTRUCTURE \(/i;
; # Hi, vi! ;-)
$started or next; $started or next;
if ( length $output && $self->_is_literal($o) ) { if ( length($output) && $self->_is_literal($o) ) {
my $data = $o->[DATA]; my $data = $o->[DATA];
$data =~ s/"/\\"/g; $data =~ s/"/\\"/g;
$data =~ s/\(/\\\(/g; $data =~ s/\(/\\\(/g;
$data =~ s/\)/\\\)/g; $data =~ s/\)/\\\)/g;
$output .= qq("$data"); $output .= qq("$data");
} }
else { $output .= $o->[DATA] } else {
$output .= $o->[DATA];
}
}
$self->_debug("get_bodystructure: reassembled output=$output<END>"); $self->_debug("get_bodystructure: reassembled output=$output<END>");
} }
eval { $bs = $class->new($output) }; # BUG? localize $@ here?
{
local ($@);
$bs = eval { $class->new($output) };
} }
$self->_debug( $self->_debug(
@ -1992,25 +2013,15 @@ sub get_envelope {
my $out = $self->fetch( $msg, 'ENVELOPE' ) or return undef; my $out = $self->fetch( $msg, 'ENVELOPE' ) or return undef;
my $bs = ""; my $bs = "";
my $output = first { /ENVELOPE \(/i } @$out; # vi ;-) my $output = first { /ENVELOPE \(/i } @$out;
unless ($output) { unless ( $output =~ /$CRLF$/o ) {
$self->LastError("Unable to use get_envelope: $@"); $output = '';
return undef;
}
if ( $output =~ /$CRLF$/o ) {
eval { $bs = $class->new($output) }; # BUG? localize $@ here?
}
else {
$self->_debug("get_envelope: reassembling original response"); $self->_debug("get_envelope: reassembling original response");
my $started = 0; my $started = 0;
$output = '';
foreach my $o ( $self->_transaction ) { foreach my $o ( $self->_transaction ) {
next unless $self->_is_output_or_literal($o); next unless $self->_is_output_or_literal($o);
$self->_debug("o->[DATA] is $o->[DATA]"); $started++ if $o->[DATA] =~ /ENVELOPE \(/i;
$started++ if $o->[DATA] =~ /ENVELOPE \(/i; # Hi, vi! ;-)
$started or next; $started or next;
if ( length($output) && $self->_is_literal($o) ) { if ( length($output) && $self->_is_literal($o) ) {
@ -2018,18 +2029,21 @@ sub get_envelope {
$data =~ s/"/\\"/g; $data =~ s/"/\\"/g;
$data =~ s/\(/\\\(/g; $data =~ s/\(/\\\(/g;
$data =~ s/\)/\\\)/g; $data =~ s/\)/\\\)/g;
$output .= '"' . $data . '"'; $output .= qq("$data");
} }
else { else {
$output .= $o->[DATA]; $output .= $o->[DATA];
} }
}
$self->_debug("get_envelope: reassembled output=$output<END>"); $self->_debug("get_envelope: reassembled output=$output<END>");
} }
eval { $bs = $class->new($output) }; # BUG? localize $@ here? {
local ($@);
$bs = eval { $class->new($output) };
} }
$self->_debug( "get_envelope: msg $msg returns ref: " . $bs || "UNDEF" ); $self->_debug( "get_envelope: msg $msg returns: " . ( $bs || "UNDEF" ) );
$bs; $bs;
} }
@ -2723,17 +2737,15 @@ sub restore_message {
scalar grep /^\*\s\d+\sFETCH\s\(.*FLAGS.*(?!\\Deleted)/, $self->Results; scalar grep /^\*\s\d+\sFETCH\s\(.*FLAGS.*(?!\\Deleted)/, $self->Results;
} }
#??? compare to uidnext. Why is Massage missing?
sub uidvalidity { sub uidvalidity {
my ( $self, $folder ) = @_; my ( $self, $folder ) = @_;
$self->status( $folder, "UIDVALIDITY" ) or return undef; $self->status( $folder, "UIDVALIDITY" ) or return undef;
my $vline = first { /UIDVALIDITY/i } $self->History; my $line = first { /UIDVALIDITY/i } $self->History;
defined $vline && $vline =~ /\(UIDVALIDITY\s+([^\)]+)/ ? $1 : undef; defined $line && $line =~ /\(UIDVALIDITY\s+([^\)]+)/ ? $1 : undef;
} }
sub uidnext { sub uidnext {
my $self = shift; my ( $self, $folder ) = @_;
my $folder = $self->Massage(shift);
$self->status( $folder, "UIDNEXT" ) or return undef; $self->status( $folder, "UIDNEXT" ) or return undef;
my $line = first { /UIDNEXT/i } $self->History; my $line = first { /UIDNEXT/i } $self->History;
defined $line && $line =~ /\(UIDNEXT\s+([^\)]+)/ ? $1 : undef; defined $line && $line =~ /\(UIDNEXT\s+([^\)]+)/ ? $1 : undef;
@ -2964,6 +2976,7 @@ sub append_file {
# $file can be a name or a scalar reference (for in memory file) # $file can be a name or a scalar reference (for in memory file)
# avoid IO::File bug handling scalar refs in perl <= 5.8.8? # avoid IO::File bug handling scalar refs in perl <= 5.8.8?
# - buggy: $fh = IO::File->new( $file, 'r' ) # - buggy: $fh = IO::File->new( $file, 'r' )
local ($!);
open( $fh, "<", $file ) open( $fh, "<", $file )
or push( @err, "Unable to open file '$file': $!" ); or push( @err, "Unable to open file '$file': $!" );
} }
@ -3214,18 +3227,12 @@ sub authenticate {
sub copy { sub copy {
my ( $self, $target, @msgs ) = @_; my ( $self, $target, @msgs ) = @_;
$target = $self->Massage($target);
@msgs =
$self->Ranges
? $self->Range(@msgs)
: sort { $a <=> $b } map { ref $_ ? @$_ : split( ',', $_ ) } @msgs;
my $msgs = my $msgs =
$self->Ranges $self->Ranges
? $self->Range(@msgs) ? $self->Range(@msgs)
: join ',', map { ref $_ ? @$_ : $_ } @msgs; : join ',', map { ref $_ ? @$_ : $_ } @msgs;
$self->_imap_uid_command( COPY => $msgs, $target ) $self->_imap_uid_command( COPY => $msgs, $self->Massage($target) )
or return undef; or return undef;
my @results = $self->History; my @results = $self->History;

View file

@ -1818,7 +1818,7 @@ See also C<Supportedflags>.
Example: Example:
my $newUid = $imap->move($newFolder, $oldUid) my $newUid = $imap->move( $newFolder, $oldUid )
or die "Could not move: $@\n"; or die "Could not move: $@\n";
$imap->expunge; $imap->expunge;
@ -1829,15 +1829,15 @@ be either:
=over 4 =over 4
=item > =item a)
a message sequence number, a message sequence number,
=item > =item b)
a comma-separated list of message sequence numbers, or a comma-separated list of message sequence numbers, or
=item > =item c)
a reference to an array of message sequence numbers. a reference to an array of message sequence numbers.
@ -1847,15 +1847,15 @@ If the L</Uid> parameter is true, then the arguments should be:
=over 4 =over 4
=item > =item a)
a message UID, a message UID,
=item > =item b)
a comma-separated list of message UID's, or a comma-separated list of message UID's, or
=item > =item c)
a reference to an array of message UID's. a reference to an array of message UID's.
@ -1867,8 +1867,8 @@ If move is successful, then it returns a true value. Furthermore, if
the Mail::IMAPClient object is connected to a server that has the the Mail::IMAPClient object is connected to a server that has the
UIDPLUS capability, then the true value will be the comma-separated UIDPLUS capability, then the true value will be the comma-separated
list of UID's for the newly copied messages. The list will be in the list of UID's for the newly copied messages. The list will be in the
order in which the messages were moved. (Since B<move> uses the copy order in which the messages were moved which should correspond to the
method, the messages will be moved in numerical order.) order of the message UID provided by the caller.
If the move is not successful then B<move> returns C<undef>. If the move is not successful then B<move> returns C<undef>.
@ -3444,11 +3444,13 @@ fancier authentication method, see L</RawSocket>.
If an IMAP connection must start TLS/SSL after connecting to a server If an IMAP connection must start TLS/SSL after connecting to a server
then set this attribute. If the value is set to an arrayref then they then set this attribute. If the value is set to an arrayref then they
will be used as arguments to IO::Socket::SSL::start_SSL. By default will be used as arguments to IO::Socket::SSL->start_SSL. By default
this connection is set to blocking while establishing the connection this connection is set to blocking while establishing the connection
with a timeout of 30 seconds. The socket will be reset to the with a timeout of 30 seconds. The socket will be reset to the
original blocking/non-blocking value after a successful TLS original blocking/non-blocking value after a successful TLS
negotiation has occured. negotiation has occured. The arguments used in the call to start_SSL
can be controlled by setting this attribute to an ARRAY reference
containing the desired arguments.
Version note: attribute added in Mail::IMAPClient 3.22 Version note: attribute added in Mail::IMAPClient 3.22
@ -3457,7 +3459,9 @@ Version note: attribute added in Mail::IMAPClient 3.22
If an IMAP connection requires SSL you can set the Ssl attribute to If an IMAP connection requires SSL you can set the Ssl attribute to
'1' and Mail::IMAPClient will automatically use L<IO::Socket::SSL> '1' and Mail::IMAPClient will automatically use L<IO::Socket::SSL>
instead of L<IO::Socket::INET> to connect to the server. This instead of L<IO::Socket::INET> to connect to the server. This
attribute is used in the L</connect> method. attribute is used in the L</connect> method. The arguments used in
the call to IO::Socket::SSL->new can be controlled by setting this
attribute to an ARRAY reference containing the desired arguments.
See also L</connect> for details on connection initiatiation and See also L</connect> for details on connection initiatiation and
L</Socket> and L</Rawsocket> if you need to take more control of L</Socket> and L</Rawsocket> if you need to take more control of
@ -3870,7 +3874,7 @@ http://rt.cpan.org/Public/Dist/Display.html?Name=Mail-IMAPClient
Copyright (C) 1999-2003 The Kernen Group, Inc. Copyright (C) 1999-2003 The Kernen Group, Inc.
Copyright (C) 2007-2009 Mark Overmeer Copyright (C) 2007-2009 Mark Overmeer
Copyright (C) 2010-2012 Phil Pearl (Lobbes) Copyright (C) 2010-2013 Phil Pearl (Lobbes)
All rights reserved. All rights reserved.
This library is free software; you can redistribute it and/or modify This library is free software; you can redistribute it and/or modify

View file

@ -1,17 +0,0 @@
Users reported a problem with Windows and the imapsync release 1.219
To fix the problem try this :
Near line 1170 there are 2 lines :
#unless($new_id = $to->append_string($t_fold,$string, $flags_f, $d)){
unless($new_id = $to->append_file2($t_fold, $message_file, "", $flags_f, $d)){
The first is commented with a # character, the second is not.
Remove the # on the first line and add a # at the beginning
of the second line. Run imapsync again and tell me if
your problem is solved.
This bug is fixed in revision 1.231

20
W/bugs/Makefile Normal file
View file

@ -0,0 +1,20 @@
all:
@echo "make buid_ssl_exe"
@echo "make test_ssl_exe"
check:
perl -I../Mail-IMAPClient-3.33/lib/ -c bug_ssl_win32_1
perl -I../Mail-IMAPClient-3.33/lib/ -c bug_ssl_win32_2
buid_ssl_exe: check
unix2dos *.bat
scp build_test_ssl.bat bug_ssl_win32_?* Admin@c:'C:/msys/1.0/home/Admin/imapsync/'
ssh Admin@c 'C:/msys/1.0/home/Admin/imapsync/build_test_ssl.bat'
test_ssl_exe: check
unix2dos *.bat
scp test_ssl.bat Admin@c:'C:/msys/1.0/home/Admin/imapsync/'
ssh Admin@c 'C:/msys/1.0/home/Admin/imapsync/test_ssl.bat'

30
W/bugs/bug_ssl_win32_1 Executable file
View file

@ -0,0 +1,30 @@
#!/usr/bin/perl -w
use Mail::IMAPClient;
use IO::Socket::SSL;
$ARGV[3] or die "usage: $0 host user password folder\n";
$host = $ARGV[0];
$user = $ARGV[1];
$password = $ARGV[2];
$folder = $ARGV[3];
my $imap = Mail::IMAPClient->new();
my $ssl = IO::Socket::SSL->new(
Proto => 'tcp',
PeerAddr => $host,
PeerPort => 993, # IMAP over SSL standard port
);
$imap->Debug(1);
#$imap->Server($host);
$imap->Socket($ssl);
#$imap->connect() or die;
$imap->User($user);
$imap->Password($password);
$imap->login() or die;
$imap->Uid(1);
$imap->Peek(1);
$imap->select($folder) or die;
$imap->close();

44
W/bugs/bug_ssl_win32_2 Executable file
View file

@ -0,0 +1,44 @@
#!/usr/bin/perl -w
# $Id: $
use strict ;
use English ;
use Mail::IMAPClient ;
use IO::Socket::SSL ;
$ARGV[3] or die "usage: $0 host user password folder\n" ;
my $host = $ARGV[0] ;
my $user = $ARGV[1] ;
my $password = $ARGV[2] ;
my $folder = $ARGV[3] ;
IO::Socket::SSL::set_ctx_defaults( SSL_verify_mode => 0 ) ;
$IO::Socket::SSL::DEBUG = 3 ;
printf( "Perl %vd", $PERL_VERSION ) ;
print "\nMail::IMAPClient $Mail::IMAPClient::VERSION \n",
"IO::Socket $IO::Socket::VERSION\n" ,
"IO::Socket::INET $IO::Socket::INET::VERSION \n",
"IO::Socket::SSL $IO::Socket::SSL::VERSION \n",
"Net::SSLeay $Net::SSLeay::VERSION \n",
" \n",
;
my $imap ;
$imap = Mail::IMAPClient->new(
Server => $host,
User => $user,
Password => $password,
Ssl => 1,
Uid => 1,
) or die( "Connect: ", $imap->LastError, "\n" ) ;
$imap->Debug( 1 ) ;
$imap->Peek( 1 ) ;
my $folders = $imap->folders ;
$imap->select( $folder ) or die ;
$imap->logout( ) ;

33
W/bugs/bug_ssl_win32_3_http Executable file
View file

@ -0,0 +1,33 @@
#!/usr/bin/perl
use strict ;
use warnings ;
use English ;
use IO::Socket::SSL ;
printf( "Perl %vd", $PERL_VERSION ) ;
print
"\nIO::Socket $IO::Socket::VERSION\n" ,
"IO::Socket::INET $IO::Socket::INET::VERSION \n",
"IO::Socket::INET6 $IO::Socket::INET6::VERSION \n",
"IO::Socket::SSL $IO::Socket::SSL::VERSION \n",
"Net::SSLeay $Net::SSLeay::VERSION \n",
" \n",
;
my $sock = IO::Socket::SSL->new(
# where to connect
PeerHost => "www.google.com",
PeerPort => "https",
# certificate verification
SSL_verify_mode => SSL_VERIFY_NONE,
SSL_verifycn_schema => 'http',
) or die "failed connect or ssl handshake: $!,$SSL_ERROR";
# send and receive over SSL connection
print $sock "GET / HTTP/1.0\r\n\r\n";
print <$sock>;

12
W/bugs/build_test_ssl.bat Normal file
View file

@ -0,0 +1,12 @@
REM $Id: $
cd /D %~dp0
REM pp -o bug_ssl_win32_1.exe bug_ssl_win32_1
pp -M IO::Socket::IP -o bug_ssl_win32_2.exe bug_ssl_win32_2
REM pp -o bug_ssl_win32_3_http.exe bug_ssl_win32_3_http

13
W/bugs/test_ssl.bat Normal file
View file

@ -0,0 +1,13 @@
REM $Id: $
cd /D %~dp0
perl bug_ssl_win32_2 imap.gmail.com imapsync.gl@gmail.com sss INBOX
REM perl bug_ssl_win32_3_http
PAUSE
bug_ssl_win32_2.exe imap.gmail.com imapsync.gl@gmail.com sss INBOX
REM bug_ssl_win32_3_http.exe
PAUSE

View file

@ -1,20 +0,0 @@
REM $Id: build_exe.bat,v 1.12 2013/05/06 08:16:26 gilles Exp gilles $
REM
echo Building imapsync.exe
cd C:\msys\1.0\home\Admin\imapsync
perl -mMail::IMAPClient -mIO::Socket -mIO::Socket::SSL ^
-mDigest::MD5 -mDigest::HMAC_MD5 -mDigest::HMAC_SHA1 ^
-mTerm::ReadKey -mFile::Spec -mAuthen::NTLM ^
-mTime::Local -mURI::Escape -mData::Uniqid^
-e ''
pp -o imapsync.exe --link libeay32_.dll --link libssl32_.dll ^
-M Mail::IMAPClient -M IO::Socket -M IO::Socket::SSL ^
-M Digest::MD5 -M Digest::HMAC_MD5 -M Digest::HMAC_SHA1 ^
-M Term::ReadKey -M Authen::NTLM ^
-M Time::Local -M URI::Escape -M Data::Uniqid ^
imapsync
echo Done building imapsync.exe

67
W/memo
View file

@ -1,6 +1,31 @@
#!/bin/sh #!/bin/sh
# $Id: memo,v 1.43 2012/12/24 02:25:00 gilles Exp gilles $ # $Id: memo,v 1.44 2013/07/03 04:14:44 gilles Exp gilles $
count_nice() {
#set -x
# count # prints 01 02 03 04 05 06 07 08 09 10
# count 2 # prints 2 3 4 5 6 7 8 9 10 11
# count 005 # prints 005 006 007 008 009 010 011 012 013 014
# count 5 23 # prints 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
# count 5 23 3 # prints 5 8 11 14 17 20 23
nb_from=${1:-"01"}
nb_from_ln=`expr length $nb_from`
nb_to=${2:-`expr $nb_from + 9`}
nb_incr=${3:-"1"}
nb_counter=$nb_from
while test $nb_counter -le $nb_to;do
nb_list="$nb_list $nb_counter"
nb_counter=`expr $nb_counter + $nb_incr`
nb_counter=`printf %0${nb_from_ln}d $nb_counter`
done
echo $nb_list
#set +x
}
software_version() { software_version() {
@ -144,6 +169,14 @@ statistics_VERSION_yearly_ip() {
) )
} }
statistics_VERSION_yearly_runs() {
year=${1:-`date '+%Y'`}
(
cd /home/lf/glamiral/imapsync_stats
test -f stats_imapsync_${year}.ip && cat stats_imapsync_${year}.ip | awk '{ sum+=$1 } END {print sum}'
)
}
echo "statistics_VERSION_synthesis 2012 # short" echo "statistics_VERSION_synthesis 2012 # short"
statistics_VERSION_synthesis() { statistics_VERSION_synthesis() {
@ -152,16 +185,19 @@ statistics_VERSION_synthesis() {
cd /home/lf/glamiral/imapsync_stats cd /home/lf/glamiral/imapsync_stats
echo Nb users each month echo Nb users each month
wc -l stats_imapsync_${year}_??.ip wc -l stats_imapsync_${year}_??.ip
echo Nb users each year
wc -l stats_imapsync_????.ip
echo Nb runs each month echo Nb runs each month
tail -n 1 stats_imapsync_${year}_??.runs tail -n 1 stats_imapsync_${year}_??.runs
echo % Operating systems echo % Operating systems
statistics_VERSION_yearly_os $year statistics_VERSION_yearly_os $year
echo Biggest users echo Biggest users
tail -n 5 stats_imapsync_${year}.ip tail -n 5 stats_imapsync_${year}.ip
echo -n "Nb runs each year : " echo Nb users each year
cat stats_imapsync_${year}.ip | awk '{ sum+=$1 } END {print sum}' wc -l stats_imapsync_????.ip
echo "Nb runs each year : "
for yyyy in `count_nice 2011 ${year}`; do
echo -n "$yyyy: "
statistics_VERSION_yearly_runs $yyyy
done
) )
} }
@ -289,6 +325,16 @@ statistics_VERSION_yearly_ip() {
) )
} }
statistics_VERSION_yearly_runs() {
year=${1:-`date '+%Y'`}
(
cd /home/imapsync/imapsync_stats
test -f stats_imapsync_${year}.ip && cat stats_imapsync_${year}.ip | awk '{ sum+=$1 } END {print sum}'
)
}
echo "statistics_VERSION_synthesis 2012 # short" echo "statistics_VERSION_synthesis 2012 # short"
statistics_VERSION_synthesis() { statistics_VERSION_synthesis() {
year=${1:-`date '+%Y'`} year=${1:-`date '+%Y'`}
@ -296,16 +342,19 @@ statistics_VERSION_synthesis() {
cd /home/imapsync/imapsync_stats cd /home/imapsync/imapsync_stats
echo Nb users each month echo Nb users each month
wc -l stats_imapsync_${year}_??.ip wc -l stats_imapsync_${year}_??.ip
echo Nb users each year
wc -l stats_imapsync_????.ip
echo Nb runs each month echo Nb runs each month
tail -n 1 stats_imapsync_${year}_??.runs tail -n 1 stats_imapsync_${year}_??.runs
echo % Operating systems echo % Operating systems
statistics_VERSION_yearly_os $year statistics_VERSION_yearly_os $year
echo Biggest users echo Biggest users
tail -n 5 stats_imapsync_${year}.ip tail -n 5 stats_imapsync_${year}.ip
echo -n "Nb runs each year : " echo Nb users each year
cat stats_imapsync_${year}.ip | awk '{ sum+=$1 } END {print sum}' wc -l stats_imapsync_????.ip
echo "Nb runs each year : "
for yyyy in `count_nice 2011 ${year}`; do
echo -n "$yyyy: "
statistics_VERSION_yearly_runs $yyyy
done
) )
} }

View file

@ -1,6 +1,6 @@
#!/usr/bin/perl #!/usr/bin/perl
# $Id: paypal_bilan,v 1.66 2013/03/26 19:50:20 gilles Exp gilles $ # $Id: paypal_bilan,v 1.68 2013/06/07 06:59:41 gilles Exp gilles $
use strict; use strict;
use warnings; use warnings;
@ -13,7 +13,7 @@ use Test::More 'no_plan' ;
die unless (utf8_supported_charset('ISO-8859-1')); die unless (utf8_supported_charset('ISO-8859-1'));
my $rcs = '$Id: paypal_bilan,v 1.66 2013/03/26 19:50:20 gilles Exp gilles $ ' ; my $rcs = '$Id: paypal_bilan,v 1.68 2013/06/07 06:59:41 gilles Exp gilles $ ' ;
$rcs =~ m/,v (\d+\.\d+)/ ; $rcs =~ m/,v (\d+\.\d+)/ ;
my $VERSION = ($1) ? $1: "UNKNOWN" ; my $VERSION = ($1) ? $1: "UNKNOWN" ;
@ -813,6 +813,9 @@ Hello $name,
First of all, I'm sorry for the delay in getting back to you. First of all, I'm sorry for the delay in getting back to you.
Last imapsync release is available from the page
http://imapsync.lamiral.info/paypal_return.shtml
You'll find in the attachment the invoice of imapsync You'll find in the attachment the invoice of imapsync
software you bought and paid (dd/mm/yyyy $date). software you bought and paid (dd/mm/yyyy $date).
The invoice file is named facture_imapsync-${invoice}.pdf The invoice file is named facture_imapsync-${invoice}.pdf
@ -851,6 +854,9 @@ Hello $name,
First of all, I'm sorry for the delay in getting back to you. First of all, I'm sorry for the delay in getting back to you.
Last imapsync release is available from the page
http://imapsync.lamiral.info/paypal_return.shtml
You'll find in the attachment the invoice of imapsync You'll find in the attachment the invoice of imapsync
support you bought and paid (dd/mm/yyyy $date). support you bought and paid (dd/mm/yyyy $date).
The invoice file is named facture_imapsync-${invoice}.pdf The invoice file is named facture_imapsync-${invoice}.pdf

View file

@ -1,6 +1,6 @@
#!/bin/sh #!/bin/sh
# $Id: paypal_build_invoices,v 1.49 2013/04/17 14:16:05 gilles Exp gilles $ # $Id: paypal_build_invoices,v 1.53 2013/06/10 14:33:30 gilles Exp gilles $
# usage: sh paypal_build_invoices /g/var/paypal_invoices/???? # usage: sh paypal_build_invoices /g/var/paypal_invoices/????
@ -36,7 +36,9 @@ cp /home/gilles/public_html/AGIL/factures/000/facture_imapsync-000.tex /g/var/pa
#/g/public_html/imapsync/W/paypal_reply/paypal_bilan --write_invoices --first_in 2299 /g/paypal/paypal_2013_01_complet.csv #/g/public_html/imapsync/W/paypal_reply/paypal_bilan --write_invoices --first_in 2299 /g/paypal/paypal_2013_01_complet.csv
#/g/public_html/imapsync/W/paypal_reply/paypal_bilan --write_invoices --first_in 2384 /g/paypal/paypal_2013_02_complet.csv #/g/public_html/imapsync/W/paypal_reply/paypal_bilan --write_invoices --first_in 2384 /g/paypal/paypal_2013_02_complet.csv
#/g/public_html/imapsync/W/paypal_reply/paypal_bilan --write_invoices --first_in 2451 /g/paypal/paypal_2013_03_complet.csv #/g/public_html/imapsync/W/paypal_reply/paypal_bilan --write_invoices --first_in 2451 /g/paypal/paypal_2013_03_complet.csv
/g/public_html/imapsync/W/paypal_reply/paypal_bilan --write_invoices --first_in 2519 /g/paypal/paypal_2013_04_complet.csv #/g/public_html/imapsync/W/paypal_reply/paypal_bilan --write_invoices --first_in 2519 /g/paypal/paypal_2013_04_complet.csv
#/g/public_html/imapsync/W/paypal_reply/paypal_bilan --write_invoices --first_in 2572 /g/paypal/paypal_2013_05_complet.csv
/g/public_html/imapsync/W/paypal_reply/paypal_bilan --write_invoices --first_in 2627 /g/paypal/paypal_2013_06_complet.csv
: /g/public_html/imapsync/W/paypal_reply/paypal_bilan --first_in 147 /g/paypal/paypal_2010_11_complet.csv : /g/public_html/imapsync/W/paypal_reply/paypal_bilan --first_in 147 /g/paypal/paypal_2010_11_complet.csv
: /g/public_html/imapsync/W/paypal_reply/paypal_bilan --first_in 214 /g/paypal/paypal_2010_12_complet.csv : /g/public_html/imapsync/W/paypal_reply/paypal_bilan --first_in 214 /g/paypal/paypal_2010_12_complet.csv
@ -67,19 +69,22 @@ cp /home/gilles/public_html/AGIL/factures/000/facture_imapsync-000.tex /g/var/pa
: /g/public_html/imapsync/W/paypal_reply/paypal_bilan --first_in 2299 /g/paypal/paypal_2013_01_complet.csv : /g/public_html/imapsync/W/paypal_reply/paypal_bilan --first_in 2299 /g/paypal/paypal_2013_01_complet.csv
: /g/public_html/imapsync/W/paypal_reply/paypal_bilan --first_in 2384 /g/paypal/paypal_2013_02_complet.csv : /g/public_html/imapsync/W/paypal_reply/paypal_bilan --first_in 2384 /g/paypal/paypal_2013_02_complet.csv
: /g/public_html/imapsync/W/paypal_reply/paypal_bilan --first_in 2451 /g/paypal/paypal_2013_03_complet.csv : /g/public_html/imapsync/W/paypal_reply/paypal_bilan --first_in 2451 /g/paypal/paypal_2013_03_complet.csv
set -x
: /g/public_html/imapsync/W/paypal_reply/paypal_bilan --first_in 2519 /g/paypal/paypal_2013_04_complet.csv : /g/public_html/imapsync/W/paypal_reply/paypal_bilan --first_in 2519 /g/paypal/paypal_2013_04_complet.csv
: /g/public_html/imapsync/W/paypal_reply/paypal_bilan --first_in 2572 /g/paypal/paypal_2013_05_complet.csv
set -x
: /g/public_html/imapsync/W/paypal_reply/paypal_bilan --first_in 2627 /g/paypal/paypal_2013_06_complet.csv
set +x set +x
# La totale # La totale
: /g/public_html/imapsync/W/paypal_reply/paypal_bilan --bnc --debug \ : /g/public_html/imapsync/W/paypal_reply/paypal_bilan --bnc --debug \
--first_in 147 --avoid_numbers '292 293 643 644 731 732 1093 1330 1331 1332 1333 1334 1652 1653 2131 2132 2295 2296 2297 2298' \ --first_in 147 --avoid_numbers '292 293 643 644 731 732 1093 1330 1331 1332 1333 1334 1652 1653 2131 2132 2295 2296 2297 2298 2625 2626 ' \
/g/paypal/paypal_201?_??_complet.csv /g/paypal/paypal_201?_??_complet.csv
set -v set -v
: /g/public_html/imapsync/W/paypal_reply/paypal_bilan \ : /g/public_html/imapsync/W/paypal_reply/paypal_bilan \
--first_in 147 --avoid_numbers '292 293 643 644 731 732 1093 1330 1331 1332 1333 1334 1652 1653 2131 2132 2295 2296 2297 2298' \ --first_in 147 --avoid_numbers '292 293 643 644 731 732 1093 1330 1331 1332 1333 1334 1652 1653 2131 2132 2295 2296 2297 2298 2625 2626 ' \
/g/paypal/paypal_201?_??_complet.csv /g/paypal/paypal_201?_??_complet.csv
set +v set +v

16
W/test3.bat Normal file
View file

@ -0,0 +1,16 @@
REM $Id: test3.bat,v 1.2 2013/05/22 10:09:27 gilles Exp gilles $
cd /D %~dp0
REM ./imapsync.exe --modules_version
perl .\imapsync --host1 imap.gmail.com --ssl1 --user1 gilles.lamiral@gmail.com --passfile1 secret.gilles_gmail ^
--host2 imap.gmail.com --ssl2 --user2 gilles.lamiral@gmail.com --passfile2 secret.gilles_gmail ^
--folder INBOX --dry
PAUSE
.\imapsync.exe --host1 imap.gmail.com --ssl1 --user1 gilles.lamiral@gmail.com --passfile1 secret.gilles_gmail ^
--host2 imap.gmail.com --ssl2 --user2 gilles.lamiral@gmail.com --passfile2 secret.gilles_gmail ^
--folder INBOX --dry

29
build_exe.bat Normal file
View file

@ -0,0 +1,29 @@
REM $Id: build_exe.bat,v 1.17 2013/07/03 04:13:30 gilles Exp gilles $
@ECHO OFF
ECHO Building imapsync.exe
CALL .\examples\install_modules.bat
cd /D %~dp0
perl -mMail::IMAPClient -mIO::Socket -mIO::Socket::SSL ^
-mDigest::MD5 -mDigest::HMAC_MD5 -mDigest::HMAC_SHA1 ^
-mTerm::ReadKey -mFile::Spec -mAuthen::NTLM ^
-mTime::Local -mURI::Escape -mData::Uniqid ^
-e ''
cd
@ECHO ON
pp -o imapsync.exe ^
--link libeay32_.dll --link libssl32_.dll ^
--link zlib1_.dll --link ssleay32_.dll ^
-M Mail::IMAPClient -M IO::Socket -M IO::Socket::IP -M IO::Socket::SSL -M IO::Socket::INET ^
-M Digest::MD5 -M Digest::HMAC_MD5 -M Digest::HMAC_SHA1 ^
-M Term::ReadKey -M Authen::NTLM ^
-M Time::Local -M URI::Escape -M Data::Uniqid ^
imapsync
echo Done building imapsync.exe
pause

View file

@ -1,30 +1,31 @@
REM $Id: install_modules.bat,v 1.2 2013/05/06 08:26:39 gilles Exp gilles $ REM $Id: install_modules.bat,v 1.5 2013/07/03 12:00:23 gilles Exp gilles $
REM hi
@ECHO OFF
ECHO Installing Perl modules for imapsync ECHO Installing Perl modules for imapsync
CD C:\msys\1.0\home\Admin\imapsync REM CD /D %~dp0
perl -mMail::IMAPClient -e "" perl -v
IF ERRORLEVEL 0 GOTO install_01 IF ERRORLEVEL 1 ECHO Perl needed. Install Strawberry Perl. Get it at http://strawberryperl.com/ ^
perl -MCPAN -e "install Mail::IMAPClient" && EXIT /B
:install_01 REM perl is there
FOR %%M in ( Mail::IMAPClient ^ FOR %%M in ( IO::Socket ^
IO::Socket IO::Socket::SSL ^ Net::SSLeay IO::Socket::SSL ^
Digest::MD5 Digest::HMAC_MD5 ^ Digest::MD5 Digest::HMAC_MD5 ^
Term::ReadKey File::Spec ^ Term::ReadKey File::Spec ^
Time::HiRes ^ Time::HiRes ^
Data::Uniqid URI::Escape ^ Data::Uniqid URI::Escape ^
Authen::NTLM ^ Authen::NTLM ^
Time::Local ^ Time::Local ^
Mail::IMAPClient ^
PAR::Packer ) DO ECHO Testing %%M ^ PAR::Packer ) DO ECHO Testing %%M ^
& perl -m%%M -e "" || perl -MCPAN -e "install %%M" & perl -m%%M -e "" || perl -MCPAN -e "install %%M"
ECHO Perl modules for imapsync installed ECHO Perl modules for imapsync installed
REM PAUSE
PAUSE

4
i3
View file

@ -1,7 +1,7 @@
#!/bin/sh #!/bin/sh
# $Id: i3,v 1.11 2012/09/11 21:00:06 gilles Exp gilles $ # $Id: i3,v 1.12 2013/07/03 04:11:35 gilles Exp gilles $
BASE=`dirname $0` BASE=`dirname $0`
perl -I${BASE}/W/Mail-IMAPClient-3.32/lib ${BASE}/imapsync "$@" perl -I${BASE}/W/Mail-IMAPClient-3.33/lib ${BASE}/imapsync "$@"

193
imapsync
View file

@ -11,6 +11,8 @@
# IMAPClient 2.2.9 overrides # IMAPClient 2.2.9 overrides
# IMAPClient 2.2.9 3.xx ads # IMAPClient 2.2.9 3.xx ads
# pod documentation
=pod =pod
=head1 NAME =head1 NAME
@ -20,7 +22,7 @@ Synchronises mailboxes between two imap servers.
Good at IMAP migration. More than 52 different IMAP server softwares Good at IMAP migration. More than 52 different IMAP server softwares
supported with success, few failures. supported with success, few failures.
$Revision: 1.542 $ $Revision: 1.547 $
=head1 SYNOPSIS =head1 SYNOPSIS
@ -365,7 +367,7 @@ Failure stories reported with the following 3 imap servers:
- Hotmail since hotmail.com does not provide IMAP access - Hotmail since hotmail.com does not provide IMAP access
- Outlook.com since outlook.com does not provide IMAP access - Outlook.com since outlook.com does not provide IMAP access
Success stories reported with the following 52 imap servers Success stories reported with the following 53 imap servers
(software names are in alphabetic order): (software names are in alphabetic order):
- 1und1 H mimap1 84498 [host1] H mibap4 95231 [host1] - 1und1 H mimap1 84498 [host1] H mibap4 95231 [host1]
@ -388,6 +390,7 @@ Success stories reported with the following 52 imap servers
- Deerfield VisNetic MailServer 5.8.6 [host1] (http://www.deerfield.net/products/visnetic-mailserver/) - Deerfield VisNetic MailServer 5.8.6 [host1] (http://www.deerfield.net/products/visnetic-mailserver/)
- DBMail 1.2.1, 2.0.4, 2.0.9, 2.2rc1 (GPL) (http://www.dbmail.org/). - DBMail 1.2.1, 2.0.4, 2.0.9, 2.2rc1 (GPL) (http://www.dbmail.org/).
2.0.7 seems buggy. 2.0.7 seems buggy.
- DBOX 2.41 System [host1] (http://www.dbox.handshake.de/).
- Deerfield VisNetic MailServer 5.8.6 [host1] - Deerfield VisNetic MailServer 5.8.6 [host1]
- dkimap4 [host1] - dkimap4 [host1]
- Domino (Notes) 4.61[host1], 6.5[host1], 5.0.6, 5.0.7, 7.0.2, 6.0.2CF1, - Domino (Notes) 4.61[host1], 6.5[host1], 5.0.6, 5.0.7, 7.0.2, 6.0.2CF1,
@ -401,7 +404,7 @@ Success stories reported with the following 52 imap servers
- hMailServer 5.3.3 [host2], 4.4.1 [host1] (see FAQ) - hMailServer 5.3.3 [host2], 4.4.1 [host1] (see FAQ)
- iPlanet Messaging server 4.15, 5.1, 5.2 - iPlanet Messaging server 4.15, 5.1, 5.2
- IMail 7.15 (Ipswitch/Win2003), 8.12, 11.03 [host1] - IMail 7.15 (Ipswitch/Win2003), 8.12, 11.03 [host1]
- Kerio 7.2.0 Patch 1 [host1] [host2] - Kerio 7.2.0 Patch 1 [host12], Kerio 8 [host1]
- Mail2World IMAP4 Server 2.5 [host1] (http://www.mail2world.com/) - Mail2World IMAP4 Server 2.5 [host1] (http://www.mail2world.com/)
- MailEnable 4.23 [host1] [host2], 4.26 [host1][host2], 5 [host1] - MailEnable 4.23 [host1] [host2], 4.26 [host1][host2], 5 [host1]
- MDaemon 7.0.1, 8.0.2, 8.1, 9.5.4 (Windows server 2003 R2 platform), - MDaemon 7.0.1, 8.0.2, 8.1, 9.5.4 (Windows server 2003 R2 platform),
@ -531,7 +534,7 @@ Entries for imapsync:
Feedback (good or bad) will often be welcome. Feedback (good or bad) will often be welcome.
$Id: imapsync,v 1.542 2013/05/06 08:30:35 gilles Exp gilles $ $Id: imapsync,v 1.547 2013/07/03 01:24:34 gilles Exp gilles $
=cut =cut
@ -543,7 +546,7 @@ use warnings;
++$|; ++$|;
use Carp; use Carp;
use Getopt::Long; use Getopt::Long;
use Mail::IMAPClient; use Mail::IMAPClient 3.29 ;
use Digest::MD5 qw( md5 md5_hex md5_base64 ); use Digest::MD5 qw( md5 md5_hex md5_base64 );
use Digest::HMAC_SHA1 qw( hmac_sha1 ) ; use Digest::HMAC_SHA1 qw( hmac_sha1 ) ;
#use Term::ReadKey; #use Term::ReadKey;
@ -662,7 +665,7 @@ my(
# global variables initialisation # global variables initialisation
$rcs = '$Id: imapsync,v 1.542 2013/05/06 08:30:35 gilles Exp gilles $ '; $rcs = '$Id: imapsync,v 1.547 2013/07/03 01:24:34 gilles Exp gilles $ ';
$total_bytes_transferred = 0; $total_bytes_transferred = 0;
$total_bytes_skipped = 0; $total_bytes_skipped = 0;
@ -784,7 +787,7 @@ check_lib_version() or
exit_clean(0) if ($justbanner); exit_clean(0) if ($justbanner);
# By default, 1000 at a time, not more. # By default, 100 at a time, not more.
$split1 ||= 100; $split1 ||= 100;
$split2 ||= 100; $split2 ||= 100;
@ -1773,12 +1776,18 @@ sub modules_VERSION {
eval { require IO::Socket; $v = $IO::Socket::VERSION } or $v = "?" ; eval { require IO::Socket; $v = $IO::Socket::VERSION } or $v = "?" ;
push ( @list_version, module_version_str( 'IO::Socket', $v ) ) ; push ( @list_version, module_version_str( 'IO::Socket', $v ) ) ;
eval { require IO::Socket::IP; $v = $IO::Socket::IP::VERSION } or $v = "?" ;
push ( @list_version, module_version_str( 'IO::Socket::IP', $v ) ) ;
eval { require IO::Socket::INET; $v = $IO::Socket::INET::VERSION } or $v = "?" ; eval { require IO::Socket::INET; $v = $IO::Socket::INET::VERSION } or $v = "?" ;
push ( @list_version, module_version_str( 'IO::Socket::INET', $v ) ) ; push ( @list_version, module_version_str( 'IO::Socket::INET', $v ) ) ;
eval { require IO::Socket::SSL ; $v = $IO::Socket::SSL::VERSION } or $v = "?" ; eval { require IO::Socket::SSL ; $v = $IO::Socket::SSL::VERSION } or $v = "?" ;
push ( @list_version, module_version_str( 'IO::Socket::SSL ', $v ) ) ; push ( @list_version, module_version_str( 'IO::Socket::SSL ', $v ) ) ;
eval { require Net::SSLeay ; $v = $Net::SSLeay::VERSION } or $v = "?" ;
push ( @list_version, module_version_str( 'Net::SSLeay ', $v ) ) ;
eval { require Digest::MD5; $v = $Digest::MD5::VERSION } or $v = "?" ; eval { require Digest::MD5; $v = $Digest::MD5::VERSION } or $v = "?" ;
push ( @list_version, module_version_str( 'Digest::MD5', $v ) ) ; push ( @list_version, module_version_str( 'Digest::MD5', $v ) ) ;
@ -1869,95 +1878,6 @@ sub catch_continue {
print "\nGot a SIG$signame!\n" ; print "\nGot a SIG$signame!\n" ;
} }
sub myconnect {
my $self = shift;
$debug and print "Entering myconnect\n";
%$self = (%$self, @_);
my $sock = (($self->Ssl) ? IO::Socket::SSL->new : IO::Socket::INET->new);
my $dp = ($self->Ssl ? 'imaps(993)' : 'imap(143)');
$debug and print "Calling configure\n";
my $ret = $sock->configure({
PeerAddr => $self->Server ,
PeerPort => $self->Port||$dp ,
Proto => 'tcp' ,
Timeout => $self->Timeout||0 ,
Debug => $self->Debug ,
});
unless ( defined($ret) ) {
$self->LastError( "$@\n");
$@ = "$@";
carp "$@"
unless defined wantarray;
return ;
}
$sock->autoflush(1);
my $banner = $sock->getline();
$debug and print "Read: $banner";
$self->Banner($banner);
$self->RawSocket2($sock);
$self->State(Connected);
if (defined($banner) and $banner =~ /\* PREAUTH/)
{
$self->State(Authenticated);
}
if ($self->Tls) {
starttls($self);
$self->Starttls( 1 ) ;
}
$self->Ignoresizeerrors($allowsizemismatch);
if ($self->User and $self->Password) {
$debug and print "Calling login\n";
return $self->login ;
}
else {
return $self;
}
}
sub starttls {
my $self = shift;
my $socket = $self->RawSocket2();
$debug and print "Entering starttls\n";
unless ($self->has_capability("STARTTLS")) {
die_clean( "No STARTTLS capability" );
}
print $socket "z00 STARTTLS\015\012";
CORE::select( undef, undef, undef, 0.025 );
my $txt = $socket->getline();
$debug and print "Read tls: $txt";
unless($txt =~ /^z00 OK/){
die_clean( "Invalid response for STARTTLS: $txt\n" );
}
$debug and print "Calling start_SSL\n";
unless(IO::Socket::SSL->start_SSL($socket,
{
SSL_version => "TLSV1",
SSL_startHandshake => 1,
SSL_verify_depth => 1,
}))
{
die_clean( "Couldn't start TLS: ".IO::Socket::SSL::errstr()."\n");
}
if (ref($socket) ne "IO::Socket::SSL") {
die_clean( "Socket has NOT been converted to SSL");
}else{
$debug and print "Socket successfuly converted to SSL\n";
}
$debug and print "Ending starttls\n";
}
sub connect_imap { sub connect_imap {
@ -1968,9 +1888,14 @@ sub connect_imap {
$imap->Server($host); $imap->Server($host);
$imap->Port($port); $imap->Port($port);
$imap->Debug($debugimap); $imap->Debug($debugimap);
#$imap->connect() $imap->connect()
myconnect($imap)
or die_clean("Can not open imap connection on [$host]: $@\n"); or die_clean("Can not open imap connection on [$host]: $@\n");
#myconnect($imap)
# or die_clean("Can not open imap connection on [$host]: $@\n");
my $banner = $imap->Results()->[0] ;
$imap->Banner( $banner ) ;
$imap->starttls( ) if ( $imap->Tls( ) ) ;
return( $imap ) ;
} }
sub justconnect { sub justconnect {
@ -2053,8 +1978,7 @@ sub login_imap {
$imap->Reconnectretry($reconnectretry) if ($reconnectretry); $imap->Reconnectretry($reconnectretry) if ($reconnectretry);
#$imap->connect() $imap->connect()
myconnect($imap)
or die_clean("Failure: can not open imap connection on [$host] with user [$user]: $@\n"); or die_clean("Failure: can not open imap connection on [$host] with user [$user]: $@\n");
print "Banner: ", server_banner($imap); print "Banner: ", server_banner($imap);
@ -2068,6 +1992,10 @@ sub login_imap {
} }
} }
$imap->starttls( ) if ( $imap->Tls( ) ) ;
$imap->Ignoresizeerrors( $allowsizemismatch ) ;
if ($imap->has_capability("AUTH=$authmech") if ($imap->has_capability("AUTH=$authmech")
or $imap->has_capability($authmech) or $imap->has_capability($authmech)
) { ) {
@ -2094,16 +2022,13 @@ sub login_imap {
if ($proxyauth) { if ($proxyauth) {
$imap->User($authuser); $imap->User($authuser) ;
$imap->Domain($domain) if (defined($domain));
$imap->Authuser($authuser);
$imap->Password($password);
} else { } else {
$imap->User($user); $imap->User($user) ;
}
$imap->Domain($domain) if (defined($domain)); $imap->Domain($domain) if (defined($domain));
$imap->Authuser($authuser); $imap->Authuser($authuser);
$imap->Password($password); $imap->Password($password);
}
unless ( $authmech eq 'PREAUTH' or $imap->login( ) ) { unless ( $authmech eq 'PREAUTH' or $imap->login( ) ) {
my $info = "Failure: error login on [$host] with user [$user] auth" ; my $info = "Failure: error login on [$host] with user [$user] auth" ;
@ -2120,11 +2045,20 @@ sub login_imap {
$imap->login() or $imap->login() or
die_clean("$info [LOGIN]: ", $imap->LastError, "\n") ; die_clean("$info [LOGIN]: ", $imap->LastError, "\n") ;
} }
$proxyauth && $imap->proxyauth($user);
$split and $imap->Split( $split ) ;
print "Info: success login on [$host] with user [$user] auth [$authmech]\n"; if ( $proxyauth ) {
return($imap); if ( ! $imap->proxyauth( $user ) ) {
my $info = "Failure: error doing proxyauth as user [$user] on [$host] using proxy-login as [$authuser]" ;
my $einfo = $imap->LastError || @{$imap->History}[-1] ;
chomp( $einfo ) ;
die_clean( "$info: $einfo\n" ) ;
}
}
$split and $imap->Maxcommandlength( 10 * $split ) ;
print "Info: success login on [$host] with user [$user] auth [$authmech]\n" ;
return( $imap ) ;
} }
@ -2221,8 +2155,8 @@ sub banner_imapsync {
my @argv_copy = @_; my @argv_copy = @_;
my $banner_imapsync = join("", my $banner_imapsync = join("",
'$RCSfile: imapsync,v $ ', '$RCSfile: imapsync,v $ ',
'$Revision: 1.542 $ ', '$Revision: 1.547 $ ',
'$Date: 2013/05/06 08:30:35 $ ', '$Date: 2013/07/03 01:24:34 $ ',
"\n",localhost_info(), "\n", "\n",localhost_info(), "\n",
"Command line used:\n", "Command line used:\n",
"$0 ", command_line_nopassword(@argv_copy), "\n", "$0 ", command_line_nopassword(@argv_copy), "\n",
@ -3105,7 +3039,7 @@ sub copy_message {
# copy # copy
my ( $h1_msg, $h1_fold, $h2_fold, $h1_fir_ref, $permanentflags2, $cache_dir ) = @_ ; my ( $h1_msg, $h1_fold, $h2_fold, $h1_fir_ref, $permanentflags2, $cache_dir ) = @_ ;
$debug and print "msg $h1_fold/$h1_msg copying to $h2_fold\n"; ( $debug or $dry) and print "msg $h1_fold/$h1_msg copying to $h2_fold $dry_message\n";
my $h1_size = $h1_fir_ref->{$h1_msg}->{"RFC822.SIZE"} || '' ; my $h1_size = $h1_fir_ref->{$h1_msg}->{"RFC822.SIZE"} || '' ;
my $h1_flags = $h1_fir_ref->{$h1_msg}->{"FLAGS"} || '' ; my $h1_flags = $h1_fir_ref->{$h1_msg}->{"FLAGS"} || '' ;
@ -4078,7 +4012,13 @@ sub get_options {
sub load_modules { sub load_modules {
require IO::Socket::SSL if ($ssl1 or $ssl2 or $tls1 or $tls2); if ( $ssl1 or $ssl2 or $tls1 or $tls2 ) {
require IO::Socket::SSL ;
#$IO::Socket::SSL::DEBUG = 3 ;
IO::Socket::SSL::set_ctx_defaults(
SSL_verify_mode => 0,
);
}
require Term::ReadKey if ( require Term::ReadKey if (
((not($password1 or $passfile1)) ((not($password1 or $passfile1))
@ -4238,7 +4178,7 @@ sub check_last_release {
} }
sub imapsync_version { sub imapsync_version {
my $rcs = '$Id: imapsync,v 1.542 2013/05/06 08:30:35 gilles Exp gilles $ '; my $rcs = '$Id: imapsync,v 1.547 2013/07/03 01:24:34 gilles Exp gilles $ ';
$rcs =~ m/,v (\d+\.\d+)/; $rcs =~ m/,v (\d+\.\d+)/;
my $VERSION = ($1) ? $1: "UNKNOWN"; my $VERSION = ($1) ? $1: "UNKNOWN";
return($VERSION); return($VERSION);
@ -5122,16 +5062,6 @@ sub tests {
package Mail::IMAPClient; package Mail::IMAPClient;
sub Split {
my $self = shift;
if (@_) {
$self->{SPLIT} = shift;
$self->{Maxcommandlength} = 10 * $self->{SPLIT};
}
return $self->{SPLIT};
}
sub Tls { sub Tls {
my $self = shift; my $self = shift;
@ -5154,19 +5084,6 @@ sub Banner {
return $self->{BANNER}; return $self->{BANNER};
} }
sub RawSocket2 {
my ( $self, $sock ) = @_;
defined $sock
or return $self->{Socket};
$self->{Socket} = $sock;
$self->{_select} = IO::Select->new($sock);
delete $self->{_fcntl};
#$self->Fast_io( $self->Fast_io );
$sock;
}
sub capability_update { sub capability_update {
my $self = shift; my $self = shift;

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"> <!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"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head> <head>
<title>Imapsync: an IMAP migration and backup tool ( release <!--#exec cmd="cat ./VERSION"--> )</title> <title>Official imapsync migration tool ( release <!--#exec cmd="cat ./VERSION"--> )</title>
<meta name="generator" content="Bluefish 1.0.7"/> <meta name="generator" content="Bluefish 1.0.7"/>
<meta name="author" content="Gilles LAMIRAL"/> <meta name="author" content="Gilles LAMIRAL"/>
<meta name="date" content="2013-05-14T09:46:04+0200"/> <meta name="date" content="2013-07-03T04:12:40+0200"/>
<meta name="copyright" content="None"/> <meta name="copyright" content="None"/>
<meta name="keywords" content="imap, transfert, migration"/> <meta name="keywords" content="imap, transfert, migration"/>
<meta name="description" content="imap migration tool"/> <meta name="description" content="imap migration tool"/>
@ -44,7 +44,9 @@
<h2>What is imapsync?</h2> <h2>What is imapsync?</h2>
<p> <p>
The purpose of imapsync is to <b>migrate</b> imap accounts or to <b>backup</b> imap accounts. The purpose of imapsync is to <b>migrate</b> IMAP accounts or to <b>backup</b> IMAP accounts.
IMAP is one of the three current standard protocols to access mailboxes,
the two other are POP3 and HTTP with webmails (often tied to an IMAP server).
</p> </p>
<p><b>imapsync</b> software is a command line tool that allows incremental and <p><b>imapsync</b> software is a command line tool that allows incremental and
@ -82,9 +84,9 @@ for <b>bidirectionnal (2 ways) synchronizations</b>.
<h2><a id="NUMBERS"></a>Facts and figures for 2011 and 2012</h2> <h2><a id="NUMBERS"></a>Facts and figures for 2011 and 2012</h2>
<ul> <ul>
<li><b>3000 to 4000 </b>users per month (34000 users a year)</li> <li><b>4000 to 5000 </b>users per month (34000 users a year)</li>
<li><b>5 to 25 millions mailboxes </b>transfers per month, <li><b>6 to 25 millions mailboxes </b>transfers per month,
total is 93 millions for 2011, 91 millions for 2012.</li> total is 93 millions for 2011, 91 millions for 2012.</li>
<li><b>Operating systems</b> run by imapsync users: <li><b>Operating systems</b> run by imapsync users:
@ -115,7 +117,7 @@ total is 93 millions for 2011, 91 millions for 2012.</li>
<!-- <!--
<ul> <ul>
<li><b>1.536</b></li> <li><b>1.547</b></li>
<li><b>Enhancement</b>: </li> <li><b>Enhancement</b>: </li>
<li><b>Enhancement</b>: </li> <li><b>Enhancement</b>: </li>
<li><b>Enhancement</b>: </li> <li><b>Enhancement</b>: </li>
@ -135,8 +137,20 @@ total is 93 millions for 2011, 91 millions for 2012.</li>
</ul> </ul>
--> -->
<ul> <ul>
<li><b>1.542</b></li> <li><b>1.547</b> Nothing important except imapsync.exe supports also XOAUTH.</li>
<li><b>Enhancement</b>: DBOX 2.41 success</li>
<li><b>Enhancement</b>: Kerio 8 success</li>
<li><b>Usability</b>: SSL_verify_mode 0 to avoid warning about Man-In-The-Middle.</li>
<li><b>Usability</b>: Added message "copying message ..." in dry mode.</li>
<li><b>Bug fix</b>: Applied patch from Jim Klimov to handle proxyauth failures</li>
<li><b>Bug fix</b>: Fixed binary previous imapsync.exe 1.542 bug with ssl</li>
<li><b>Refactoring</b>: Removed sub myconnect() RawSocket2() Split() (Hi Phil!)</li>
</ul>
<ul>
<li><b>1.542</b> XOAUTH supported! (Admin Gmail authentication)</li>
<li><b>Enhancement</b>: Added XOAUTH authentication. Thanks to Eduardo Bortoluzzi Junior.</li> <li><b>Enhancement</b>: Added XOAUTH authentication. Thanks to Eduardo Bortoluzzi Junior.</li>
<li><b>Refactoring</b>: Removed old 2.2.9 Mail::IMAPClient patch stuff.</li> <li><b>Refactoring</b>: Removed old 2.2.9 Mail::IMAPClient patch stuff.</li>
<li><b>Refactoring</b>: Started perlcritic corrections. Left 4 eval at level 5.</li> <li><b>Refactoring</b>: Started perlcritic corrections. Left 4 eval at level 5.</li>
@ -588,7 +602,7 @@ I like it.
</ul> </ul>
<p>Now the long reported <b>success stories</b> list: <b> <p>Now the long reported <b>success stories</b> list: <b>
52 different imap server softwares supported!</b><br/> 53 different imap server softwares supported!</b><br/>
[host1] means "source server" and [host2] means "destination server": [host1] means "source server" and [host2] means "destination server":
</p> </p>
@ -618,6 +632,7 @@ I like it.
<li>David Tobit V8. (<a href="http://www.tobit.com/">http://www.tobit.com/</a>) </li> <li>David Tobit V8. (<a href="http://www.tobit.com/">http://www.tobit.com/</a>) </li>
<li>DBMail 1.2.1, 2.0.4, 2.0.9, 2.2rc1 (GPL). <li>DBMail 1.2.1, 2.0.4, 2.0.9, 2.2rc1 (GPL).
2.0.7 seems buggy. (<a href="http://www.dbmail.org/">http://www.dbmail.org/</a>) </li> 2.0.7 seems buggy. (<a href="http://www.dbmail.org/">http://www.dbmail.org/</a>) </li>
<li>DBOX 2.41 System [host1] (<a href="http://www.dbox.handshake.de/">http://www.dbox.handshake.de/</a>).</li>
<li>Deerfield VisNetic MailServer 5.8.6 [host1] <li>Deerfield VisNetic MailServer 5.8.6 [host1]
(<a href="http://www.deerfield.net/products/visnetic-mailserver/">http://www.deerfield.net/products/visnetic-mailserver/</a>) </li> (<a href="http://www.deerfield.net/products/visnetic-mailserver/">http://www.deerfield.net/products/visnetic-mailserver/</a>) </li>
<li>dkimap4 [host1] (<a href=""></a>) </li> <li>dkimap4 [host1] (<a href=""></a>) </li>
@ -743,7 +758,7 @@ alt="Viewable With Any Browser" />
<!--#config timefmt="%D" --> <!--#config timefmt="%D" -->
<!--#config timefmt="%A %B %d, %Y" --> <!--#config timefmt="%A %B %d, %Y" -->
<b>This document last modified on <!--#echo var="LAST_MODIFIED" --></b> <b>This document last modified on <!--#echo var="LAST_MODIFIED" --></b>
($Id: index.shtml,v 1.162 2013/05/14 07:46:14 gilles Exp gilles $) ($Id: index.shtml,v 1.169 2013/07/03 02:13:03 gilles Exp gilles $)
</p> </p>
</body> </body>

View file

@ -1,20 +1,103 @@
Expression form of "eval" at line 705, column 2. See page 161 of PBP. (Severity: 5) Pragma "constant" used at line 570, column 1. See page 55 of PBP. (Severity: 4)
Expression form of "eval" at line 1781, column 7. See page 161 of PBP. (Severity: 5) Subroutine "EX_USAGE" does not end with "return" at line 709, column 9. See page 197 of PBP. (Severity: 4)
Expression form of "eval" at line 1783, column 9. See page 161 of PBP. (Severity: 5) Magic variable "$SIG" should be assigned as "local" at line 719, column 13. See pages 81,82 of PBP. (Severity: 4)
"return" statement with explicit "undef" at line 1875, column 3. See page 199 of PBP. (Severity: 5) Mixed high and low-precedence booleans at line 838, column 6. See page 70 of PBP. (Severity: 4)
Subroutine prototypes used at line 2112, column 1. See page 194 of PBP. (Severity: 5) Mixed high and low-precedence booleans at line 843, column 6. See page 70 of PBP. (Severity: 4)
Subroutine prototypes used at line 2122, column 1. See page 194 of PBP. (Severity: 5) Expression form of "grep" at line 1041, column 26. See page 169 of PBP. (Severity: 4)
Bareword file handle opened at line 2234, column 2. See pages 202,204 of PBP. (Severity: 5) Expression form of "grep" at line 1050, column 26. See page 169 of PBP. (Severity: 4)
Two-argument "open" used at line 2234, column 2. See page 207 of PBP. (Severity: 5) Expression form of "map" at line 1129, column 28. See page 169 of PBP. (Severity: 4)
"return" statement with explicit "undef" at line 2236, column 3. See page 199 of PBP. (Severity: 5) Expression form of "map" at line 1130, column 28. See page 169 of PBP. (Severity: 4)
Expression form of "eval" at line 2619, column 3. See page 161 of PBP. (Severity: 5) Expression form of "map" at line 1134, column 3. See page 169 of PBP. (Severity: 4)
Expression form of "eval" at line 2813, column 3. See page 161 of PBP. (Severity: 5) Expression form of "map" at line 1141, column 3. See page 169 of PBP. (Severity: 4)
"return" statement with explicit "undef" at line 2965, column 17. See page 199 of PBP. (Severity: 5) Mixed high and low-precedence booleans at line 1192, column 6. See page 70 of PBP. (Severity: 4)
Expression form of "eval" at line 3788, column 3. See page 161 of PBP. (Severity: 5) Subroutine "sync_flags" does not end with "return" at line 1625, column 1. See page 197 of PBP. (Severity: 4)
Bareword file handle opened at line 4144, column 9. See pages 202,204 of PBP. (Severity: 5) Mixed high and low-precedence booleans at line 1659, column 7. See page 70 of PBP. (Severity: 4)
Two-argument "open" used at line 4144, column 9. See page 207 of PBP. (Severity: 5) Mixed high and low-precedence booleans at line 1694, column 14. See page 70 of PBP. (Severity: 4)
Bareword file handle opened at line 4155, column 2. See pages 202,204 of PBP. (Severity: 5) Always unpack @_ first at line 1724, column 1. See page 178 of PBP. (Severity: 4)
Two-argument "open" used at line 4155, column 2. See page 207 of PBP. (Severity: 5) Subroutine "tests_max" does not end with "return" at line 1730, column 1. See page 197 of PBP. (Severity: 4)
Stricture disabled at line 4265, column 4. See page 429 of PBP. (Severity: 5) Subroutine "tests_command_line_nopassword" does not end with "return" at line 1840, column 1. See page 197 of PBP. (Severity: 4)
Expression form of "eval" at line 4828, column 43. See page 161 of PBP. (Severity: 5) Subroutine "catch_exit" does not end with "return" at line 1869, column 1. See page 197 of PBP. (Severity: 4)
Expression form of "eval" at line 4832, column 45. See page 161 of PBP. (Severity: 5) Subroutine "catch_continue" does not end with "return" at line 1876, column 1. See page 197 of PBP. (Severity: 4)
Subroutine "justconnect" does not end with "return" at line 1901, column 1. See page 197 of PBP. (Severity: 4)
Subroutine "relogin1" does not end with "return" at line 1916, column 1. See page 197 of PBP. (Severity: 4)
Subroutine "relogin2" does not end with "return" at line 1927, column 1. See page 197 of PBP. (Severity: 4)
Subroutine "banner_imapsync" does not end with "return" at line 2153, column 1. See page 197 of PBP. (Severity: 4)
Always unpack @_ first at line 2206, column 1. See page 178 of PBP. (Severity: 4)
Subroutine "missing_option" does not end with "return" at line 2211, column 1. See page 197 of PBP. (Severity: 4)
Subroutine "tests_folder_routines" does not end with "return" at line 2276, column 1. See page 197 of PBP. (Severity: 4)
Subroutine "is_requested_folder" does not end with "return" at line 2292, column 1. See page 197 of PBP. (Severity: 4)
Subroutine "tests_compare_lists" does not end with "return" at line 2351, column 1. See page 197 of PBP. (Severity: 4)
Subroutine "get_prefix" does not end with "return" at line 2402, column 1. See page 197 of PBP. (Severity: 4)
Subroutine "get_separator" does not end with "return" at line 2428, column 1. See page 197 of PBP. (Severity: 4)
Always unpack @_ first at line 2491, column 1. See page 178 of PBP. (Severity: 4)
Subroutine "tests_imap2_folder_name" does not end with "return" at line 2506, column 1. See page 197 of PBP. (Severity: 4)
Always unpack @_ first at line 2558, column 1. See page 178 of PBP. (Severity: 4)
Expression form of "eval" at line 2574, column 3. See page 161 of PBP. (Severity: 5)
Subroutine "tests_decompose_regex" does not end with "return" at line 2581, column 1. See page 197 of PBP. (Severity: 4)
Mixed high and low-precedence booleans at line 2613, column 22. See page 70 of PBP. (Severity: 4)
Mixed high and low-precedence booleans at line 2617, column 22. See page 70 of PBP. (Severity: 4)
Subroutine "tests_flags_regex" does not end with "return" at line 2680, column 1. See page 197 of PBP. (Severity: 4)
Expression form of "eval" at line 2787, column 3. See page 161 of PBP. (Severity: 5)
Subroutine "acls_sync" does not end with "return" at line 2794, column 1. See page 197 of PBP. (Severity: 4)
Subroutine "tests_permanentflags" does not end with "return" at line 2817, column 1. See page 197 of PBP. (Severity: 4)
Subroutine "permanentflags" does not end with "return" at line 2833, column 1. See page 197 of PBP. (Severity: 4)
Subroutine "tests_flags_filter" does not end with "return" at line 2848, column 1. See page 197 of PBP. (Severity: 4)
Subroutine "tests_flagsCase" does not end with "return" at line 2885, column 1. See page 197 of PBP. (Severity: 4)
Subroutine "tests_ucsecond" does not end with "return" at line 2908, column 1. See page 197 of PBP. (Severity: 4)
Mixed high and low-precedence booleans at line 2928, column 14. See page 70 of PBP. (Severity: 4)
Mixed high and low-precedence booleans at line 2945, column 22. See page 70 of PBP. (Severity: 4)
Warnings disabled at line 3124, column 4. See page 431 of PBP. (Severity: 4)
Always unpack @_ first at line 3177, column 1. See page 178 of PBP. (Severity: 4)
Subroutine "tests_time_remaining" does not end with "return" at line 3199, column 1. See page 197 of PBP. (Severity: 4)
Subroutine "tests_cache_map" does not end with "return" at line 3250, column 1. See page 197 of PBP. (Severity: 4)
Subroutine "tests_cache_dir_fix" does not end with "return" at line 3294, column 1. See page 197 of PBP. (Severity: 4)
Always unpack @_ first at line 3302, column 1. See page 178 of PBP. (Severity: 4)
Subroutine "tests_get_cache" does not end with "return" at line 3332, column 1. See page 197 of PBP. (Severity: 4)
Mixed high and low-precedence booleans at line 3335, column 8. See page 70 of PBP. (Severity: 4)
Mixed high and low-precedence booleans at line 3384, column 8. See page 70 of PBP. (Severity: 4)
Subroutine "tests_match_a_cache_file" does not end with "return" at line 3433, column 1. See page 197 of PBP. (Severity: 4)
Mixed high and low-precedence booleans at line 3475, column 3. See page 70 of PBP. (Severity: 4)
Subroutine "tests_clean_cache" does not end with "return" at line 3492, column 1. See page 197 of PBP. (Severity: 4)
Mixed high and low-precedence booleans at line 3494, column 8. See page 70 of PBP. (Severity: 4)
Subroutine "tests_clean_cache_2" does not end with "return" at line 3542, column 1. See page 197 of PBP. (Severity: 4)
Mixed high and low-precedence booleans at line 3544, column 8. See page 70 of PBP. (Severity: 4)
Subroutine "tests_mkpath" does not end with "return" at line 3598, column 1. See page 197 of PBP. (Severity: 4)
Subroutine "tests_touch" does not end with "return" at line 3606, column 1. See page 197 of PBP. (Severity: 4)
Subroutine "new" called using indirect syntax at line 3623, column 13. See page 349 of PBP. (Severity: 4)
Subroutine "tests_cache_folder" does not end with "return" at line 3634, column 1. See page 197 of PBP. (Severity: 4)
Subroutine "tests_filter_forbidden_characters" does not end with "return" at line 3664, column 1. See page 197 of PBP. (Severity: 4)
Subroutine "tests_convert_sep_to_slash" does not end with "return" at line 3681, column 1. See page 197 of PBP. (Severity: 4)
Subroutine "tests_regexmess" does not end with "return" at line 3693, column 1. See page 197 of PBP. (Severity: 4)
Expression form of "eval" at line 3762, column 3. See page 161 of PBP. (Severity: 5)
Subroutine "stats" does not end with "return" at line 3785, column 1. See page 197 of PBP. (Severity: 4)
Subroutine "get_options" does not end with "return" at line 3853, column 1. See page 197 of PBP. (Severity: 4)
Mixed high and low-precedence booleans at line 4005, column 30. See page 70 of PBP. (Severity: 4)
Subroutine "load_modules" does not end with "return" at line 4013, column 1. See page 197 of PBP. (Severity: 4)
Subroutine "parse_header_msg" does not end with "return" at line 4033, column 1. See page 197 of PBP. (Severity: 4)
Mixed high and low-precedence booleans at line 4058, column 27. See page 70 of PBP. (Severity: 4)
Subroutine "string_to_file" does not end with "return" at line 4142, column 1. See page 197 of PBP. (Severity: 4)
Subroutine "tests_is_a_release_number" does not end with "return" at line 4149, column 1. See page 197 of PBP. (Severity: 4)
Subroutine "is_a_release_number" does not end with "return" at line 4157, column 1. See page 197 of PBP. (Severity: 4)
Subroutine "tests_imapsync_basename" does not end with "return" at line 4187, column 1. See page 197 of PBP. (Severity: 4)
Subroutine "new" called using indirect syntax at line 4207, column 13. See page 349 of PBP. (Severity: 4)
Subroutine "usage" does not end with "return" at line 4281, column 1. See page 197 of PBP. (Severity: 4)
Subroutine "usage_complete" does not end with "return" at line 4495, column 1. See page 197 of PBP. (Severity: 4)
Always unpack @_ first at line 4524, column 1. See page 178 of PBP. (Severity: 4)
Subroutine "memory_consumption_of_pids" does not end with "return" at line 4524, column 1. See page 197 of PBP. (Severity: 4)
Subroutine "tests_remove_not_num" does not end with "return" at line 4581, column 1. See page 197 of PBP. (Severity: 4)
Subroutine "tests_memory_consumption" does not end with "return" at line 4615, column 1. See page 197 of PBP. (Severity: 4)
Subroutine "tests_good_date" does not end with "return" at line 4731, column 1. See page 197 of PBP. (Severity: 4)
Subroutine "tests_list_keys_in_2_not_in_1" does not end with "return" at line 4764, column 1. See page 197 of PBP. (Severity: 4)
Subroutine "delete_folders_in_2_not_in_1" does not end with "return" at line 4801, column 1. See page 197 of PBP. (Severity: 4)
Expression form of "eval" at line 4806, column 43. See page 161 of PBP. (Severity: 5)
Expression form of "eval" at line 4810, column 45. See page 161 of PBP. (Severity: 5)
Subroutine "tests_extract_header" does not end with "return" at line 4834, column 1. See page 197 of PBP. (Severity: 4)
Subroutine "tests_decompose_header" does not end with "return" at line 4879, column 1. See page 197 of PBP. (Severity: 4)
Subroutine "tests_epoch" does not end with "return" at line 4991, column 1. See page 197 of PBP. (Severity: 4)
Subroutine "tests_add_header" does not end with "return" at line 5005, column 1. See page 197 of PBP. (Severity: 4)
Subroutine "tests_debug" does not end with "return" at line 5012, column 1. See page 197 of PBP. (Severity: 4)
Subroutine "tests" does not end with "return" at line 5020, column 1. See page 197 of PBP. (Severity: 4)
Always unpack @_ first at line 5065, column 1. See page 178 of PBP. (Severity: 4)
Always unpack @_ first at line 5072, column 1. See page 178 of PBP. (Severity: 4)
Always unpack @_ first at line 5080, column 1. See page 178 of PBP. (Severity: 4)
Subroutine "capability_update" does not end with "return" at line 5087, column 1. See page 197 of PBP. (Severity: 4)

View file

@ -1,9 +1,9 @@
#!/bin/sh #!/bin/sh
# $Id: tests.sh,v 1.218 2013/05/06 08:36:38 gilles Exp gilles $ # $Id: tests.sh,v 1.219 2013/07/03 04:12:34 gilles Exp gilles $
# Example 1: # Example 1:
# CMD_PERL='perl -I./Mail-IMAPClient-3.32/lib' sh -x tests.sh # CMD_PERL='perl -I./Mail-IMAPClient-3.33/lib' sh -x tests.sh
# Example 2: # Example 2:
# To select which Mail-IMAPClient within arguments: # To select which Mail-IMAPClient within arguments:
@ -23,7 +23,7 @@ echo HOST2=$HOST2
# few debugging tests use: # few debugging tests use:
CMD_PERL_2xx='perl -I./W/Mail-IMAPClient-2.2.9' CMD_PERL_2xx='perl -I./W/Mail-IMAPClient-2.2.9'
CMD_PERL_3xx='perl -I./W/Mail-IMAPClient-3.32/lib' CMD_PERL_3xx='perl -I./W/Mail-IMAPClient-3.33/lib'
CMD_PERL=${CMD_PERL:-$CMD_PERL_3xx} CMD_PERL=${CMD_PERL:-$CMD_PERL_3xx}
@ -1608,7 +1608,7 @@ ll_tls_justconnect() {
--host1 $HOST1 \ --host1 $HOST1 \
--host2 $HOST2 \ --host2 $HOST2 \
--tls1 --tls2 \ --tls1 --tls2 \
--justconnect --debug --justconnect --debugimap
} }
ll_tls_justlogin() { ll_tls_justlogin() {
@ -1618,14 +1618,13 @@ ll_tls_justlogin() {
--host2 $HOST2 --user2 titi \ --host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \ --passfile2 ../../var/pass/secret.titi \
--tls1 --tls2 \ --tls1 --tls2 \
--justlogin --debug --justlogin --debugimap
} }
ll_tls_devel() { ll_tls_devel() {
CMD_PERL=$CMD_PERL_3xx ll_justlogin ll_ssl_justlogin \ ll_justlogin ll_ssl_justlogin \
&& CMD_PERL=$CMD_PERL_3xx ll_tls_justconnect ll_tls_justlogin && ll_tls_justconnect ll_tls_justlogin
} }
ll_tls() { ll_tls() {
@ -1638,7 +1637,6 @@ ll_tls() {
} }
ll_ssl_justconnect() { ll_ssl_justconnect() {
$CMD_PERL ./imapsync \ $CMD_PERL ./imapsync \
--host1 $HOST1 \ --host1 $HOST1 \
@ -1647,6 +1645,21 @@ ll_ssl_justconnect() {
--justconnect --justconnect
} }
ll_ssl_tls_justconnect() {
$CMD_PERL ./imapsync \
--host1 $HOST1 \
--host2 $HOST2 \
--ssl1 --tls1 --ssl2 --tls2 \
--justconnect --debugimap
}
ll_justconnect_devel() {
ll_justconnect && ll_tls_justconnect && ll_ssl_justconnect && ll_ssl_tls_justconnect
}
ll_ssl_justlogin() { ll_ssl_justlogin() {
$CMD_PERL ./imapsync \ $CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \ --host1 $HOST1 --user1 tata \
@ -1663,10 +1676,14 @@ ll_ssl_tls_justlogin() {
--passfile1 ../../var/pass/secret.tata \ --passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \ --host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \ --passfile2 ../../var/pass/secret.titi \
--tls1 --ssl2 --tls2 \ --ssl1 --tls1 --ssl2 --tls2 \
--justlogin --debug --justlogin --debug
} }
ll_justlogin_devel() {
ll_justlogin && ll_ssl_justlogin && ll_tls_justlogin && ll_ssl_tls_justlogin
}
ll_ssl() { ll_ssl() {
if can_send; then if can_send; then
#echo3 Here is plume #echo3 Here is plume