This commit is contained in:
Nick Bebout 2011-03-12 02:45:06 +00:00
parent d88bf4b46a
commit 02322d6ed1
73 changed files with 19532 additions and 23747 deletions

15
CREDITS
View file

@ -1,5 +1,5 @@
#!/bin/cat
# $Id: CREDITS,v 1.154 2011/01/18 01:52:25 gilles Exp gilles $
# $Id: CREDITS,v 1.155 2011/01/23 23:39:54 gilles Exp gilles $
If you want to make a donation to the author, Gilles LAMIRAL,
use any of the following ways:
@ -30,6 +30,14 @@ 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.
Timothy Jay Chambers
Contributed by giving the book
27.32 "Mathematics and Plausible Reasoning: Volume II Patterns of Plausible Inference"
D.R. Crane
Contributed by giving the book
40.90 "Working Effectively with Legacy Code"
Daniel Melnechuk
Contributed by giving the book
10.02 "The Design of Everyday Things"
@ -973,6 +981,9 @@ Eric Yung
Total amount of book prices :
c \
27.32+\
40.90+\
\
10.02+\
\
17.95+\
@ -1091,4 +1102,4 @@ c \
31.20+\
40.00
=
2710.81
2779.03

View file

@ -1,17 +1,45 @@
RCS file: RCS/imapsync,v
Working file: imapsync
head: 1.398
head: 1.404
branch:
locks: strict
gilles: 1.398
gilles: 1.404
access list:
symbolic names:
keyword substitution: kv
total revisions: 398; selected revisions: 398
total revisions: 404; selected revisions: 404
description:
----------------------------
revision 1.398 locked by: gilles;
revision 1.404 locked by: gilles;
date: 2011/02/21 03:35:39; author: gilles; state: Exp; lines: +7 -7
typo
----------------------------
revision 1.403
date: 2011/02/21 00:52:16; author: gilles; state: Exp; lines: +47 -7
Added uid guessing with APPEND to improve --usecache for Exchange or Zarafa imap servers.
----------------------------
revision 1.402
date: 2011/01/25 05:17:05; author: gilles; state: Exp; lines: +47 -174
Removed all the $imapX->IsUnconnected() since reconnect can be done.
Overrided append_file() for 2.2.9, copy from 3.25
----------------------------
revision 1.401
date: 2011/01/25 02:22:37; author: gilles; state: Exp; lines: +195 -151
Added --useuid to speed up or deal with problems using headers.
Added --notakebody to avoid getting first 2Ko body when got "no header"
Replaced --debug_cache by --debugcache
----------------------------
revision 1.400
date: 2011/01/22 04:46:04; author: gilles; state: Exp; lines: +94 -22
Fixed cache (chose only the greatest uid with dupplicate 11_21+11_201 or 11_21+101_21)
Fixed cache, dealing with filenames containing \ characters.
----------------------------
revision 1.399
date: 2011/01/21 00:04:09; author: gilles; state: Exp; lines: +29 -21
Added --debug_cache option to alow cache dfebugging only.
----------------------------
revision 1.398
date: 2011/01/18 03:03:24; author: gilles; state: Exp; lines: +7 -6
Fix. Removed too much about buffersize.
----------------------------

20
FAQ
View file

@ -1,5 +1,5 @@
#!/bin/cat
# $Id: FAQ,v 1.82 2011/01/15 06:32:12 gilles Exp gilles $
# $Id: FAQ,v 1.83 2011/01/28 05:14:12 gilles Exp gilles $
+------------------+
| FAQ for imapsync |
@ -447,6 +447,24 @@ R. try to transfer the mails without SSL connection. SSL code outside
(Written by Stefan Schmidt)
======================================================================
Q. What are --subscribe and --subscribed for, and how can they be used?
R. In the IMAP protocol each user can subscribe to one or more folders.
Then he can configure its email software to just see his subscribed
folders list. That's an IMAP feature.
Knowing that, the imapsync help says:
imapsync --help
...
--subscribed : transfers subscribed folders.
--subscribe : subscribe to the folders transferred on the
host2 that are subscribed on host1.
--subscribe_all : subscribe to the folders transferred on the
host2 even if they are not subscribed on host1.
======================================================================
Q. I want to exclude a folder hierarchy like "public"

View file

@ -1,401 +0,0 @@
COPYRIGHT
Copyright 1999, 2000, 2001, 2002 , 2003 The Kernen Group, Inc.
All rights reserved.
This program is free software; you can redistribute it and/or modify it
under the terms of either:
a) the "Artistic License" which comes with this Kit, or
b) the GNU General Public License as published by the Free Software
Foundation; either version 1, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See either the GNU
General Public License or the Artistic License for more details. All your
base are belong to us.
=============
The "Artistic License"
Preamble
The intent of this document is to state the conditions under which a
Package may be copied, such that the Copyright Holder maintains some
semblance of artistic control over the development of the package,
while giving the users of the package the right to use and distribute
the Package in a more-or-less customary fashion, plus the right to make
reasonable modifications.
Definitions:
"Package" refers to the collection of files distributed by the
Copyright Holder, and derivatives of that collection of files
created through textual modification.
"Standard Version" refers to such a Package if it has not been
modified, or has been modified in accordance with the wishes
of the Copyright Holder as specified below.
"Copyright Holder" is whoever is named in the copyright or
copyrights for the package.
"You" is you, if you're thinking about copying or distributing
this Package.
"Reasonable copying fee" is whatever you can justify on the
basis of media cost, duplication charges, time of people involved,
and so on. (You will not be required to justify it to the
Copyright Holder, but only to the computing community at large
as a market that must bear the fee.)
"Freely Available" means that no fee is charged for the item
itself, though there may be fees involved in handling the item.
It also means that recipients of the item may redistribute it
under the same conditions they received it.
1. You may make and give away verbatim copies of the source form of the
Standard Version of this Package without restriction, provided that you
duplicate all of the original copyright notices and associated disclaimers.
2. You may apply bug fixes, portability fixes and other modifications
derived from the Public Domain or from the Copyright Holder. A Package
modified in such a way shall still be considered the Standard Version.
3. You may otherwise modify your copy of this Package in any way, provided
that you insert a prominent notice in each changed file stating how and
when you changed that file, and provided that you do at least ONE of the
following:
a) place your modifications in the Public Domain or otherwise make them
Freely Available, such as by posting said modifications to Usenet or
an equivalent medium, or placing the modifications on a major archive
site such as uunet.uu.net, or by allowing the Copyright Holder to include
your modifications in the Standard Version of the Package.
b) use the modified Package only within your corporation or organization.
c) rename any non-standard executables so the names do not conflict
with standard executables, which must also be provided, and provide
a separate manual page for each non-standard executable that clearly
documents how it differs from the Standard Version.
d) make other distribution arrangements with the Copyright Holder.
4. You may distribute the programs of this Package in object code or
executable form, provided that you do at least ONE of the following:
a) distribute a Standard Version of the executables and library files,
together with instructions (in the manual page or equivalent) on where
to get the Standard Version.
b) accompany the distribution with the machine-readable source of
the Package with your modifications.
c) give non-standard executables non-standard names, and clearly
document the differences in manual pages (or equivalent), together
with instructions on where to get the Standard Version.
d) make other distribution arrangements with the Copyright Holder.
5. You may charge a reasonable copying fee for any distribution of this
Package. You may charge any fee you choose for support of this
Package. You may not charge a fee for this Package itself. However,
you may distribute this Package in aggregate with other (possibly
commercial) programs as part of a larger (possibly commercial) software
distribution provided that you do not advertise this Package as a
product of your own. You may embed this Package's interpreter within
an executable of yours (by linking); this shall be construed as a mere
form of aggregation, provided that the complete Standard Version of the
interpreter is so embedded.
6. The scripts and library files supplied as input to or produced as
output from the programs of this Package do not automatically fall
under the copyright of this Package, but belong to whoever generated
them, and may be sold commercially, and may be aggregated with this
Package. If such scripts or library files are aggregated with this
Package via the so-called "undump" or "unexec" methods of producing a
binary executable image, then distribution of such an image shall
neither be construed as a distribution of this Package nor shall it
fall under the restrictions of Paragraphs 3 and 4, provided that you do
not represent such an executable image as a Standard Version of this
Package.
7. C subroutines (or comparably compiled subroutines in other
languages) supplied by you and linked into this Package in order to
emulate subroutines and variables of the language defined by this
Package shall not be considered part of this Package, but are the
equivalent of input as in Paragraph 6, provided these subroutines do
not change the language in any way that would cause it to fail the
regression tests for the language.
8. Aggregation of this Package with a commercial distribution is always
permitted provided that the use of this Package is embedded; that is,
when no overt attempt is made to make this Package's interfaces visible
to the end user of the commercial distribution. Such use shall not be
construed as a distribution of this Package.
9. The name of the Copyright Holder may not be used to endorse or promote
products derived from this software without specific prior written permission.
10. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
The End
=============
GNU GENERAL PUBLIC LICENSE
Version 1, February 1989
Copyright (C) 1989 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The license agreements of most software companies try to keep users
at the mercy of those companies. By contrast, our General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. The
General Public License applies to the Free Software Foundation's
software and to any other program whose authors commit to using it.
You can use it for your programs, too.
When we speak of free software, we are referring to freedom, not
price. Specifically, the General Public License is designed to make
sure that you have the freedom to give away or sell copies of free
software, that you receive source code or can get it if you want it,
that you can change the software or use pieces of it in new free
programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of a such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must tell them their rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any program or other work which
contains a notice placed by the copyright holder saying it may be
distributed under the terms of this General Public License. The
"Program", below, refers to any such program or work, and a "work based
on the Program" means either the Program or any work containing the
Program or a portion of it, either verbatim or with modifications. Each
licensee is addressed as "you".
1. You may copy and distribute verbatim copies of the Program's source
code as you receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice and
disclaimer of warranty; keep intact all the notices that refer to this
General Public License and to the absence of any warranty; and give any
other recipients of the Program a copy of this General Public License
along with the Program. You may charge a fee for the physical act of
transferring a copy.
2. You may modify your copy or copies of the Program or any portion of
it, and copy and distribute such modifications under the terms of Paragraph
1 above, provided that you also do the following:
a) cause the modified files to carry prominent notices stating that
you changed the files and the date of any change; and
b) cause the whole of any work that you distribute or publish, that
in whole or in part contains the Program or any part thereof, either
with or without modifications, to be licensed at no charge to all
third parties under the terms of this General Public License (except
that you may choose to grant warranty protection to some or all
third parties, at your option).
c) If the modified program normally reads commands interactively when
run, you must cause it, when started running for such interactive use
in the simplest and most usual way, to print or display an
announcement including an appropriate copyright notice and a notice
that there is no warranty (or else, saying that you provide a
warranty) and that users may redistribute the program under these
conditions, and telling the user how to view a copy of this General
Public License.
d) You may charge a fee for the physical act of transferring a
copy, and you may at your option offer warranty protection in
exchange for a fee.
Mere aggregation of another independent work with the Program (or its
derivative) on a volume of a storage or distribution medium does not bring
the other work under the scope of these terms.
3. You may copy and distribute the Program (or a portion or derivative of
it, under Paragraph 2) in object code or executable form under the terms of
Paragraphs 1 and 2 above provided that you also do one of the following:
a) accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of
Paragraphs 1 and 2 above; or,
b) accompany it with a written offer, valid for at least three
years, to give any third party free (except for a nominal charge
for the cost of distribution) a complete machine-readable copy of the
corresponding source code, to be distributed under the terms of
Paragraphs 1 and 2 above; or,
c) accompany it with the information you received as to where the
corresponding source code may be obtained. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form alone.)
Source code for a work means the preferred form of the work for making
modifications to it. For an executable file, complete source code means
all the source code for all modules it contains; but, as a special
exception, it need not include source code for modules which are standard
libraries that accompany the operating system on which the executable
file runs, or for standard header files or definitions files that
accompany that operating system.
4. You may not copy, modify, sublicense, distribute or transfer the
Program except as expressly provided under this General Public License.
Any attempt otherwise to copy, modify, sublicense, distribute or transfer
the Program is void, and will automatically terminate your rights to use
the Program under this License. However, parties who have received
copies, or rights to use copies, from you under this General Public
License will not have their licenses terminated so long as such parties
remain in full compliance.
5. By copying, distributing or modifying the Program (or any work based
on the Program) you indicate your acceptance of this license to do so,
and all its terms and conditions.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the original
licensor to copy, distribute or modify the Program subject to these
terms and conditions. You may not impose any further restrictions on the
recipients' exercise of the rights granted herein.
7. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of the license which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
the license, you may choose any version ever published by the Free Software
Foundation.
8. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
9. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
10. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
Appendix: How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to humanity, the best way to achieve this is to make it
free software which everyone can redistribute and change under these
terms.
To do so, attach the following notices to the program. It is safest to
attach them to the start of each source file to most effectively convey
the exclusion of warranty; and each file should have at least the
"copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) 19yy <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 1, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) 19xx name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the
appropriate parts of the General Public License. Of course, the
commands you use may be called something other than `show w' and `show
c'; they could even be mouse-clicks or menu items--whatever suits your
program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the
program `Gnomovision' (a program to direct compilers to make passes
at assemblers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
That's all there is to it!

View file

@ -1,82 +0,0 @@
Mail::IMAPClient Installation
The Mail::IMAPClient is written entirely in Perl, so it should install
on any reasonably recent version of Perl. See the README file for a perl
one-liner that you can run to verify that your perl has what it takes
to run Mail::IMAPClient.
The installation is standard:
0) cd to installation directory
1) perl Makefile.PL (and reply to the prompts)
2) make (optional)
3) make test (optional)
4) make install
The 'make install' and 'make test' will both do step 2 ('make') if you
haven't done it already. Currently the test script is lame (although
not as lame as in the last release!) but I hope to incorporate more
thorough testing in a future version. You should at least try it and
let me know if your tests fail.
Version 1.0 changed the installation script so that it reuses the
parameter file for the tests if it finds one. Installation can be run in
the background if the test.txt file exists. Touching it is good enough
to prevent prompts; having a correctly formatted version (as shown in
test_template.txt) is even better, as it will allow you to do a thorough
'make test'. Invalid data in test.txt (either from precreating it or from
responding inaccurately to prompts) will cause 'make test' to report 'not
ok' results but won't break anything important (like the IMAPClient.pm
file, or your car).
If you have tests that fail it may be more illuminating to run the
tests by hand. IE: perl -I./blib/lib t/basic.t from the installation
dir will pinpoint the failing test. Better yet, supply an argument to
basic/t (any 'true' argument will do; I use '1') to turn on debugging,
which will be placed in your installation directory in 'imap1.debug'
and 'imap2.debug'. E-mail me the results.
If you don't have a test.txt file in your installation directory then you
will have to answer at least one prompt. If you do have a test.txt file,
and you run 'make clean', then you won't have a test.txt file anymore,
so take precautions.
If you do have a test.txt file and you don't run 'make clean' then
a text file will be sitting around containing logon credentials, so,
again, take precautions. (It's just a test account anyway, right?)
If, when replying to the "perl Makefile.PL" prompts, you supply server,
id, and password credentials for an id that has a ridiculously huge number
of folders and subfolders then the 'make test' may run approximately
forever. Next time try an id with less stuff.
For examples on using Mail::IMAPClient, check out the examples
subdirectory. If you have better examples, then why haven't you e-mailed
them to me? Also, I totally recommend that you have a copy of RFC2060
handy when using this module, since the documentation for this module is
meant to compliment, not replace, RFC2060. In fact, I am so convinced that
you'll need the RFC that I've included a copy of it in the distribution,
under the "docs/" subdirectory. It's a smashing good read so have at
it. Other IMAP related rfcs are there as well.
One of the examples in the examples/ subdirectory is called
cleanTest.pl. If you find your 'make test' has had trouble and left some
folders named "IMAPClient_*" in your test account, you can run this
example to clean up the account. But probably only after you've fixed
any problems encountered with 'make test'!
This module uses Damian Conway's excellent Parse::RecDescent module
for some advanced features. If you don't have that module installed
then you can still install Mail::IMAPClient but you won't have the
full functionality. If you have Parse::RecDescent installed and then
upgrade it, you may find that some features in Mail::IMAPClient suddenly
start throwing compile-time errors. Just 'make clean' and then 'make',
'make test', and 'make install'. This happens because grammers compiled
under older releases of Parse::RecDescent are sometimes incompatible
with newer Parse::RecDescent runtime engines. This would never be a
problem if Mail::IMAPClient recompiled grammers at run time, but for
performance reasons it precompiles them at install time. TANSTAAFL.
Now go and write IMAP clients.
Dave Kernen

View file

@ -1,111 +0,0 @@
Mail::IMAPClient
Copyright 1999-2003 The Kernen Group, Inc.
Copyright 2007 Mark Overmeer
All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of either:
a) the "Artistic License" which comes with this Kit, or
b) the GNU General Public License as published by the Free Software
Foundation; either version 1, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See either
the GNU General Public License or the Artistic License for more details.
DESCRIPTION
This module provides perl routines that simplify a sockets connection
to and an IMAP conversation with an IMAP server.
COMPATIBILITY
[This paragraph has not been updated for many years]
This module was developed on Solaris 2.5.1 and 2.6 against Netscape IMAP
servers versions 3.6 and 4.1. However, since it is written in perl and
designed for flexibility, it should run on any OS with a TCP/IP stack and
a version of perl that includes the Socket and IO::Socket modules. It also
should be able to talk to any IMAP server, even those that have, um,
proprietary features (assuming that the programmer knows what those features
are).
To date, I know that the test suite runs successfully with the following IMAP
servers:
-Netscape Messenging Server v4.x
-Netscape Messenging Server v3.x
-UW-IMAP (I think it was 4.5)
-Cyrus IMAP4 v1.5.19
-Mirapoint Message Server Appliances (OS versions 1.6.1, 1.7.1, and 2.0.2)
Version 2.0.3 has been tested with the mdaemon server with mixed
results. It seems that mdaemon does not comply strictly with RFC2060 and
so you may have problems using this module with mdaemon, especially with
folder names with embedded spaces or embedded double quotes. You may be
able to get some simple tasks to work but you won't be able to run the
test suite successfully. Use with caution.
If your server requires the use of the AUTHENTICATE IMAP client command
(say, for strong authentication) then you can still use this module,
provided you can come up with the appropriate responses to any challenges
offered by your server. Mark Bush's Authen::NTLM module can assist with
this if you specifically are interested in NTLM authentication.
REPORING BUGS
See http://rt.cpan.org/Public/Dist/Display.html?Name=Mail-IMAPClient
INSTALLATION
Generally, gunzipping and untarring the source file, running 'perl
Makefile.PL' and 'make install' are all it takes to install this
module. And if that's too much work you can always use the CPAN module!
OVERVIEW OF FUNCTIONALITY
Mail::IMAPClient.pm provides methods to simplify the connection to and
the conversation between a perl script and an IMAP server. Virtually
all IMAP Client commands (as defined in rfc2060) are supported, either
through IMAPClient object methods or the 'default method', which is an
AUTOLOAD hack that assumes a default syntax for IMAP Client commands of:
tagvalue COMMAND [Arg1 [Arg2 [... Arg3]]]"
By remarkable coincidence, AUTOLOAD's default syntax mimics the
general syntax of IMAP Client commands. This means that if a script
tries to use any undefined method then that method will be interpreted
as an unimplemented IMAP command, and the default syntax will be used
to create the command string. I did this as a short cut to writing a
bunch of methods that were practically the same. There are inheritance
implications because of this approach but as far as I can tell this is
not a serious limitation. However, if you decide to write modules that
inherit from this class that require AUTOLOAD logic of their own then you
will have to take the Mail::IMAPClient's AUTOLOAD strategy into account.
Where methods are defined, they usually exist to add functionality,
perhaps by massaging output or by supplying default arguments. An example
is the search method, which accepts the same arguments as the SEARCH
IMAP Client command (as documented in RFC2060) but which massages the
results so that the return value is an array of message sequence numbers
matching the search criteria, rather than a line of text listing the
sequence numbers.
Some methods exists solely to add functionality, such as the folders
method, which invokes the list method but then massages the results to
produce an array containing all folder names. The message_count and
delete_messsage methods are similarly examples of methods that add
function to "raw" IMAP Client commands.
Further information is provided in the module's documentation, which you are
encouraged to read and enjoy.
Good Luck!
Dave Kernen
The Kernen Group, Inc.
DJKERNEN@cpan.org

View file

@ -1,68 +0,0 @@
=== README
Starting with release 2.99_01, I (Mark Overmeer) try to revive the
module. The original author David Kernen cannot be reached and didn't
release any fixes in four years. That is far too long.
The code and installation procedure has been cleaned-up radically,
and some minimal improvements in the code are made to
fix things people reported.
=== wishlist:
- A start was made in cleanup of the code in Mail/IMAPClient.pm
The file Mail/IMAPClient-cleanup shows the progress (30%)
But I lack the time (a weeks work at least) to complete this
task. There is a lot of code replication to be stripped.
If anyone buys me time, I will complete that task.
=== wishlist from the original author:
The following is a list of some items that I hope to include in a future
release:
- Support for threaded perl programs (still pending as of version 2.2.0.).
- Support for imaps (Imap via SSL). I don't have any way to test this
right now but if you get this to work or know someone who has I'd be
really interested in hearing from you.
- Support for more authentication mechanisms. Currently plain
authentication and cram-md5 authentication are supported. I have
DIGEST-MD5 working at the AUTH qop, but haven't incorporated it into
a released version because I'm still trying to get at least the
integrity qop working, and maybe even privacy, but considering how
much trouble I'm having with just the integrity level I wouldn't
hold my breath if I were you ;-).
- Currently a number of IMAP Client commands are implemented using the
'default method', which is an AUTOLOAD hack. I'd like to reduce that
if possible to a bare minimum. (Some are still pending as of version 2.2.7.)
- I'd like to see this module certified for more OS's and more IMAP servers.
This is (hopefully) just a matter of testing; the code should already
be compatible with the IMAP servers that are out there and with any OS
that allows the IO::Socket module to work. ** A number of platforms
have been added to the list of tested platforms since this was first
written. Please contact DJKernen@cpan.org if you have any to add.
- Support for newer/older/other versions of IMAP. Currently only RFC2060 is
explicitly supported, although thanks to the 'default method'
(implemented via an AUTOLOAD hack) virtually any IMAP command is
supported, even proprietary commands, X- extensions, and so forth. But
not necessarily other authentication mechanisms... :-( (NOTE: the
AUTHENTICATE method partially addresses this issue.)
- Support for piping output from (some?) imap commands directly to a
thingy of some sort (perhaps a coderef, a filehandle, or both).
- Your thingy here!!! Send me your request, and I'll do it in the order of
($popularity/$difficulty ).
- Support for perl version 6. This will probably involve a rewrite that
will make portions of the Mail::IMAPClient module look more like the
Mail::IMAPClient::BodyStructure module. (Perl 6 will have built-in
support for semantics that look remarkably like Damian Conway's
Parse::RecDescent module, which will solve a lot of problems for me.)

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,41 +0,0 @@
#!/usr/bin/perl
use warnings;
use strict;
use Parse::RecDescent 1.94;
use File::Copy qw/move/;
sub read_file {
my $file = shift;
local( $/, *FH );
open( FH, $file ) or return undef;
return <FH>;
}
build_parser 'lib/Mail/IMAPClient/BodyStructure/Parse.grammar'
, 'Mail::IMAPClient::BodyStructure::Parse';
build_parser 'lib/Mail/IMAPClient/Thread.grammar'
, 'Mail::IMAPClient::Thread';
sub build_parser {
my ($grammarfn, $package) = @_;
print "* building $package\n";
my $grammar = read_file $grammarfn
or die "cannot read grammar from $grammarfn: $!\n";
Parse::RecDescent->Precompile($grammar, $package);
# clumpsy output by Parse::RecDescent
my $outfn = $package . '.pm';
$outfn =~ s/.*\:\://;
my $realfn = $grammarfn;
$realfn =~ s/\.\w+$/.pm/;
move $outfn, $realfn
or die "cannot move $outfn to $realfn: $!\n";
}

View file

@ -1 +0,0 @@
&parse_options("NonStop=1 LineInfo=mail_imapclient_db.out");

View file

@ -5,6 +5,74 @@ 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.27: Sun Feb 13 14:37:27 EST 2011
- rt.cpan.org#65694: migrate fails
[Erik Colson]
- rt.cpan.org#65470: uninitialized warning in message_to_file
[Gilles Lamiral, Mark Hedges]
- rt.cpan.org#61835: (DOC) in LIST context undef may be returned
[Stefan Völkel]
+ warn/highlight behavior in docs Errors section
- updated documentation
+ migrate() documentation fixed
+ moved Custom Authentication Mechanisms toward end
+ recommended use of scalar context due to historical API behavior
version 3.26: Mon Jan 31 22:15:04 EST 2011
- *require Perl 5.8.1 as constant use is invalid on 5.6
- rt.cpan.org#63524: fetch_hash() parse errors
[Brian Kroth]
+ fixed handling of LITERAL values in response
+ fixed handling of field names with a dash (e.g. X-SAVEDATE)
+ fetch_hash now uses Escaped_results() method
- *fixed Escaped_results() to properly join LITERAL data with
the data that comes before and after it
- *rt.cpan.org#60945: append_file() does not interpret $date as expected
[Jason Long]
$date should now be 1 (to use the file mtime) or a valid RFC3501 date
- *rt.cpan.org#61292: memory consumption with message_string()/append()
rt.cpan.org#61806: Major problem with one function in IMAPClient
[Gilles Lamiral, Casey Duquette]
+ use @_ / $_[<num>] in critical places to avoid pass by
value memory overhead
+ use in memory files in a few critical places as that code
path in Mail::IMAPClient is significantly more efficient
with internal memory usage
+ *new (undocumented/do-not-use-without-good-reason)
attribute Maxappendstringlength used by append() and
append_string() holds the size (in bytes, default 1 MiB)
that triggers when message SCALAR(s) passed to these
methods will be treated as an in memory file. This
attribute will likely be removed in a future version.
+ *append() and append_string() now call append_file() and
use an im memory file when length($message) is greater
than Maxappendstringlength; other minor code cleanup
+ *message_string() now calls message_to_file() and uses an
in memory file
+ refactor message_to_file() to use internal _imap_uid_command()
+ update _read_line() to be more efficient w/CPU in critical
section by pulling isa() checks out of main loop also
conserve memory by not storing an extra copy of LITERAL
data if the data was put into a filehandle from the caller
+ Memory/working set (KB) comparison (Perl 5.10 cygwin Win7):
- test: message_string on 6.1M msg and then append 6.1M msg
version | start | after message_string | after append
--------+-------+----------------------+-------------
2.2.9 | 7624 | 74404 | 131896
3.25 | 7716 | 74408 | 156532
3.26 | 7684 | 33372 | 42608
- minor arg cleanup of noop() and tag_and_run()
- rt.cpan.org#63444: relax get_envelope(), allow empty reply-to
[Nikolay Kravchenko]
- rt.cpan.org#61068: append_string can invalidate a good $date
- rt.cpan.org#60045: Logout error if delay between BYE and tagged OK
[Armin Wolfermann]
no longer set an error when this happens
- rt.cpan.org#61062: migrate() errors
[Johan Ekenberg]
+ rewrote migrate() to be functional and simple
- Update README and cleanup several old or out of date files
version 3.25: Fri May 28 00:07:40 EDT 2010
- fix body_string parsing bug and added tests in t/body_string.t
[Heiko Schlittermann]

View file

@ -1,10 +1,7 @@
COPYRIGHT
Changes
INSTALL
MANIFEST
Makefile.PL
README
TODO
examples/build_dist.pl
examples/build_ldif.pl
examples/cleanTest.pl
@ -30,7 +27,6 @@ lib/Mail/IMAPClient/Thread.grammar
lib/Mail/IMAPClient/Thread.pm
lib/Mail/IMAPClient/Thread.pod
prepare_dist
sample.perldb
t/basic.t
t/body_string.t
t/bodystructure.t

View file

@ -1,6 +1,6 @@
--- #YAML:1.0
name: Mail-IMAPClient
version: 3.25
version: 3.27
abstract: IMAP4 client library
author:
- Phil Pearl (Lobbes) <phil@zimbra.com>
@ -22,6 +22,7 @@ requires:
List::Util: 0
MIME::Base64: 0
Parse::RecDescent: 1.94
perl: 5.008
Test::More: 0
no_index:
directory:

View file

@ -2,6 +2,8 @@ use ExtUtils::MakeMaker;
use warnings;
use strict;
use 5.008_001;
my @missing;
my %optional = (
"Authen::NTLM" => { for => "Authmechanism 'NTLM'" },
@ -36,9 +38,10 @@ MSG
WriteMakefile(
NAME => 'Mail::IMAPClient',
,
AUTHOR => 'Phil Pearl (Lobbes) <phil@zimbra.com>',
ABSTRACT => 'IMAP4 client library',
VERSION_FROM => 'lib/Mail/IMAPClient.pm',
MIN_PERL_VERSION => '5.008',
PREREQ_PM => {
'Carp' => 0,
'Errno' => 0,
@ -54,10 +57,6 @@ WriteMakefile(
'File::Temp' => 0,
},
clean => { FILES => 'test.txt' },
$] >= 5.005
? ## keywords supported since 5.005
( AUTHOR => 'Phil Pearl (Lobbes) <phil@zimbra.com>' )
: ()
);
set_test_data();

View file

@ -0,0 +1,76 @@
Mail::IMAPClient
================
Mail::IMAPClient is a Perl module that provides an interface for
communicating with an IMAP server as an IMAP client.
DEPENDENCIES
============
The following are the minimum requirements for using Mail::IMAPClient:
- Perl 5.8
http://www.perl.org/
- Perl modules from CPAN:
http://search.cpan.org/
Required:
List::Util
MIME::Base64
Parse::RecDescent
Optional:
Authen::NTLM
Authen::SASL
Digest::HMAC_MD5
Digest::MD5
IO::Socket::SSL
- RFC 3501 (IMAP4REV1) compatible IMAP server
http://www.faqs.org/rfcs/rfc3501.html
- Mail::IMAPClient (this package)
INSTALLATION
============
1. Download Mail::IMAPClient module
http://search.cpan.org/dist/Mail-IMAPClient/
2. Read this README
3. This module has a number of dependencies on other Perl modules
available from CPAN. If any modules are missing, appropriate
warnings will be generated in the following step.
4. Prepare to build this module and install any prerequisite modules:
perl Makefile.PL
5. Build, test and install this module:
make
make test
(sudo) make install
6. Read the documentation to become familiar with this module.
Project Links
=============
- Bugs/tickets:
http://rt.cpan.org/Public/Dist/Display.html?Name=Mail-IMAPClient
- Source code repository (git):
http://sourceforge.net/p/mail-imapclient/git/
- CPAN releases:
http://search.cpan.org/dist/Mail-IMAPClient/
- Project website
http://mail-imapclient.sf.net/
COPYRIGHT AND LICENSE
=====================
Copyright (C) 1999-2003 The Kernen Group, Inc.
Copyright (C) 2007-2009 Mark Overmeer
Copyright (C) 2010-2011 Phil Pearl (Lobbes)
All rights reserved.
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself, either Perl version 5.8.0 or,
at your option, any later version of Perl 5 you may have available.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See either the
GNU General Public License or the Artistic License for more details.

View file

@ -1,5 +1,5 @@
#!/usr/local/bin/perl
#$Id: //depot/main/ZimbraPS/Mail-IMAPClient/examples/build_dist.pl#1 $
#$Id$
use Mail::IMAPClient;
@ -132,7 +132,7 @@ All rights reserved.
=cut
# $Id: //depot/main/ZimbraPS/Mail-IMAPClient/examples/build_dist.pl#1 $
# $Id$
# $Log: build_dist.pl,v $
# Revision 19991216.7 2003/06/12 21:38:29 dkernen
#

View file

@ -1,5 +1,5 @@
#!/usr/local/bin/perl
#$Id: //depot/main/ZimbraPS/Mail-IMAPClient/examples/build_ldif.pl#1 $
#$Id$
use Mail::IMAPClient;
use MIME::Lite;
use Data::Dumper;
@ -180,7 +180,7 @@ All rights reserved.
=cut
# $Id: //depot/main/ZimbraPS/Mail-IMAPClient/examples/build_ldif.pl#1 $
# $Id$
# $Log: build_ldif.pl,v $
# Revision 19991216.11 2003/06/12 21:38:30 dkernen
#

View file

@ -1,5 +1,5 @@
#!/usr/local/bin/perl
#$Id: //depot/main/ZimbraPS/Mail-IMAPClient/examples/copy_folder.pl#1 $
#$Id$
++$|;
use Getopt::Std;
use Mail::IMAPClient;

View file

@ -1,5 +1,5 @@
#!/usr/local/bin/perl
#$Id: //depot/main/ZimbraPS/Mail-IMAPClient/examples/cyrus_expunge.pl#1 $
#$Id$
use Mail::IMAPClient;
use IO::File;

View file

@ -1,5 +1,5 @@
#!/usr/local/bin/perl
# $Id: //depot/main/ZimbraPS/Mail-IMAPClient/examples/find_dup_msgs.pl#1 $
# $Id$
use Mail::IMAPClient;
use Mozilla::LDAP::Conn;

View file

@ -6,7 +6,7 @@
# DESC: Reads a users IMAP folders, and converts them to mbox
# Good for an interim switch-over from say, Exchange to Cyrus IMAP.
# $Header: //depot/main/ZimbraPS/Mail-IMAPClient/examples/imap_to_mbox.pl#1 $
# $Header$
# History:
# --------

View file

@ -1,5 +1,5 @@
#!/usr/local/bin/perl
#$Id: //depot/main/ZimbraPS/Mail-IMAPClient/examples/migrate_mail2.pl#1 $
#$Id$
#
# An example of how to migrate from a Netscape server
# (which uses a slash as a separator and which does

View file

@ -4,7 +4,7 @@
# Note that the migrate method is considered experimental and should
# be used with caution.
#
#$Id: //depot/main/ZimbraPS/Mail-IMAPClient/examples/migrate_mbox.pl#1 $
#$Id$
#
use Mail::IMAPClient;

View file

@ -1,5 +1,5 @@
#!/usr/local/bin/perl
#$Id: //depot/main/ZimbraPS/Mail-IMAPClient/examples/populate_mailbox.pl#1 $ #
#$Id$ #
use Time::Local ;
use FileHandle ;
use File::Copy ;
@ -256,7 +256,7 @@ All rights reserved.
=cut
# $Id: //depot/main/ZimbraPS/Mail-IMAPClient/examples/populate_mailbox.pl#1 $
# $Id$
# $Log: populate_mailbox.pl,v $
# Revision 19991216.8 2003/06/12 21:38:34 dkernen
#

View file

@ -1,5 +1,5 @@
#!/usr/local/bin/perl
#$Id: //depot/main/ZimbraPS/Mail-IMAPClient/examples/sharedFolder.pl#1 $
#$Id$
use Mail::IMAPClient;
use Getopt::Std;

View file

@ -103,153 +103,6 @@ L</Domain>.
=back
=head2 Custom Authentication Mechanisms
There are also a number of methods and parameters that you can use to
build your own authentication mechanism. All of the methods and
parameters discussed in this section are described in more detail
elsewhere in this document. This section provides a starting point
for building your own authentication mechanism.
First of all, if you just want to do plain text authentication and
your server is okay with that idea then you don't even need to read
this section.
Second of all, the intent of this section is to help you implement the
authentication mechanism of your choice, but you will have to
understand how that mechanism works. There are I<lots> of
authentication mechanisms, if your preferred mechanism is not
currently supported but you manage to get it working please consider
donating them to this module. Patches and suggestions are always
welcome.
Support for add-on authentication mechanisms in Mail::IMAPClient is
pretty straight forward. You create a callback to be used to provide
the response to the server's challenge. The L</Authcallback> parameter
contains a reference to the callback, which can be an anonymous
subroutine or a named subroutine. Then, you identify your
authentication mechanism, either via the L</Authmechanism> parameter or
as an argument to L</authenticate>.
You may also need to provide a subroutine to encrypt (or whatever)
data before it is sent to the server. The L</Prewritemethod> parameter
must contain a reference to this subroutine. And, you will need to
decrypt data from the server; a reference to the subroutine that does
this must be stored in the L</Readmethod> parameter.
This framework is based on the assumptions that a) the mechanism you
are using requires a challenge-response exchange, and b) the mechanism
does not fundamentally alter the exchange between client and server
but merely wraps the exchange in a layer of encryption. It also
assumes that the line-oriented nature of the IMAP conversation is
preserved; authentication mechanisms that break up messages into
blocks of a predetermined size may still be possible but will
certainly be more difficult to implement.
Alternatively, if you have access to B<imtest>, a utility included in
the Cyrus IMAP distribution, you can use that utility to broker your
communications with the IMAP server. This is quite easy to implement.
An example, F<examples/imtestExample.pl>, can be found in the
C<examples> subdirectory of the source distribution.
The following list summarizes the methods and parameters that you may
find useful in implementing advanced authentication:
=over 4
=item The authenticate method
The L</authenticate> method uses the L</Authmechanism> parameter to
determine how to authenticate with the server see the method
documentation for details.
=item Socket and RawSocket
The L</Socket> and L</RawSocket> methods provide access to the socket
connection. The socket is typically automatically created by the
L</connect> method, but if you are implementing an advanced
authentication technique you may choose to set up your own socket
connection and then set this parameter manually, bypassing the
B<connect> method completely. This is also useful if you want to use
L<IO::Socket::INET> alternatives like L<IO::Socket::SSL> and need full
control.
L</RawSocket> simply gets/sets the socket without attempting any
interaction on it. In this case, you have to be sure to handle all
the preliminary operations and manually set the Mail::IMAPClient
object in sync with its actual status with respect to this socket (see
below for additional parameters regarding this, especially the
L</State> parameter).
Unlike L</RawSocket>, L</Socket> attempts to carry on preliminary
connection phases if the conditions apply. If both parameters are
present, this takes the precedence over L</RawSocket>. If
L</Starttls> is set, then the L</starttls> method will be called by
L</Socket>.
B<PLEASE NOTE> As of version 2.99_04 of this module, semantics for
L</Socket> have changed to make it more "DWIM". L</RawSocket> was
introduced as a replacement for the L</Socket> parameter in older
version.
=item State, Server, User, Password, Proxy and Domain Parameters
If you need to make your own connection to the server and perform your
authentication manually, then you can set these parameters to keep
your Mail::IMAPClient object in sync with its actual status. Of
these, only the L</State> parameter is always necessary. The others
need to be set only if you think your program will need them later.
=item Authmechanism
Set this to the value that AUTHENTICATE should send to the server as
the authentication mechanism. If you are brokering your own
authentication then this parameter may be less useful. It exists
primarily so that you can set it when you call L</new> to instantiate
your object. The L</new> method will call L</connect>, which will
call L</login>. If L</login> sees that you have set an
B<Authmechanism> then it will call B<authenticate>, using your
B<Authmechanism> and B<Authcallback> parameters as arguments.
=item Authcallback
The L</Authcallback>, if set, holds a pointer to a subroutine
(CODEREF). The L</login> method will use this as the callback
argument to the B<authenticate> method if the B<Authmechanism> and
B<Authcallback> parameters are both set. If you set B<Authmechanism>
but not B<Authcallback> then the default callback for your mechanism
will be used. All supported authentication mechanisms have a default
callback; in every other case not supplying the callback results in an
error.
Most advanced authentication mechanisms require a challenge-response
exchange. After the L</authenticate> method sends "<tag> AUTHENTICATE
<Authmechanism>\015\012" to the IMAP server, the server replies with a
challenge. The L</authenticate> method then invokes the code whose
reference is stored in the B<Authcallback> parameter as follows:
$Authcallback->($challenge, $imap)
where C<$Authcallback> is the code reference stored in the
B<Authcallback> parameter, C<$challenge> is the challenge received
from the IMAP server, and C<$imap> is a pointer to the
Mail::IMAPClient object. The return value from the B<Authcallback>
routine should be the response to the challenge, and that return value
will be sent by the L</authenticate> method to the server.
=item Prewritemethod/Readmethod
The B<Prewritemethod> can hold a subroutine that will do whatever
encryption is necessary and then return the result to the caller so it
in turn can be sent to the server.
The B<Readmethod> can hold a subroutine to be used to replace
B<sysread> usually performed by Mail::IMAPClient.
See L</Prewritemethod> and L</Readmethod> for details.
=back
=head2 Errors
If you attempt an operation that results in an error, then you can
@ -276,6 +129,11 @@ L</login>. Any of these methods could fail and cause the L</new>
method call to return C<undef> and leaving the variable C<$@> is set
to an error message.
WARNING: (due to historical API behavior) on errors, many methods may
return undef regardless of LIST/SCALAR context. Therefore, it may be
wise to use most methods in a scalar context. Regardless, check
L</LastError> for details on errors.
=head2 Transactions
RFC3501 requires that each line in an IMAP conversation be prefixed
@ -549,46 +407,134 @@ error-prone and stalled the progress of this module.
Example:
my $uid = $imap->append( $folder, $msg_text )
my $uid_or_true = $imap->append( $folder, $msgtext )
or die "Could not append: ", $imap->LastError;
The B<append> method adds a message to the specified folder. It takes
two arguments, the name of the folder to append the message to, and
the text of the message (including headers). Additional arguments are
added to the message text, separated with <CR><LF>.
WARNING: This method may be deprecated in the future, consider using
L</append_string> instead of this method.
On success, the B<append> method returns the UID of the new message
(if the server has the UIDPLUS capability) or a true value otherwise.
On error, C<undef> is returned and L</LastError> will be set.
The B<append> method adds a message to the specified folder. See
L</append_string> for details as it is effectively an alias for that
method.
DEPRECATED BEHAVIOR: Additional arguments are added to the message
text, separated with <CR><LF>.
=head2 append_string
Example:
# brackets indicate optional arguments (not array refs):
my $uidort = $imap->append_string( $folder, $msgtext [,$flags [,$date ] ] )
or die "Could not append_string: ", $imap->LastError;
Arguments:
=over 4
=item $folder
the name of the folder to append the message to
=item $msgtext
the message text (including headers) of the message
=item $flags
An optional list of flags to set. The list must be specified as
a space-separated list of flags, including any backslashes that may be
necessary and optionally enclosed by parenthesis.
=item $date
An optional RFC3501 date argument to set as the internal date. It
should be in the format described for I<date_time> fields in RFC3501,
i.e. "dd-Mon-yyyy hh:mm:ss +0000".
If you want to specify a date/time but you don't want any flags then
specify I<undef> as the third ($flags) argument.
=back
Returns:
=over 4
=item error: undef
On error, undef can be returned regardless of LIST/SCALAR context.
Check L</LastError> for details.
=item success: UID or $imap
With UIDPLUS the UID of the new message is returned otherwise a true
value (currently $self) is returned.
=back
To protect against "bare newlines", B<append> will insert a carriage
return before any newline that is "bare".
Note that B<append> does not allow you to specify the internal date or
initial flags of an appended message. If you need this capability
then use L</append_string>, below.
=head2 append_file
Example:
my $new_msg_uid = $imap->append_file(
$folder,
$filename,
[ undef, flags, date ] # optional
$file,
[ undef, $flags, $date ] # optional
) or die "Could not append_file: ", $imap->LastError;
The B<append_file> method adds a message to the specified folder. It
takes two arguments, the name of the folder to append the message to,
and the file name of an RFC822-formatted message.
The B<append_file> method adds a message to the specified folder.
Note: The brackets in the example indicate optional arguments; they do
not mean that the argument should be an array reference.
On success, the B<append_file> method returns the UID of the new
message (if the server has the UIDPLUS capability) or a true value
otherwise. On error, C<undef> is returned and L</LastError> will be
set.
Arguments:
=over 4
=item $folder
the name of the folder to append the message to
=item $file
a filename, filehandle or SCALAR reference which holds an
RFC822-formatted message
=item undef
a deprecated argument used as a place holder for backwards
compatibility
=item $flags
The optional argument is handled the same as append_string.
=item $date
The optional argument is handled the same as append_string (RFC3501
date), with the exception that if $date is "1" (one) then the
modification time (mtime) of the file will be used.
=back
Returns:
=over 4
=item error: undef
On error, undef can be returned regardless of LIST/SCALAR context.
Check L</LastError> for details.
=item success: UID or $imap
With UIDPLUS the UID of the new message is returned otherwise a true
value (currently $self) is returned.
=back
To protect against "bare newlines", B<append_file> will insert a
carriage return before any newline that is "bare".
@ -600,41 +546,6 @@ Version note: In 2.x an optional third argument to use for
C<input_record_separator> was allowed, however this argument is
ignored/not supported as of 3.x.
=head2 append_string
Example:
# brackets indicate optional arguments (not array refs):
my $uid = $imap->append_string( $folder, $text [ ,$flags [ ,$date ] ] )
or die "Could not append_string: $@\n";
The B<append_string> method adds a message to the specified folder.
It requires two arguments, the name of the folder to append the
message to, and the text of the message (including headers). The
message text must be included in a single string (unlike L</append>,
above).
You can optionally specify a third and fourth argument to
B<append_string>. The third argument, if supplied, is the list of
flags to set for the appended message. The list must be specified as
a space-separated list of flags, including any backslashes that may be
necessary. The enclosing parentheses that are required by RFC3501 are
optional for B<append_string>. The fourth argument, if specified, is
the date to set as the internal date. It should be in the format
described for I<date_time> fields in RFC3501, i.e. "dd-Mon-yyyy
hh:mm:ss +0000".
If you want to specify a date/time but you don't want any flags then
specify I<undef> as the third argument.
On success, the B<append_string> method returns the UID of the new
message (if the server has the UIDPLUS capability) or a true value
otherwise. On error, C<undef> is returned and L</LastError> will be
set.
To protect against "bare newlines", B<append_string> will insert a
carriage return before any newline that is "bare".
=head2 authenticate
Example:
@ -1154,7 +1065,7 @@ function in later releases.
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>.
section on L</REPORTING BUGS>.
=head2 flags
@ -1734,10 +1645,10 @@ C<$imap-E<gt>L</search>("ALL")>.
Example:
$imap->migrate($imap_2, "ALL", $targetFolder )
or die "Could not migrate: $@\n";
$imap_src->migrate( $imap_dest, "ALL", $targetFolder )
or die "Could not migrate: ", $imap_src->LastError;
The B<migrate> method copies the indicated messages B<from> the
The B<migrate> method copies the indicated message(s) B<from> the
currently selected folder B<to> another Mail::IMAPClient object's
session. It requires these arguments:
@ -1759,40 +1670,22 @@ C<L</search>("ALL")>.
=item 3.
the folder name of a folder on the target mailbox to receive the
message(s). If this argument is not supplied or if I<undef> is
supplied then a folder with the same name as the currently selected
folder on the calling object will be created if necessary and used.
If you specify something other then I<undef> for this argument, even
if it's '$imap1-E<gt>Folder' or the name of the currently selected
folder, then that folder will only be used if it exists on the target
object's mailbox; if it does not exist then B<migrate> will fail.
the name of the destination folder on the target mailbox to receive
the message(s). If this argument is not supplied or is I<undef> then
the currently selected folder on the calling object will be used. The
destination folder will be automatically created if necessary.
=back
The target Mail::IMAPClient object should not be the same as the
source. The source object is the calling object, i.e. the one whose
B<migrate> method will be used. It cannot be the same object as the
one specified as the target, even if you are for some reason migrating
between folders on the same account (which would be silly anyway,
since L</copy> can do that much more efficiently). If you try to use
the same Mail::IMAPClient object for both the caller and the receiver
then they'll both get all screwed up and it will be your fault because
I just warned you and you didn't listen.
The target ($imap_dest) Mail::IMAPClient object must not be the same
object as the source ($imap_src).
B<migrate> will download messages from the source in chunks to
minimize memory usage. The size of the chunks can be controlled by
changing the source Mail::IMAPClient object's the L</Buffer>
parameter. The higher the L</Buffer> value, the faster the migration,
but the more memory your program will require. TANSTAAFL. (See the
L</Buffer> parameter and eponymous accessor method, described above
under the L</"Parameters"> section.)
This method does not attempt to minimize memory usage. In the future
it could be enhanced to (optionaly) write message data to a temporary
file to avoid storing the entire message in memory.
The B<migrate> method uses Black Magic to hardwire the I/O between the
two Mail::IMAPClient objects in order to minimize resource
consumption. If you have older scripts that used L</message_to_file>
and L</append_file> to move large messages between IMAP mailboxes then
you may want to try this method as a possible replacement.
To work around potential network timeouts on large messages, consider
setting L</Reconnectretry> to 1 on both $imap_src and $imap_dest.
See also C<Supportedflags>.
@ -3678,24 +3571,167 @@ I<STATUS> IMAP client command.)
The B<Transaction> method returns the tag value (or transaction
number) of the last IMAP client command.
=head1 Custom Authentication Mechanisms
If you just want to use plain text authentication or any of the
supported L</"Advanced Authentication Mechanisms"> then there is no
need to read this section.
There are a number of methods and parameters that you can use to build
your own authentication mechanism. All of the methods and parameters
discussed in this section are described in more detail elsewhere in
this document. This section provides a starting point for building
your own authentication mechanism.
There are I<many> authentication mechanisms out there, if your
preferred mechanism is not currently supported but you manage to get
it working please consider donating them to this module. Patches and
suggestions are always welcome.
Support for add-on authentication mechanisms in Mail::IMAPClient is
pretty straight forward. You create a callback to be used to provide
the response to the server's challenge. The L</Authcallback> parameter
contains a reference to the callback, which can be an anonymous
subroutine or a named subroutine. Then, you identify your
authentication mechanism, either via the L</Authmechanism> parameter or
as an argument to L</authenticate>.
You may also need to provide a subroutine to encrypt (or whatever)
data before it is sent to the server. The L</Prewritemethod> parameter
must contain a reference to this subroutine. And, you will need to
decrypt data from the server; a reference to the subroutine that does
this must be stored in the L</Readmethod> parameter.
This framework is based on the assumptions that a) the mechanism you
are using requires a challenge-response exchange, and b) the mechanism
does not fundamentally alter the exchange between client and server
but merely wraps the exchange in a layer of encryption. It also
assumes that the line-oriented nature of the IMAP conversation is
preserved; authentication mechanisms that break up messages into
blocks of a predetermined size may still be possible but will
certainly be more difficult to implement.
Alternatively, if you have access to B<imtest>, a utility included in
the Cyrus IMAP distribution, you can use that utility to broker your
communications with the IMAP server. This is quite easy to implement.
An example, F<examples/imtestExample.pl>, can be found in the
C<examples> subdirectory of the source distribution.
The following list summarizes the methods and parameters that you may
find useful in implementing advanced authentication:
=over 4
=item The authenticate method
The L</authenticate> method uses the L</Authmechanism> parameter to
determine how to authenticate with the server see the method
documentation for details.
=item Socket and RawSocket
The L</Socket> and L</RawSocket> methods provide access to the socket
connection. The socket is typically automatically created by the
L</connect> method, but if you are implementing an advanced
authentication technique you may choose to set up your own socket
connection and then set this parameter manually, bypassing the
B<connect> method completely. This is also useful if you want to use
L<IO::Socket::INET> alternatives like L<IO::Socket::SSL> and need full
control.
L</RawSocket> simply gets/sets the socket without attempting any
interaction on it. In this case, you have to be sure to handle all
the preliminary operations and manually set the Mail::IMAPClient
object in sync with its actual status with respect to this socket (see
below for additional parameters regarding this, especially the
L</State> parameter).
Unlike L</RawSocket>, L</Socket> attempts to carry on preliminary
connection phases if the conditions apply. If both parameters are
present, this takes the precedence over L</RawSocket>. If
L</Starttls> is set, then the L</starttls> method will be called by
L</Socket>.
B<PLEASE NOTE> As of version 2.99_04 of this module, semantics for
L</Socket> have changed to make it more "DWIM". L</RawSocket> was
introduced as a replacement for the L</Socket> parameter in older
version.
=item State, Server, User, Password, Proxy and Domain Parameters
If you need to make your own connection to the server and perform your
authentication manually, then you can set these parameters to keep
your Mail::IMAPClient object in sync with its actual status. Of
these, only the L</State> parameter is always necessary. The others
need to be set only if you think your program will need them later.
=item Authmechanism
Set this to the value that AUTHENTICATE should send to the server as
the authentication mechanism. If you are brokering your own
authentication then this parameter may be less useful. It exists
primarily so that you can set it when you call L</new> to instantiate
your object. The L</new> method will call L</connect>, which will
call L</login>. If L</login> sees that you have set an
B<Authmechanism> then it will call B<authenticate>, using your
B<Authmechanism> and B<Authcallback> parameters as arguments.
=item Authcallback
The L</Authcallback>, if set, holds a pointer to a subroutine
(CODEREF). The L</login> method will use this as the callback
argument to the B<authenticate> method if the B<Authmechanism> and
B<Authcallback> parameters are both set. If you set B<Authmechanism>
but not B<Authcallback> then the default callback for your mechanism
will be used. All supported authentication mechanisms have a default
callback; in every other case not supplying the callback results in an
error.
Most advanced authentication mechanisms require a challenge-response
exchange. After the L</authenticate> method sends "<tag> AUTHENTICATE
<Authmechanism>\015\012" to the IMAP server, the server replies with a
challenge. The L</authenticate> method then invokes the code whose
reference is stored in the B<Authcallback> parameter as follows:
$Authcallback->($challenge, $imap)
where C<$Authcallback> is the code reference stored in the
B<Authcallback> parameter, C<$challenge> is the challenge received
from the IMAP server, and C<$imap> is a pointer to the
Mail::IMAPClient object. The return value from the B<Authcallback>
routine should be the response to the challenge, and that return value
will be sent by the L</authenticate> method to the server.
=item Prewritemethod/Readmethod
The B<Prewritemethod> can hold a subroutine that will do whatever
encryption is necessary and then return the result to the caller so it
in turn can be sent to the server.
The B<Readmethod> can hold a subroutine to be used to replace
B<sysread> usually performed by Mail::IMAPClient.
See L</Prewritemethod> and L</Readmethod> for details.
=back
=head1 REPORTING BUGS
Please send bug reports to C<bug-Mail-IMAPClient@rt.cpan.org>
Please send bug reports to C<bug-Mail-IMAPClient@rt.cpan.org> or
http://rt.cpan.org/Public/Dist/Display.html?Name=Mail-IMAPClient
=head1 COPYRIGHT
=head1 COPYRIGHT AND LICENSE
Copyright 1999, 2000, 2001, 2002 The Kernen Group, Inc.
Copyright (C) 1999-2003 The Kernen Group, Inc.
Copyright (C) 2007-2009 Mark Overmeer
Copyright (C) 2010-2011 Phil Pearl (Lobbes)
All rights reserved.
Copyright 2007, 2008, 2009 Mark Overmeer
Copyright 2010 Phil Pearl (Lobbes)
This program is free software; you can redistribute under the same
terms as Perl itself.
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself, either Perl version 5.8.0 or,
at your option, any later version of Perl 5 you may have available.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See either the
GNU General Public License or the Artistic License for more
details. All your base are belong to us.
GNU General Public License or the Artistic License for more details.

View file

@ -32,6 +32,7 @@ HTML: /"HTML"|HTML/i { $return = "HTML" }
MESSAGE: /^"MESSAGE"|^MESSAGE/i { $return = "MESSAGE"}
RFC822: /^"RFC822"|^RFC822/i { $return = "RFC822" }
NIL: /^NIL/i { $return = "NIL" }
RFCNONCOMPLY: /^\(\)/i { $return = "NIL" }
NUMBER: /^(\d+)/ { $return = $item[1] }
# Strings:
@ -91,7 +92,7 @@ inreplyto: NIL | STRING
messageid: NIL | STRING
date: NIL | STRING
ADDRESSES: NIL
ADDRESSES: NIL | RFCNONCOMPLY
| "(" addressstruct(s) ")" { $return = $item{'addressstruct(s)'} }
cc: ADDRESSES

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,43 @@
#!/usr/bin/perl
use strict;
use warnings;
use File::Copy qw/move/;
use Parse::RecDescent 1.94;
sub read_file {
my $file = shift;
local ( $/, *FH );
open( FH, $file ) or return undef;
return <FH>;
}
build_parser(
'lib/Mail/IMAPClient/BodyStructure/Parse.grammar',
'Mail::IMAPClient::BodyStructure::Parse'
);
build_parser( 'lib/Mail/IMAPClient/Thread.grammar',
'Mail::IMAPClient::Thread' );
sub build_parser {
my ( $grammarfn, $package ) = @_;
print("* building $package\n");
my $grammar = read_file($grammarfn)
or die("cannot read grammar from $grammarfn: $!\n");
Parse::RecDescent->Precompile( $grammar, $package );
# clumpsy output by Parse::RecDescent
my $outfn = $package . '.pm';
$outfn =~ s/.*\:\://;
my $realfn = $grammarfn;
$realfn =~ s/\.\w+$/.pm/;
move( $outfn, $realfn )
or die("cannot move $outfn to $realfn: $!\n");
}

View file

@ -2,6 +2,7 @@
use strict;
use warnings;
use IO::File qw();
use Test::More;
use File::Temp qw(tempfile);
@ -32,7 +33,7 @@ BEGIN {
@missing
? plan skip_all => "missing value for: @missing"
: plan tests => 77;
: plan tests => 85;
}
BEGIN { use_ok('Mail::IMAPClient') or exit; }
@ -134,15 +135,37 @@ my $append_file_size;
$append_file_size = $size;
}
# test append (string)
{
ok( $imap->create($target), "create target" );
ok( $imap->select($target), "select $target" );
# Test append / append_string if we also have UID capability
SKIP: {
skip "UIDPLUS not supported", 3 unless $imap->has_capability("UIDPLUS");
my $ouid = $imap->Uid();
$imap->Uid(1);
# test with date that has a leading space
my $d = " 1-Jan-2011 01:02:03 -0500";
my $uid = $imap->append_string( $target, $testmsg, undef, $d );
ok( defined $uid, "append test message to $target with date (uid=$uid)" );
ok( $imap->delete_message($uid), "delete_message $uid" );
ok( $imap->uidexpunge($uid), "uidexpunge $uid" );
# multiple args joined internally in append()
$uid = $imap->append( $target, $testmsg, "Some extra text too" );
ok( defined $uid, "append test message to $target with date (uid=$uid)" );
ok( $imap->delete_message($uid), "delete_message $uid" );
ok( $imap->uidexpunge($uid), "uidexpunge $uid" );
$imap->Uid($ouid);
}
# test append
{
my $uid = $imap->append( $target, $testmsg );
ok( defined $uid, "append test message to $target" );
ok( $imap->select($target), "select $target" );
my $msg = ( $uidplus and $uid ) ? $uid : ( $imap->messages )[0];
my $size = $imap->size($msg);
@ -151,9 +174,13 @@ my $append_file_size;
my $string = $imap->message_string($msg);
ok( defined $string, "returned string" );
cmp_ok( length($string), '==', $size, "string matches server size" );
cmp_ok( length($string), '==', $size, "string == server size" );
{
my $var;
ok( $imap->message_to_file( \$var, $msg ), "to SCALAR ref" );
cmp_ok( length($var), '==', $size, "correct size" );
my ( $fh, $fn ) = tempfile UNLINK => 1;
ok( $imap->message_to_file( $fn, $msg ), "to file $fn" );
@ -162,7 +189,7 @@ my $append_file_size;
cmp_ok( $size, '==', $append_file_size, "size matches string/file" );
# save message/folder for use below...
# save first message/folder for use below...
#OFF ok( $imap->delete($target), "delete folder $target" );
}
@ -399,6 +426,6 @@ sub ok_relaxed_logout {
my $imap = shift;
local ($@);
my $rc = $imap->logout;
my $err = $imap->LastError || "OK";
ok( ( $rc or $err =~ /^\* BYE/ ), "logout: $err" );
my $err = $imap->LastError || "";
ok( ( $rc or $err =~ /^\* BYE/ ), "logout" . ( $err ? ": $err" : "" ) );
}

View file

@ -2,7 +2,7 @@
use strict;
use warnings;
use Test::More tests => 20;
use Test::More tests => 27;
BEGIN { use_ok('Mail::IMAPClient::BodyStructure') or exit; }
@ -98,3 +98,20 @@ $bsobj = Mail::IMAPClient::BodyStructure->new($bs9);
ok( defined $bsobj, 'parsed ninth' );
is_deeply( [ $bsobj->parts ], \@exp, 'bs9 parts' )
or diag( join(" ", $bsobj->parts ) );
# envelope
# date, subject, from, sender, reply-to, to, cc, bcc, in-reply-to, message-id
{
my $resp = q{* 2 FETCH (UID 42895 ENVELOPE ("Mon, 29 Nov 2010 18:28:23 +0200" "subj" (("Phil Pearl" NIL "phil+from" "dom.loc")) (("Phil Pearl" NIL "phil+sender" "dom.loc")) () ((NIL NIL "phil+to" "dom.loc")) NIL NIL NIL "<msgid>"))};
my $env = Mail::IMAPClient::BodyStructure::Envelope->new($resp);
is( $env->subject, "subj", "subject" );
is( $env->inreplyto, "NIL", "inreplyto" );
is( $env->messageid, "<msgid>", "messageid" );
is( $env->bcc, "NIL", "bcc" );
is( $env->cc, "NIL", "cc" );
is( $env->replyto, "NIL", "replyto" );
# personalname mailboxname hostname sourcename
my $to = $env->to_addresses;
is_deeply( $to, [ '<phil+to@dom.loc>' ], "to_addresses" );
}

View file

@ -9,7 +9,7 @@
use strict;
use warnings;
use Test::More tests => 18;
use Test::More tests => 19;
BEGIN { use_ok('Mail::IMAPClient') or exit; }
@ -110,6 +110,19 @@ my @tests = (
[ [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>")) } ],
[ [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>"}
},
},
],
[
"real life example",
[
@ -212,6 +225,10 @@ sub fetch {
my ( $self, @args ) = @_;
return $self->{_next_fetch_response} || [];
}
sub Escaped_results {
my ( $self, @args ) = @_;
return $self->{_next_fetch_response} || [];
}
package main;

View file

@ -1,5 +1,5 @@
# $Id: Makefile,v 1.57 2011/01/12 00:59:12 gilles Exp gilles $
# $Id: Makefile,v 1.60 2011/02/21 02:20:38 gilles Exp gilles $
.PHONY: help usage all
@ -13,6 +13,7 @@ usage:
@echo "make test3xx # run tests with (last) Mail-IMAPClient-3.xy"
@echo "make test229 # run tests with Mail-IMAPClient-2.2.9"
@echo "make tests_win32 # run tests on win32"
@echo "make tests_win32_dev # run test2.bat on win32"
@echo "make all "
@echo "make upload_index"
@echo "make imapsync.exe"
@ -62,18 +63,16 @@ imapsync.1: imapsync
pod2man imapsync > imapsync.1
install: testp imapsync.1
mkdir -p $(DESTDIR)/usr/bin
install imapsync $(DESTDIR)/usr/bin/imapsync
install imapsync.1 $(DESTDIR)/usr/share/man/man1/imapsync.1
chmod 755 $(DESTDIR)/usr/bin/imapsync
mkdir -p $(DESTDIR)/usr/share/man/man1
install imapsync.1 $(DESTDIR)/usr/share/man/man1/imapsync.1
chmod 644 $(DESTDIR)/usr/share/man/man1/imapsync.1
.PHONY: cidone ci
deb:
echo making debball $(DEB_FILE)
mkdir -p ../prepa_deb
cd ../prepa_deb && tar xzvf ../prepa_dist/$(DIST_FILE) &&\
cd ../prepa_dist/$(DIST_NAME)
.PHONY: cidone
ci: cidone
cidone:
rcsdiff RCS/*
@ -91,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.25/lib' /usr/bin/time sh tests.sh locallocal 1>/dev/null
CMD_PERL='perl -I./Mail-IMAPClient-3.27/lib' /usr/bin/time sh tests.sh locallocal 1>/dev/null
testv:
nice -40 sh -x tests.sh
@ -109,7 +108,7 @@ test229: .test_229
touch .test_229
.test_3xx: imapsync tests.sh
CMD_PERL='perl -I./Mail-IMAPClient-3.25/lib' /usr/bin/time sh tests.sh 1>/dev/null
CMD_PERL='perl -I./Mail-IMAPClient-3.27/lib' /usr/bin/time sh tests.sh 1>/dev/null
touch .test_3xx
testf: clean_test test
@ -122,8 +121,8 @@ upload_index: 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
unix2dos build_exe.bat test.bat test_exe.bat
.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
dosify_bat: .dosify_bat
@ -139,6 +138,10 @@ tests_win32: dosify_bat
# ssh Admin@c 'tasklist /FI "PID eq 0"'
# ssh Admin@c 'tasklist /NH /FO CSV'
tests_win32_dev: dosify_bat
scp imapsync test2.bat Admin@c:'C:/msys/1.0/home/Admin/imapsync/'
ssh Admin@c 'C:/msys/1.0/home/Admin/imapsync/test2.bat'
test_imapsync_exe: dosify_bat
scp 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'
@ -161,14 +164,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.25/lib \
pp -o imapsync_elf_x86.bin -I Mail-IMAPClient-3.27/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.25/lib \
pp -o imapsync_elf_x86.bin -I Mail-IMAPClient-3.27/lib \
-M Mail::IMAPClient -M IO::Socket -M IO::Socket::SSL \
-M Digest::MD5 -M Digest::HMAC_MD5 -M Term::ReadKey \
-M Authen::NTLM \
@ -177,7 +180,7 @@ imapsync_elf_x86.bin: imapsync
imapsync ; \
} || :
{ test 'ks200821.kimsufi.com' = "`hostname`" && \
pp -o imapsync_elf_x86.bin -I Mail-IMAPClient-3.25/lib \
pp -o imapsync_elf_x86.bin -I Mail-IMAPClient-3.27/lib \
-M Mail::IMAPClient -M IO::Socket -M IO::Socket::SSL \
-M Digest::MD5 -M Digest::HMAC_MD5 -M Term::ReadKey \
-M Authen::NTLM \
@ -204,12 +207,17 @@ tarball: cidone all imapsync_elf_x86.bin imapsync.exe
cd ../prepa_dist && md5sum -c $(DIST_FILE).md5.txt
ls -l ../prepa_dist/$(DIST_FILE)
ks:
rsync -av . 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/ \
; }
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 \
./index.shtml ./INSTALL ./TIME \
./logo_imapsync.png ./logo_imapsync_s.png \
./paypal.shtml ./README ./style.css ./TODO ./VERSION ./VERSION_EXE \
/home/gilles/public_html/www.linux-france.org/html/prj/imapsync/

6
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.398 $
$Revision: 1.404 $
SYNOPSIS
To synchronise imap account "foo" on "imap.truc.org" to imap account
@ -371,7 +371,7 @@ IMAP SERVERS
HUGE MIGRATION
Pay special attention to options --subscribed --subscribe --delete
--delete2 --delete2folders --expunge --expunge1 --expunge2 --uidexpunge2
--maxage --minage --maxsize --useheader --fast
--maxage --minage --maxsize --useheader --fast --useuid --usecache
If you have many mailboxes to migrate think about a little shell
program. Write a file called file.csv (for example) containing users and
@ -417,5 +417,5 @@ SIMILAR SOFTWARES
Feedback (good or bad) will often be welcome.
$Id: imapsync,v 1.398 2011/01/18 03:03:24 gilles Exp gilles $
$Id: imapsync,v 1.404 2011/02/21 03:35:39 gilles Exp gilles $

4
TIME
View file

@ -1,3 +1,7 @@
200 Added --useuid.
110 Started to allow copy by uid. Added --notakebody
60 Fixed cache, dealing with filenames containing \ characters.
210 Fixed cache (chose only the greatest uid with dupplicate 11_21+11_201 or 11_21+101_21)
180 Added --authmd51 and --authmd52. --delete2foldersbutnot. Release 1.398 public. Payment in EUR.
60 Added info about biggest messages. --debugimap* implies --debug
130 Added delete2foldersnot option.

View file

@ -1 +1 @@
1.398
1.404

View file

@ -1 +1 @@
1.398
1.404

2
i3
View file

@ -1,4 +1,4 @@
#!/bin/sh
perl -IMail-IMAPClient-3.25/lib ./imapsync "$@"
perl -IMail-IMAPClient-3.27/lib ./imapsync "$@"

659
imapsync

File diff suppressed because it is too large Load diff

Binary file not shown.

File diff suppressed because it is too large Load diff

View file

@ -5,7 +5,7 @@
<title>imapsync <!--#exec cmd="cat VERSION" --> </title>
<meta name="generator" content="Bluefish 1.0.7"/>
<meta name="author" content="Gilles LAMIRAL"/>
<meta name="date" content="2011-01-18T04:57:45+0100"/>
<meta name="date" content="2011-02-16T20:47:41+0100"/>
<meta name="copyright" content="None"/>
<meta name="keywords" content="imap, transfert, migration"/>
<meta name="description" content="imap migration tool"/>
@ -72,30 +72,12 @@ 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="PROFESSIONAL"></a>Professional user?</h2>
<p>If you <b>use imapsync</b> as a <b>professional worker</b> you may
consider the following argument:<br/>
consider the <b>time or money</b> imapsync made your company
<b>gain</b> among <b>all</b> other solutions. <br/>
Divide this gain by 2 or 4 or 8, depending on your mood.<br/>
Then send me the result by paypal, cheque or books, I deserve and <b>need</b> it.<br/>
More about this argument <a href="http://www.linux-france.org/prj/imapsync_list/msg00470.html">here</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>
@ -122,61 +104,47 @@ where the user plays independently on both sides. Use <b>offlineimap</b>
The Perl <b>imapsync</b> source code will run anywhere a <b>Perl interpreter can run</b>: any Unix, Linux, Windows, or Mac OS operating system.
</p>
<p>Buy <b>latest</b> imapsync Perl <b>source code</b> <br/>
+ standalone <b>imapsync.exe</b> for win32 <br/>
+ standalone x86_elf binary for <b>30 EUR (~40 USD)</b>:
<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:
</p>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<p>
<input type="hidden" name="cmd" value="_s-xclick"/>
</p>
<table>
<tr><td><input type="hidden" name="on0" value="Technical support option (+ 80 EUR)"/>Technical support option (+ 80 EUR)</td></tr><tr><td><select name="os0">
<option value="imapsync source">imapsync source €30,00</option>
<option value="imapsync source + technical support">imapsync source + technical support €110,00</option>
</select> </td></tr>
</table>
<p>
<input type="hidden" name="currency_code" value="EUR"/>
<input type="hidden" name="encrypted" value="-----BEGIN PKCS7-----MIIH+QYJKoZIhvcNAQcEoIIH6jCCB+YCAQExggEwMIIBLAIBADCBlDCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb20CAQAwDQYJKoZIhvcNAQEBBQAEgYAVLdBnWXU24rrb/bnSscZuxNeSj0uKKI/Lep//YJflPSbgAPq1Ioi16J8Zzl+n/72Ei8h4YdASk8/n1a5pw4Mhf+/7HS3QrzpLEUyFhxF9F1qImUjl+fVEUV0Nia+Iszf1xBXwGcrijfFLimC7r5XFaIl9+UCuvFycGV0z26JYXzELMAkGBSsOAwIaBQAwggF1BgkqhkiG9w0BBwEwFAYIKoZIhvcNAwcECMjU5aKyumz2gIIBUNFBBj1JqrNVVCTzK6oQvm9gcBEvc28zfmzqZgRicSx0tagmhAGC0TsRv52VYDoUd2Kil45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Yy4xEzARBgNVBAsUCmxpdmVfY2VydHMxETAPBgNVBAMUCGxpdmVfYXBpMRwwGgYJKoZIhvcNAQkBFg1yZUBwYXlwYWwuY29tAgEAMAkGBSsOAwIaBQCgXTAYBgkqhkiG9w0BCQMxCwYJKoZIhvcNAQcBMBwGCSqGSIb3DQEJBTEPFw0xMTAyMDEyMTQwMDJaMCMGCSqGSIb3DQEJBDEWBBQ4O9eBJ0P7M09R7uD+x9Z5oJJ6WTANBgkqhkiG9w0BAQEFAASBgHm4cCbnOplJjY9vGD60J3klgZF9LS6azfZsUpVEM5+KUT7LOrWGyM2k6+/V5R7k+MrEEmfChqeg9WSsFWYYenPulHwsMdCtu66RW1ZaMOH82nTw4hty5jTOO+hBHKvH7lyF0z693aBuBKB8BmJbdOGiTS7J8exPYq+HCGySAuyp-----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 20 minutes).<br/>
<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>
<h2><a id="buy_exe"></a>Standalone imapsync.exe for win32</h2>
<p>Struggle free from source code and Perl installation by<br/>
buying the latest win32 <b>standalone imapsync.exe</b> for <b>22 EUR</b> (~29 USD):</p>
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:
</p>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<p>
<input type="hidden" name="cmd" value="_s-xclick"/>
</p>
<table>
<tr><td><input type="hidden" name="on0" value="Technical support option (+ 80 EUR)"/>Technical support option (+ 80 EUR)</td></tr><tr><td><select name="os0">
<option value="imapsync.exe">imapsync.exe €22,00</option>
<option value="imapsync.exe + technical support">imapsync.exe + technical support €102,00</option>
</select> </td></tr>
</table>
<p>
<input type="hidden" name="currency_code" value="EUR"/>
<input type="hidden" name="encrypted" value="-----BEGIN PKCS7-----MIIH6QYJKoZIhvcNAQcEoIIH2jCCB9YCAQExggEwMIIBLAIBADCBlDCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb20CAQAwDQYJKoZIhvcNAQEBBQAEgYAhRCGFcXchbay2/F3qq46TdeuzWJPfdvDljI3Z6+UUSlOhRKwbrdIE1/eL5/JuEXK5MkAL2jXrox0+sRqCFlKP9GUzPZsdMLlg1J/oD+MUQSeCAalWg9QJJZ60aZoXQkTaj3whcxxNGC8T8R35lq4K8TDiLF4onJ9z4eGwJxI4mTELMAkGBSsOAwIaBQAwggFlBgkqhkiG9w0BBwEwFAYIKoZIhvcNAwcECEqngr2YpkzngIIBQK/lczMJPjh2hWKSw/F4DiNkPOrkZTPlFjGn3WqX1OxolwnvtOVfT/AZCdHmlCkolF6O/oo3MuutzJw7tA9tV+bhb3GpTpxqkvykunZ/73OEQClZLkLBaTJWvJaEEMB4SARShePq3NnPJNH7Hmw07PEsOrZ58zop+NorJM0cRmoa5nJVm7Uj+WAp+JIS4JoDPgjUsdTGVtVTOV7gXKtTQMJgulvr8xcA0BfZCE/tBOndDE9ZLz9ywmndjaX9IhD8dTeUZZ+E/3QaVW2aTzUnrHsaDmm/Ke5pg3MFFpUpusXABQqXgY9M8QSa+ad5QHDFaDELRKF78CAm5Dg4OLFYKsje5kbtx7twVGdajgRarqqlPEbOBwvF8d4CQz1vwZxvLMU9E6o+TMt6NqJgs0dJmFYIHjRRSk6Tu514XLv393sEoIIDhzCCA4MwggLsoAMCAQICAQAwDQYJ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+aW2XUtbEGdwGueHRaPHuewrZ7//yuk7ir2XWTw8+vA==-----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 20 minutes).<br/>
<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>
<!--
@ -186,7 +154,6 @@ 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>Documentation</h2>
<p>Read the <a href="INSTALL">INSTALL</a> file to know how to install imapsync on your system.
@ -208,7 +175,6 @@ See also the <a href="#WANTED">wanted</a> section.
<p>What you can do with imapsync is listed in <a href="COPYING">COPYING</a>.
</p>
<h2><a id="MAILING-LIST"></a>The imapsync mailing list</h2>
<p>
@ -265,7 +231,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 january 2011: <b>1 EUR ~ 1.3 USD</b>.</p>
<p>On february 2011: <b>1 EUR ~ 1.3 USD</b>.</p>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
@ -294,7 +260,7 @@ will be to code it or fix it.<br/>
<tr align="right"><td> Yes</td><td>Fix capability changes </td><td> 1 hour </td><td> 80 min </td><td> 0 $ </td><td> 40 $ </td></tr>
<tr align="right"><td> Yes</td><td>Large mailbox --maxage </td><td> 4 hours </td><td> 270 min </td><td> 0 $ </td><td>160 $ </td></tr>
<tr align="right"><td> Yes</td><td>dkimap support </td><td> 3 hours </td><td> 120 min </td><td> 0 $ </td><td>120 $ </td></tr>
<tr align="right"><td> No</td><td>gratis from here </td><td> 4 hours </td><td> 0 min </td><td> 0 $ </td><td>120000 $ </td></tr>
<tr align="right"><td> No</td><td>gratis from here </td><td> 4 hours </td><td> 0 min </td><td> 0 $ </td><td>60000 $ </td></tr>
</table>
<h2><a id="imap_server_success"></a>Lists of imap server software failures and success stories</h2>
@ -314,8 +280,6 @@ will be to code it or fix it.<br/>
[host2] means "destination server"):
</p>
<ul>
<li>1und1 H mimap1 84498 [host1]</li>
<li>Archiveopteryx 2.03, 2.04, 2.09, 2.10 [host2], 3.0.0 [host2]
@ -332,6 +296,7 @@ will be to code it or fix it.<br/>
v2.2.12-Invoca-RPM-2.2.12-3.RHEL4.1,
2.2.13,
v2.3.1-Invoca-RPM-2.3.1-2.7.fc5,
v2.3.1-Invoca-RPM-2.3.1-2.8.fc5 [host1],
v2.3.7,
(http://asg.web.cmu.edu/cyrus/)
</li>
@ -346,7 +311,7 @@ will be to code it or fix it.<br/>
<li>Eudora WorldMail v2</li>
<li>GMX IMAP4 StreamProxy.</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]</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>MDaemon 7.0.1, 8.0.2, 8.1, 9.5.4 (Windows server 2003 R2 platform)</li>
@ -403,7 +368,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.50 2011/01/18 04:01:20 gilles Exp gilles $)
($Id: index.shtml,v 1.55 2011/02/21 02:16:36 gilles Exp gilles $)
</p>
</body>

81
paypal_reply/paypal_bilan Executable file
View file

@ -0,0 +1,81 @@
#!/usr/bin/perl
use strict;
use warnings;
my $total_usd_received ;
my $total_usd_invoice ;
my $total_eur_received ;
my $total_eur_invoice ;
my $nb_invoice ;
my $line ;
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 $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++ ;
}
}
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
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" ;

View file

@ -1,6 +1,6 @@
#!/usr/bin/perl
# $Id: paypal_build_reply,v 1.8 2010/12/29 23:51:23 gilles Exp gilles $
# $Id: paypal_build_reply,v 1.10 2011/02/02 22:31:41 gilles Exp gilles $
use warnings;
use strict;
@ -8,13 +8,22 @@ use strict;
my ($msg_id_file, $msg_id);
my ($amount, $name, $email);
my (
$buyer, $object, $support, $description,
$paypal_line, $paypal_info,
$buyer, $description,
$url_source, $url_exe, $url, $release,
);
$msg_id_file = $ARGV[1];
$msg_id = firstline($msg_id_file);
while(<>) {
next if ( ! /^(.*Num.+ro de transaction :.*)$/ );
$paypal_line = $1;
$paypal_info = "===== Paypal id =====\n$paypal_line\n";
last;
}
while(<>) {
next if ( ! /^Vous avez re.*paiement d'un montant de (.*) de la part de (.*) \((.*)\)/);
($amount, $name, $email) = ($1, $2, $3);
@ -25,33 +34,7 @@ $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');
# source code wanted
if (('$35,00 USD' eq $amount) or ('$50,00 USD' eq $amount)) {
$object = 'imapsync source code';
$support = '';
$url = $url_source;
}
# win32 binary wanted
if (('$25,00 USD' eq $amount) or ('$15,00 USD' eq $amount)) {
$object = 'imapsync.exe binary';
$support = '';
$url = $url_exe;
}
# source code + technical support wanted
if ('$135,00 USD' eq $amount) {
$object = 'imapsync source code';
$support = "\nI'm ready to help you by email until success (I hope).\n";
$url = $url_source;
}
# win32 binary + technical support wanted
if ('$125,00 USD' eq $amount) {
$object = 'imapsync.exe binary';
$support = "\nI'm ready to help you by email until success (I hope).\n";
$url = $url_exe;
}
#print "[$amount] [$name] [$email] [$paypal_line]\n";
@ -80,7 +63,7 @@ while(<>) {
my $address = 'gilles.lamiral@laposte.net';
my $address2 = 'gilles@lamiral.info';
my $rcstag = '$Id: paypal_build_reply,v 1.8 2010/12/29 23:51:23 gilles Exp gilles $';
my $rcstag = '$Id: paypal_build_reply,v 1.10 2011/02/02 22:31:41 gilles Exp gilles $';
my $message = <<EOM
X-Comment: $rcstag
@ -88,16 +71,24 @@ In-Reply-To: $msg_id
From: Gilles LAMIRAL <$address>
To: <$email>
Bcc: Gilles LAMIRAL <$address>, <$address2>
Subject: [imapsync download] $object release $release [$email]
Subject: [imapsync download] imapsync release $release [$email]
Hello $name,
You will find the latest $object release $release at the following link:
$url
You will find the latest imapsync source code release $release at the following link:
$url_source
You will find the latest imapsync.exe binary release $release at the following link:
$url_exe
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)
I thank you for buying and using imapsync,
I wish you successful transfers!
$support
$paypal_info
$buyer
$description
==== Vendeur ====
@ -123,7 +114,7 @@ EOM
print $message;
#print "[$amount] [$name] [$email] [$object]\n";
#print "[$amount] [$name] [$email] [$paypal_line]\n";
sub firstline {

View file

@ -1,6 +1,6 @@
#!/bin/sh
# $Id: paypal_functions,v 1.10 2011/01/11 01:41:31 gilles Exp gilles $
# $Id: paypal_functions,v 1.12 2011/02/02 22:32:26 gilles Exp gilles $
@ -60,8 +60,8 @@ get_mail() {
extract_mail() {
test -z "`ls $tmpdir/msg_in/`" && echo no mail && return
mkdir -p $tmpdir/msg_out/
test -z "`ls $tmpdir/msg_in/`" && echo no mail && return
(
cd $tmpdir/msg_out/
test -z "`ls .`" || rm -rf *_d
@ -70,23 +70,10 @@ extract_mail() {
#ls -d $tmpdir/msg_out/
}
extract_mail_test() {
test -z "`ls $tmpdir/msg_in/`" && echo no mail && return
mkdir -p $tmpdir/msg_out/
(
cd $tmpdir/msg_out/
test -z "`ls .`" || rm -rf *_d
paypal_mimeexplode ../msg_in/*
)
#ls -d $tmpdir/msg_out/
}
convert_utf8() {
test -z "`ls $tmpdir/msg_out/`" && echo no mail && return
mkdir -p $tmpdir/msg_out_utf8/
test -z "`ls $tmpdir/msg_out/`" && echo no mail && return
for f in $tmpdir/msg_out/*_d/*.txt; do
b=`basename "$f"`
d=`dirname "$f"`
@ -94,9 +81,15 @@ convert_utf8() {
d_utf8="$tmpdir/msg_out_utf8/$bd"
f_utf8="$d_utf8/$b"
test -d "$d_utf8" && continue
echo converting "$f" to "$f_utf8"
mkdir "$d_utf8"
if file "$f" | grep -i UTF-8 > /dev/null
then
echo copying "$f" to "$f_utf8"
cp "$f" "$f_utf8"
else
echo converting "$f" to "$f_utf8"
8859_utf8 "$f" > "$f_utf8"
fi
done
}
@ -123,6 +116,20 @@ build_reply() {
done
}
build_reply_arg() {
for f in "$@"; do
#echo "$f"
d=`dirname "$f"`
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"
paypal_build_reply "$f" "$tmpdir/msg_id/$file_id"
done
}
send_reply() {
mkdir -p $tmpdir/msg_sent/
@ -134,8 +141,10 @@ send_reply() {
test -f "$d_sent/$b" && continue
mkdir -p "$d_sent"
test X"--send" = X"$1" && paypal_send --send "$f" && touch "$d_sent/$b"
#test X"--send" = X"$1" && touch "$d_sent/$b"
test X"" = X"$1" && paypal_send "$f"
done
mailq
}
paypal_all() {

View file

@ -1,11 +1,11 @@
REM $Id: test.bat,v 1.8 2011/01/15 06:30:33 gilles Exp gilles $
REM $Id: test.bat,v 1.9 2011/02/21 02:14:35 gilles Exp gilles $
cd C:\msys\1.0\home\Admin\imapsync
perl -mMail::IMAPClient -mDigest::MD5 -mTerm::ReadKey -mIO::Socket::SSL -mDate::Manip -mFile::Spec -mDigest::HMAC_MD5 -e ''
perl ./imapsync
perl ./imapsync --host1 p --user1 tata --passfile1 secret.tata --host2 p --user2 titi --passfile2 secret.titi --noauthmd5 --delete2 --expunge2
perl ./imapsync --host1 p --user1 tata --passfile1 secret.tata --host2 p --user2 titi --passfile2 secret.titi --noauthmd5 --delete2 --expunge2 --folder INBOX --nofoldersizes
perl ./imapsync --host1 p --user1 tata --passfile1 secret.tata --host2 p --user2 titi --passfile2 secret.titi --noauthmd5 --delete2 --expunge2 --folder INBOX --nofoldersizes --usecache
perl ./imapsync --host1 p --user1 tata --passfile1 secret.tata --host2 p --user2 titi --passfile2 secret.titi --delete2 --expunge2
perl ./imapsync --host1 p --user1 tata --passfile1 secret.tata --host2 p --user2 titi --passfile2 secret.titi --delete2 --expunge2 --folder INBOX --nofoldersizes
perl ./imapsync --host1 p --user1 tata --passfile1 secret.tata --host2 p --user2 titi --passfile2 secret.titi --delete2 --expunge2 --folder INBOX --nofoldersizes --usecache

7
test2.bat Executable file
View file

@ -0,0 +1,7 @@
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

245
tests.sh
View file

@ -1,6 +1,6 @@
#!/bin/sh
# $Id: tests.sh,v 1.143 2011/01/18 02:40:36 gilles Exp gilles $
# $Id: tests.sh,v 1.149 2011/02/21 02:13:52 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.25/lib'
CMD_PERL_3xx='perl -I./Mail-IMAPClient-3.27/lib'
#### Shell pragmas
@ -227,8 +227,6 @@ ll_timeout_ssl() {
}
ll_folder() {
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
@ -597,13 +595,24 @@ ll_maxage()
ll_newmessage()
{
can_send && sendtestmessage
can_send && sendtestmessage
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--maxage 1 --folder INBOX --nofoldersizes
--maxage 1 --folder INBOX --nofoldersizes --noreleasecheck
}
ll_folder_INBOX()
{
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--folder INBOX --noreleasecheck --usecache --delete2 --expunge2
}
@ -854,6 +863,7 @@ ll_useheader_noheader()
}
ll_regexmess()
{
if can_send; then
@ -984,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.25/lib' 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-2.2.9' ll_tls_justconnect ll_tls_justlogin \
&& CMD_PERL='perl -I./Mail-IMAPClient-3.25/lib' ll_tls_justconnect ll_tls_justlogin
&& CMD_PERL='perl -I./Mail-IMAPClient-3.27/lib' ll_tls_justconnect ll_tls_justlogin
}
ll_tls() {
@ -1190,13 +1200,42 @@ msw2() {
xxxxx_gmail() {
! ping -c1 imap.gmail.com || $CMD_PERL ./imapsync \
--host2 imap.gmail.com \
--ssl2 \
--user2 gilles.lamiral@gmail.com \
--passfile2 ../../var/pass/secret.gilles_gmail \
--host1 $HOST2 \
--user1 tata \
--passfile1 ../../var/pass/secret.tata \
--nofoldersizes \
--justfolders --dry --prefix2 '[Gmail]/'
}
gmail_xxxxx() {
! ping -c1 imap.gmail.com || $CMD_PERL ./imapsync \
--host1 imap.gmail.com \
--ssl1 \
--user1 gilles.lamiral@gmail.com \
--passfile1 ../../var/pass/secret.gilles_gmail \
--host2 $HOST2 \
--user2 tata \
--passfile2 ../../var/pass/secret.tata \
--useheader 'Message-Id' \
--useheader="X-Gmail-Received" \
--nofoldersizes \
--prefix1 '[Gmail]/' --dry --justfolders
}
gmail() {
! ping -c1 imap.gmail.com || $CMD_PERL ./imapsync \
--host1 imap.gmail.com \
--ssl1 \
--authmech1 LOGIN \
--user1 gilles.lamiral@gmail.com \
--passfile1 ../../var/pass/secret.gilles_gmail \
--host2 $HOST2 \
@ -1221,7 +1260,6 @@ gmail_gmail() {
--useheader 'Message-Id' --useheader="X-Gmail-Received" \
--regextrans2 's¤INBOX¤inbox_copy¤' \
--folder INBOX \
--authmech1 LOGIN --authmech2 LOGIN \
--allowsizemismatch
}
@ -1238,7 +1276,6 @@ gmail_gmail2() {
--passfile2 ../../var/pass/secret.imapsync.gl_gmail \
--useheader 'Message-Id' --skipsize \
--folder INBOX \
--authmech1 LOGIN --authmech2 LOGIN \
--allowsizemismatch
#--dry # --debug --debugimap # --authmech1 LOGIN
@ -1255,7 +1292,7 @@ allow3xx() {
}
noallow3xx() {
! perl -I./Mail-IMAPClient-3.25/lib ./imapsync \
! perl -I./Mail-IMAPClient-3.27/lib ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
@ -1328,6 +1365,7 @@ ll_usecache() {
--folder INBOX
}
ll_nousecache() {
if can_send; then
sendtestmessage
@ -1344,6 +1382,97 @@ ll_nousecache() {
--folder INBOX
}
ll_useuid_usecache()
{
if can_send; then
sendtestmessage
else
:
fi
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--folder INBOX \
--delete2 --expunge2 \
--useuid
echo 'rm /home/vmail/titi/.yop.yap/cur/*'
}
ll_usecache_noheader() {
if can_send; then
sendtestmessage
else
:
fi
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--usecache --nofoldersizes \
--folder INBOX --useheader ''
}
ll_usecache_debugcache() {
if can_send; then
sendtestmessage
else
:
fi
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--usecache --nofoldersizes \
--folder INBOX --useheader '' --debugcache
}
ll_usecache_debugcache_useuid() {
if can_send; then
sendtestmessage
else
:
fi
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--usecache --nofoldersizes \
--folder INBOX --useheader '' --debugcache --useuid
}
ll_useuid()
{
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--folder INBOX.useuid \
--delete2 --expunge2 \
--useuid
echo 'rm /home/vmail/titi/.yop.yap/cur/*'
}
ll_useuid_nousecache()
{
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--folder INBOX.useuid \
--useuid --nousecache --debugcache
echo 'rm /home/vmail/titi/.yop.yap/cur/*'
}
@ -1351,6 +1480,54 @@ ll_nousecache() {
# specific tests
##########################
exchange_1() {
$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.oneemail --folder INBOX.few_emails --folder INBOX -maxage 1
}
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
# --debugimap1 --dry
}
jong_1_reverse() {
$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
#--nofoldersizes
# --debugimap1 --dry
}
jong_1_lastuid()
{
can_send && sendtestmessage
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 mail.y-publicaties.nl --user2 gillesl \
--passfile2 ../../var/pass/secret.jong \
--sep2 / --prefix2 '' \
--folder INBOX --nofoldersizes --maxage 1
}
jong_2_delete() {
$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 '' \
--delete --folder INBOX
# --debugimap1 --dry
}
gigamail_1() {
$CMD_PERL ./imapsync \
@ -1410,9 +1587,8 @@ big_transfert()
--passfile1 ../../var/pass/secret.gilles_mbox \
--host2 $HOST2 --user2 tete@est.belle \
--passfile2 ../../var/pass/secret.tete \
--noauthmd5 \
--fast --folder INBOX.Junk \
--useheader Message-ID --useheader Received || \
--folder INBOX.Junk.2010 \
--useheader Message-ID || \
true
}
date2=`date`
@ -1427,14 +1603,45 @@ big_transfert_sizes_only()
--passfile1 ../../var/pass/secret.gilles_mbox \
--host2 $HOST2 --user2 tete@est.belle \
--passfile2 ../../var/pass/secret.tete \
--noauthmd5 \
--justfoldersizes --folder INBOX.Junk || \
--justfoldersizes --folder INBOX.Junk.2010 || \
true
}
date2=`date`
echo3 "[$date1] [$date2]"
}
big_transfert_fast()
{
date1=`date`
{ $CMD_PERL ./imapsync \
--host1 $HOST1 --user1 gilles@est.belle \
--passfile1 ../../var/pass/secret.gilles_mbox \
--host2 $HOST2 --user2 tete@est.belle \
--passfile2 ../../var/pass/secret.tete \
--folder INBOX.Junk.2010 \
--fast || \
true
}
date2=`date`
echo3 "[$date1] [$date2]"
}
big_transfert_fast2()
{
date1=`date`
{ $CMD_PERL ./imapsync \
--host1 $HOST1 --user1 gilles@est.belle \
--passfile1 ../../var/pass/secret.gilles_mbox \
--host2 $HOST2 --user2 tete@est.belle \
--passfile2 ../../var/pass/secret.tete \
--folder INBOX.Junk \
--fast || \
true
}
date2=`date`
echo3 "[$date1] [$date2]"
echo2 'rm -f /home/vmail/tete/.Junk/cur/*'
}
dprof_justfoldersizes()
@ -1515,6 +1722,8 @@ locallocal
pidfile
justbanner
nomodules_version
xxxxx_gmail
gmail_xxxxx
gmail
gmail_gmail
gmail_gmail2
@ -1577,11 +1786,15 @@ noallow3xx
ll_memory_consumption
ll_newmessage
ll_usecache
ll_usecache_noheader
ll_usecache_debugcache
ll_nousecache
ll_delete2foldersonly
ll_delete2foldersonly_tmp
ll_delete2foldersbutnot
ll_delete2folders
ll_useuid
ll_useuid_nousecache
'
other_tests='

0
tmp/cache/rr\uee/142_242 vendored Normal file
View file

0
tmp/cache/rr\uee/143_243 vendored Normal file
View file

0
tmp/cache/rr\uee/177_777 vendored Normal file
View file

0
tmp/tests/\y Normal file
View file

0
tmp/tests/lala Normal file
View file

0
tmp/tests/lili Normal file
View file

0
tmp/tests/lolo Normal file
View file