From e76c9d209774c6fcb6582b76517b2af6eb9dc532 Mon Sep 17 00:00:00 2001
From: Nick Bebout
Date: Mon, 16 Apr 2012 17:28:48 -0500
Subject: [PATCH] 1.476
---
CREDITS | 24 +-
ChangeLog | 43 +-
FAQ | 77 +-
INSTALL | 18 +-
README | 32 +-
TIME | 3 +
TODO | 48 +-
VERSION | 2 +-
VERSION_EXE | 2 +-
W/paypal_reply/paypal_bilan | 4 +-
W/paypal_reply/paypal_build_invoices | 17 +-
W/paypal_reply/paypal_build_reply | 13 +-
W/paypal_reply/paypal_functions | 4 +-
W/paypal_reply/paypal_send | 18 +-
imapsync | 103 ++-
index.shtml | 131 +--
learn/zzz | 1226 --------------------------
tests.sh | 58 +-
18 files changed, 448 insertions(+), 1375 deletions(-)
delete mode 100644 learn/zzz
diff --git a/CREDITS b/CREDITS
index 02a8b42..5fb735e 100644
--- a/CREDITS
+++ b/CREDITS
@@ -1,5 +1,5 @@
#!/bin/cat
-# $Id: CREDITS,v 1.162 2011/09/21 20:21:14 gilles Exp gilles $
+# $Id: CREDITS,v 1.165 2011/12/10 02:25:01 gilles Exp gilles $
If you want to make a donation to the author, Gilles LAMIRAL,
use any of the following ways:
@@ -30,6 +30,23 @@ 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.
+Thomas Edgar
+Gave a FAQ item "from Exchange 2003 to Cyrus Imap 2.4"
+
+Dan Hulme.
+Found a bug in the FAQ about --regextrans2
+(Fix is --regextrans2 's,${h2_prefix}(.*),${h2_prefix}FOO${h2_sep}$1,')
+Suggested default --useheader 'Message-ID' --useheader 'Received'
+(Exchange compliant)
+
+Ameir Abdeldayem
+Gave a patch to sync messages lacking Message-ID
+http://www.linux-france.org/prj/imapsync_list/msg01151.html
+
+Yousaf Shah
+Contributed by giving the book
+19.90 "Making Things Talk: Using Sensors, Networks, and Arduino to see, hear, and feel your world"
+
Klaus Franken
Patch to avoid useless warning "Use of uninitialized value $uid1 in exists"
@@ -1020,6 +1037,9 @@ Eric Yung
Total amount of book prices :
c \
+19.90+\
+13.59+\
+32.65+\
20.31+\
\
75.00+\
@@ -1150,4 +1170,4 @@ c \
31.20+\
40.00
=
-2963.96
+3050.41
diff --git a/ChangeLog b/ChangeLog
index 660c374..c22609c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,17 +1,52 @@
RCS file: RCS/imapsync,v
Working file: imapsync
-head: 1.468
+head: 1.476
branch:
locks: strict
- gilles: 1.468
+ gilles: 1.476
access list:
symbolic names:
keyword substitution: kv
-total revisions: 468; selected revisions: 468
+total revisions: 476; selected revisions: 476
description:
----------------------------
-revision 1.468 locked by: gilles;
+revision 1.476 locked by: gilles;
+date: 2011/12/10 01:33:50; author: gilles; state: Exp; lines: +34 -8
+Applied Ameir Abdeldayem patch to deal with errors like
+"Host1 Sent/15 size 1428 ignored (no header so we ignore this message)"
+It happens with Sent folder when no Message-Id nor Received header
+are defined in a message.
+----------------------------
+revision 1.475
+date: 2011/12/08 08:23:16; author: gilles; state: Exp; lines: +7 -7
+Default header used to identify a message are now "Message-Id" and "Received".
+----------------------------
+revision 1.474
+date: 2011/12/02 20:30:16; author: gilles; state: Exp; lines: +9 -9
+Default down from 1000 to --split1 500. (Cyrus "Word too long")
+----------------------------
+revision 1.473
+date: 2011/12/01 14:06:23; author: gilles; state: Exp; lines: +8 -8
+Fixed output. fetch_hash_2 no longer exists.
+----------------------------
+revision 1.472
+date: 2011/12/01 12:44:48; author: gilles; state: Exp; lines: +11 -6
+Added start and end dates in the final statistics.
+----------------------------
+revision 1.471
+date: 2011/11/24 09:29:26; author: gilles; state: Exp; lines: +21 -20
+Checked and updated "Similar softwares" section in documentation.
+----------------------------
+revision 1.470
+date: 2011/11/23 18:14:20; author: gilles; state: Exp; lines: +7 -7
+typo
+----------------------------
+revision 1.469
+date: 2011/11/20 17:44:35; author: gilles; state: Exp; lines: +16 -9
+Added --nofilterflags to chech STORE flags ignoring PERMANENTFLAGS (Exchange tests)
+----------------------------
+revision 1.468
date: 2011/11/18 01:23:37; author: gilles; state: Exp; lines: +33 -105
Replaced fetch_hash_2() calls by normal fetch_hash()
----------------------------
diff --git a/FAQ b/FAQ
index 422d489..4265cc9 100644
--- a/FAQ
+++ b/FAQ
@@ -1,5 +1,5 @@
#!/bin/cat
-# $Id: FAQ,v 1.97 2011/11/17 22:14:15 gilles Exp gilles $
+# $Id: FAQ,v 1.100 2011/12/10 01:38:36 gilles Exp gilles $
+------------------+
| FAQ for imapsync |
@@ -139,6 +139,34 @@ Q. Is is legal?
R. Yes, the license permits it
http://imapsync.lamiral.info/COPYING
+=======================================================================
+Q. How can I speed up transfers?
+
+R. By using --useuid imapsync avoid getting messages headers and build
+ a cache. On Unix a good thing is to add also --tmpdir /var/tmp
+ to keep the cache since /tmp is often cleared on reboot.
+
+ imapsync ... --useuid
+
+R. Add also --nofoldersizes since the default behavior is to compute
+ folder sizes. Folder sizes are useless for the transfer, just
+ useful to see what has to be done on each folder.
+
+=======================================================================
+Q. I see warning messages like
+"Host1 Sent/15 size 1428 ignored (no header so we ignore this message)"
+What can I do to transfer those messages?
+
+R1. Use --addheader option, it will add a header like
+ "Message-Id: <15@imapsync>" and transfer the message on host2.
+ Duplicates won't happen in next runs.
+
+ imapsync ... --addheader
+
+R2. Use --useuid then imapsync will avoid dealing with headers.
+
+ imapsync ... --useuid
+
=======================================================================
Q. How can I try imapsync with the new Mail::IMAPClient 3.xx perl library?
@@ -270,7 +298,7 @@ Consequences:
The result is that you can have more messages on host1 than on host2.
R2. With option --useuid imapsync doesn't use headers to identify
-messages on both sides but it uses their imap uid. In than case
+messages on both sides but it uses their imap uid. In that case
duplicates on host1 are transfered on host2.
=======================================================================
@@ -641,6 +669,41 @@ R2. Use --include '^MyFolder'
and only them.
+======================================================================
+Q. How to migrate from or to Exchange 2003 with an admin/authuser
+ account?
+
+R. Thomas Edgar wrote the following
+
+In case you can glean something from this snippet which allowed us
+to migrate from Exchange 2003 t0 Cyrus Imap 2.4 (you would reverse
+the flow to go the other way):
+
+ imapsync --dry --host1 ExchangeServer.mycompany.com \
+ --user1 Some.User@mycompany.com --authuser1 ExchangeAdminAccount \
+ --proxyauth1 --password1 '$pass_with_dollars$' \
+ --host2 cyrusimapbackend.mycompany.com \
+ --user2 SameOrDiffererentUser@mycompany.com \
+ --authuser2 CyrusAdminAccount --proxyauth2
+
+We also needed to:
+
+- Ensure the Exchange Admin Acct had IMAP4 enabled in it's
+ profile (it initially didn't!)
+- Ensure the Some.User Exchange Acct had IMAP4 enabled
+ in it's profile (it initially didn't!)
+- Add the CyrusAdminAccount to admins line in /etc/imapd.conf
+- Give CyrusAdminAccount lrswipkxtecda to the Cyrus Imap account
+ being migrated to (- or in your case, from)
+
+In case you are not aware:
+
+- It will prompt for a password if you don't supply it
+- the domain part of the fully-qualified email could be
+ omitted in our case
+- Use --debugimap when testing initial connectivity, if necessary
+
+
======================================================================
Q. How to migrate from or to Exchange 2007/2010 with an
admin/authuser account?
@@ -786,6 +849,9 @@ Q. Give examples about --regextrans2
R. --regextrans2 is used to transform folder names
+Remember that --regextrans2 applies after the default
+inversion prefix1 <-> prefix2 and sep1 <-> sep2
+
Examples:
0) First try with --dry --justfolders options since imapsync shows the
@@ -809,15 +875,14 @@ Examples:
--regextrans2 's#(.*)#FOO/$1#'
or:
-
-
+
c) Any separator, any prefix solution, FOO is the subfolder:
It is a complicated line because every case is taken into account.
Type it in one line (or with the \ at the end of first line on Unix shells.
- --regextrans2 's,${h1_prefix}(.*),${h2_prefix}FOO${h2_sep}$1,' \
- --regextrans2 's,^INBOX$,${h2_prefix}NEW${h2_sep}INBOX,'
+ --regextrans2 's,${h2_prefix}(.*),${h2_prefix}FOO${h2_sep}$1,' \
+ --regextrans2 's,^INBOX$,${h2_prefix}FOO{h2_sep}INBOX,'
3) to substitute all characters dot "." by underscores "_"
diff --git a/INSTALL b/INSTALL
index 9969b13..c4c5cd5 100644
--- a/INSTALL
+++ b/INSTALL
@@ -1,4 +1,4 @@
-# $Id: INSTALL,v 1.21 2011/11/17 08:07:03 gilles Exp gilles $
+# $Id: INSTALL,v 1.22 2011/12/10 02:27:04 gilles Exp gilles $
#
# INSTALL file for imapsync
# imapsync : IMAP sync or copy tool.
@@ -110,11 +110,23 @@ Here is some individual module help:
- Perl Authen::NTLM
perl -mAuthen::NTLM -e ''
-Everything in one command:
+Test everything in one command:
perl -mMail::IMAPClient -mDigest::MD5 -mTerm::ReadKey -mIO::Socket::SSL \
-mFile::Spec -mDigest::HMAC_MD5 -mAuthen::NTLM -e ''
+You can install automatically those Perl modules via the
+following commands (with root permissions)
+
+ perl -MCPAN -e 'install Mail::IMAPClient'
+ perl -MCPAN -e 'install Digest::MD5'
+ perl -MCPAN -e 'install Term::ReadKey'
+ perl -MCPAN -e 'install IO::Socket::SSL'
+ perl -MCPAN -e 'install File::Spec'
+ perl -MCPAN -e 'install Digest::HMAC_MD5'
+ perl -MCPAN -e 'install Authen::NTLM'
+
+
INSTALLING on Unix
------------------
@@ -122,7 +134,7 @@ To see what will be done, just run:
make -n install
-To install imapsync, just run:
+To install imapsync, just run (as root):
make install
diff --git a/README b/README
index ea85932..34e2e29 100644
--- a/README
+++ b/README
@@ -1,9 +1,9 @@
NAME
imapsync - IMAP synchronisation, sync, copy or migration tool.
Synchronise mailboxes between two imap servers. Good at IMAP migration.
- More than 36 different IMAP server softwares supported with success.
+ More than 44 different IMAP server softwares supported with success.
- $Revision: 1.468 $
+ $Revision: 1.476 $
SYNOPSIS
To synchronise imap account "foo" on "imap.truc.org" to imap account
@@ -111,9 +111,7 @@ DESCRIPTION
sides. Same headers and the transfer is done only once. All flags are
preserved, unread will stay unread, read will stay read, deleted will
stay deleted. You can stop the transfer at any time and restart it
- later, imapsync works well with bad connections. imapsync is CPU hungry
- so nice and renice commands can be a good help. imapsync can be memory
- hungry too, especially with large messages.
+ later, imapsync works well with bad connections.
You can decide to delete the messages from the source mailbox after a
successful transfer (it is a good feature when migrating). In that case,
@@ -125,6 +123,11 @@ DESCRIPTION
You can also just synchronize a mailbox A from another mailbox B in case
you just want to keep a "live" copy of B in A (--delete2 may help)
+ imapsync is not adequate for maintaining two active imap accounts in
+ synchronization where the user plays independently on both sides. Use
+ offlineimap (written by John Goerzen) or mbsync (written by Michael R.
+ Elkins) for 2 ways synchronizations.
+
OPTIONS
To get a description of each option just invoke:
@@ -423,25 +426,22 @@ Links
SIMILAR SOFTWARES
imap_tools : http://www.athensfbc.com/imap_tools
- offlineimap : http://software.complete.org/offlineimap
+ offlineimap : https://github.com/nicolas33/offlineimap
+ mbsync : http://isync.sourceforge.net/
mailsync : http://mailsync.sourceforge.net/
- imapxfer : http://www.washington.edu/imap/
- part of the imap-utils from UW.
- mailutil : replace imapxfer in
- part of the imap-utils from UW.
- http://www.gsp.com/cgi-bin/man.cgi?topic=mailutil
+ mailutil : http://www.washington.edu/imap/
+ part of the UW IMAP tookit.
imaprepl : http://www.bl0rg.net/software/
- http://freshmeat.net/projects/imap-repl/
- imap_migrate : http://freshmeat.net/projects/imapmigration/
+ http://freecode.com/projects/imap-repl/
imapcopy : http://home.arcor.de/armin.diehl/imapcopy/imapcopy.html
migrationtool : http://sourceforge.net/projects/migrationtool/
imapmigrate : http://sourceforge.net/projects/cyrus-utils/
wonko_imapsync: http://wonko.com/article/554
- see also tools/wonko_ruby_imapsync
- isync : http://isync.sourceforge.net/
+ see also file W/tools/wonko_ruby_imapsync
+ exchange-away : http://exchange-away.sourceforge.net/
pop2imap : http://www.linux-france.org/prj/pop2imap/
Feedback (good or bad) will often be welcome.
- $Id: imapsync,v 1.468 2011/11/18 01:23:37 gilles Exp gilles $
+ $Id: imapsync,v 1.476 2011/12/10 01:33:50 gilles Exp gilles $
diff --git a/TIME b/TIME
index 2e06442..6ecb664 100644
--- a/TIME
+++ b/TIME
@@ -1,3 +1,6 @@
+
+180 Release 1.476 --addheader
+ 15 Added start and end dates in the final statistics.
210 Added statistics on ks and lfo, % Operating systems, ip per year .Updated index.shtml
210 Added --nocacheaftercopy and played with dbmail (uids generation are +=2!)
120 Statistics statistics_VERSION_synthesis
diff --git a/TODO b/TODO
index b7e4207..b761f9f 100644
--- a/TODO
+++ b/TODO
@@ -1,16 +1,12 @@
#!/bin/cat
-# $Id: TODO,v 1.104 2011/11/17 15:45:57 gilles Exp gilles $
+# $Id: TODO,v 1.108 2011/12/07 23:59:32 gilles Exp gilles $
TODO file for imapsync
----------------------
-Post on newsgroup comp.mail.imap when a new release comes.
-http://groups.google.fr/group/comp.mail.imap
-
-Post on imapsync mailing-list when a new release comes.
-
Start a wiki for imapsync.
+Write a tutorial.
Add a best practice migration tips document.
Write a Mail::imapsync package and use it.
@@ -22,15 +18,34 @@ http://www.linux-france.org/prj/imapsync_list/msg00307.html
Evaluate
http://www.rackspace.com/apps/email_hosting/migrations
http://www.yippiemove.com/
+http://www.migrationwiz.com/
+Consider /var/tmp/ instead of /tmp (/tmp is destoyed
+on some Unix at reboot)
+
+Add a FAQ entry about long path over than 260 character on Win32.
+
+Fix long path over than 260 character on Win32.
+Think about Digest::SHA or Digest::SHA::PurePerl.
+
+Try to use imapsync with cygwin.
+
+Change default --useheader 'Message-ID' --useheader Date to
+--useheader 'Message-ID' --useheader 'Received'
+because Exchange changes Date header! (but not Received:)
+
+Add an option to solve syncing Sent folder when no good header
+are available:
+http://www.linux-france.org/prj/imapsync_list/msg01151.html
+http://www.linux-france.org/prj/imapsync_list/msg01158.html
+
+
+Check message exists before fetching it (could have been deleted recently)
Find a way to avoid passwords in --debugimap unless needed.
Explain that users can win time/bandwidth by using --expunge
-Fix long path over than 256 character on Win32.
-Think about Digest::SHA or Digest::SHA::PurePerl.
-
Fix "\Forwarded" flag bug in courier.
Does \lalala can be forbidden (courier does a
"16 NO Error in IMAP command received by server"
@@ -152,6 +167,21 @@ http://asg.web.cmu.edu/cyrus/download/imapd/altnamespace.html
===========================================================================
+DONE. Add a script to install automaticaly all needed Perl modules
+if needed. Not a script but command lines in INSTALL file.
+
+DONE. Post on imapsync mailing-list when a new release comes.
+No since I no longer distribute it gratis, imapsync detects
+itself a new release and buyers are informed by a specific
+list. I know some packagers (FreeBSD) use the Changelog file
+to detect an update.
+
+DONE. Subscribe users to imapsync_update mailing-list automatically after the payment.
+(done in paypal_send)
+
+DONE. NO became porn! Post on newsgroup comp.mail.imap when a new release comes.
+http://groups.google.fr/group/comp.mail.imap
+
DONE. The --search option allows this (and many other things)
Add option --exclude_messages_with_flag
diff --git a/VERSION b/VERSION
index 11d932e..aaad981 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-1.468
+1.476
diff --git a/VERSION_EXE b/VERSION_EXE
index 11d932e..aaad981 100644
--- a/VERSION_EXE
+++ b/VERSION_EXE
@@ -1 +1 @@
-1.468
+1.476
diff --git a/W/paypal_reply/paypal_bilan b/W/paypal_reply/paypal_bilan
index 3d914c8..19a8d44 100755
--- a/W/paypal_reply/paypal_bilan
+++ b/W/paypal_reply/paypal_bilan
@@ -1,6 +1,6 @@
#!/usr/bin/perl
-# $Id: paypal_bilan,v 1.37 2011/09/17 22:54:31 gilles Exp gilles $
+# $Id: paypal_bilan,v 1.39 2011/11/30 07:59:11 gilles Exp gilles $
use strict;
use warnings;
@@ -453,7 +453,7 @@ sub compute_line {
my $IND_flag = '' ;
$IND_flag = ' IND' if ('imapsync usage' eq $Nom_Option_1 and 'individual' eq $Valeur_Option_1 ) ;
print "FE $invoice$FR_flag$IND_flag\n" ;
- print "Facture $invoice imapsync$FR_flag $Nom\n" ;
+ print "FE $invoice$FR_flag$IND_flag imapsync $Nom\n" ;
printf( "%.2f [EUR %.2f]\n", $Montant, $MontantEUR ) ;
}
}
diff --git a/W/paypal_reply/paypal_build_invoices b/W/paypal_reply/paypal_build_invoices
index f999034..1db2d8c 100755
--- a/W/paypal_reply/paypal_build_invoices
+++ b/W/paypal_reply/paypal_build_invoices
@@ -1,6 +1,8 @@
#!/bin/sh
-# usage: sh paypal_build_invoices /g/var/paypal_invoices/???
+# $Id: paypal_build_invoices,v 1.22 2011/12/02 04:08:46 gilles Exp gilles $
+
+# usage: sh paypal_build_invoices /g/var/paypal_invoices/????
lyx -e latex /home/gilles/public_html/AGIL/factures/000/facture_imapsync-000.lyx
cp /home/gilles/public_html/AGIL/factures/000/facture_imapsync-000.tex /g/var/paypal_invoices/
@@ -19,11 +21,19 @@ set -x
#/g/public_html/imapsync/W/paypal_reply/paypal_bilan --write_invoices --first_in 999 /g/paypal/paypal_2011_09_complet.csv
#/g/public_html/imapsync/W/paypal_reply/paypal_bilan --write_invoices --first_in 1094 /g/paypal/paypal_2011_10_complet.csv
/g/public_html/imapsync/W/paypal_reply/paypal_bilan --write_invoices --first_in 1185 /g/paypal/paypal_2011_11_complet.csv
+/g/public_html/imapsync/W/paypal_reply/paypal_bilan --write_invoices --first_in 1263 /g/paypal/paypal_2011_12_complet.csv
+: /g/public_html/imapsync/W/paypal_reply/paypal_bilan --first_in 294 --usdeur 1.3385 /g/paypal/paypal_2011_01_complet.csv
+: /g/public_html/imapsync/W/paypal_reply/paypal_bilan --first_in 382 /g/paypal/paypal_2011_02_complet.csv
+: /g/public_html/imapsync/W/paypal_reply/paypal_bilan --first_in 473 /g/paypal/paypal_2011_03_complet.csv
+: /g/public_html/imapsync/W/paypal_reply/paypal_bilan --first_in 570 /g/paypal/paypal_2011_04_complet.csv
+: /g/public_html/imapsync/W/paypal_reply/paypal_bilan --first_in 645 /g/paypal/paypal_2011_05_complet.csv
+: /g/public_html/imapsync/W/paypal_reply/paypal_bilan --first_in 733 /g/paypal/paypal_2011_06_complet.csv
: /g/public_html/imapsync/W/paypal_reply/paypal_bilan --first_in 824 /g/paypal/paypal_2011_07_complet.csv
: /g/public_html/imapsync/W/paypal_reply/paypal_bilan --first_in 917 /g/paypal/paypal_2011_08_complet.csv
: /g/public_html/imapsync/W/paypal_reply/paypal_bilan --first_in 1094 /g/paypal/paypal_2011_10_complet.csv
: /g/public_html/imapsync/W/paypal_reply/paypal_bilan --first_in 1185 /g/paypal/paypal_2011_11_complet.csv
+: /g/public_html/imapsync/W/paypal_reply/paypal_bilan --first_in 1263 /g/paypal/paypal_2011_12_complet.csv
set +x
# La totale
@@ -35,6 +45,9 @@ set +x
--first_in 147 --avoid_numbers '292 293 643 644 731 732 1093' \
/g/paypal/paypal_201?_??_complet.csv
+echo 'sh paypal_build_invoices /g/var/paypal_invoices/1???'
+
+
# USD de 147 à 340
# EUR de 341 à ...
@@ -81,8 +94,6 @@ set +x
# 556 TVA 4,92
# 563 TVA 4,92
-echo 'sh paypal_build_invoices /g/var/paypal_invoices/???'
-
for d in "$@"; do
echo "==== $d ===="
cd $d
diff --git a/W/paypal_reply/paypal_build_reply b/W/paypal_reply/paypal_build_reply
index 326e2d8..9edf6e1 100755
--- a/W/paypal_reply/paypal_build_reply
+++ b/W/paypal_reply/paypal_build_reply
@@ -1,6 +1,6 @@
#!/usr/bin/perl
-# $Id: paypal_build_reply,v 1.16 2011/05/31 21:25:48 gilles Exp gilles $
+# $Id: paypal_build_reply,v 1.17 2011/12/07 23:47:03 gilles Exp gilles $
use warnings;
use strict;
@@ -99,15 +99,18 @@ while(<>) {
my $address = 'gilles.lamiral@laposte.net';
my $address2 = 'gilles@lamiral.info';
-my $rcstag = '$Id: paypal_build_reply,v 1.16 2011/05/31 21:25:48 gilles Exp gilles $';
+my $rcstag = '$Id: paypal_build_reply,v 1.17 2011/12/07 23:47:03 gilles Exp gilles $';
my $download_info = "You will find the latest imapsync.exe binary (release $release_exe)
and the latest imapsync source code (release $release) at the following link:
$url" ;
-my $next_releases ="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 soon)" ;
+my $next_releases =
+"Next imapsync releases will be available to you for one year without extra payment.
+You'll be subscribed to a newsletter [imapsync_update] announcing new releases.
+Just keep this message and ask for the new links in case you miss the newsletter.
+Run imapsync without any argument to know if a new release is available." ;
+
my $thanks_software = "I thank you for buying and using imapsync,
I wish you successful transfers!" ;
diff --git a/W/paypal_reply/paypal_functions b/W/paypal_reply/paypal_functions
index 6565c6d..01f85b8 100755
--- a/W/paypal_reply/paypal_functions
+++ b/W/paypal_reply/paypal_functions
@@ -1,6 +1,6 @@
#!/bin/sh
-# $Id: paypal_functions,v 1.17 2011/05/31 21:26:24 gilles Exp gilles $
+# $Id: paypal_functions,v 1.18 2011/12/02 01:56:55 gilles Exp gilles $
paypal_prerequisites() {
perl -mMIME::Lite -e '' || echo 'sudo aptitude install libmime-lite-perl'
@@ -154,7 +154,7 @@ send_reply() {
debug_mode && echo "paypal_send $f"
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" && paypal_send --send --subscribe "$f" && touch "$d_sent/$b"
#test X"--send" = X"$1" && touch "$d_sent/$b"
test X"" = X"$1" && paypal_send "$f"
done
diff --git a/W/paypal_reply/paypal_send b/W/paypal_reply/paypal_send
index 185ca40..f4515de 100755
--- a/W/paypal_reply/paypal_send
+++ b/W/paypal_reply/paypal_send
@@ -1,6 +1,6 @@
#!/usr/bin/perl
-# $Id: paypal_send,v 1.3 2010/12/29 23:50:24 gilles Exp gilles $
+# $Id: paypal_send,v 1.7 2011/12/02 02:36:28 gilles Exp gilles $
use strict;
use warnings;
@@ -11,6 +11,7 @@ my (
$help,
$debug,
$send,
+ $subscribe,
);
my $numopt = scalar(@ARGV);
@@ -18,6 +19,7 @@ my $opt_ret = GetOptions(
"help" => \$help,
"debug!" => \$debug,
"send!" => \$send,
+ "subscribe!" => \$subscribe,
);
usage() and exit if ($help or ! $numopt or ! $opt_ret) ;
@@ -46,10 +48,18 @@ $message->build(%header);
$message->build(Data => $data);
$message->print(\*STDOUT);
+my $dest = $header{ 'To:' } ;
-if ($send) {
- $message->send;
- print "Sent to ", $header{'To:'},"\n";
+if ( $send ) {
+ $message->send ;
+ print "\nSent to $dest\n" ;
+}
+
+if ( $subscribe ) {
+ print "\necho '$dest' | add_members --regular-members-file=- --welcome-msg=y imapsync_update\n" ;
+ my $out = `echo '$dest' | sudo add_members --regular-members-file=- --welcome-msg=y imapsync_update` ;
+ print $out ;
+ print "Subscribed $dest\n" ;
}
diff --git a/imapsync b/imapsync
index 6d2caea..b0eb113 100755
--- a/imapsync
+++ b/imapsync
@@ -17,10 +17,10 @@
imapsync - IMAP synchronisation, sync, copy or migration tool.
Synchronise mailboxes between two imap servers.
-Good at IMAP migration. More than 36 different IMAP server softwares
+Good at IMAP migration. More than 44 different IMAP server softwares
supported with success.
-$Revision: 1.468 $
+$Revision: 1.476 $
=head1 SYNOPSIS
@@ -140,9 +140,7 @@ and the transfer is done only once. All flags are
preserved, unread will stay unread, read will stay read,
deleted will stay deleted. You can stop the transfer at any
time and restart it later, imapsync works well with bad
-connections. imapsync is CPU hungry so nice and renice
-commands can be a good help. imapsync can be memory hungry too,
-especially with large messages.
+connections.
You can decide to delete the messages from the source mailbox
after a successful transfer (it is a good feature when migrating).
@@ -156,6 +154,12 @@ You can also just synchronize a mailbox A from another mailbox B
in case you just want to keep a "live" copy of B in A (--delete2
may help)
+imapsync is not adequate for maintaining two active imap accounts
+in synchronization where the user plays independently on both sides.
+Use offlineimap (written by John Goerzen) or mbsync (written by
+Michael R. Elkins) for 2 ways synchronizations.
+
+
=head1 OPTIONS
To get a description of each option just invoke:
@@ -496,28 +500,25 @@ Entries for imapsync:
=head1 SIMILAR SOFTWARES
imap_tools : http://www.athensfbc.com/imap_tools
- offlineimap : http://software.complete.org/offlineimap
+ offlineimap : https://github.com/nicolas33/offlineimap
+ mbsync : http://isync.sourceforge.net/
mailsync : http://mailsync.sourceforge.net/
- imapxfer : http://www.washington.edu/imap/
- part of the imap-utils from UW.
- mailutil : replace imapxfer in
- part of the imap-utils from UW.
- http://www.gsp.com/cgi-bin/man.cgi?topic=mailutil
+ mailutil : http://www.washington.edu/imap/
+ part of the UW IMAP tookit.
imaprepl : http://www.bl0rg.net/software/
- http://freshmeat.net/projects/imap-repl/
- imap_migrate : http://freshmeat.net/projects/imapmigration/
+ http://freecode.com/projects/imap-repl/
imapcopy : http://home.arcor.de/armin.diehl/imapcopy/imapcopy.html
migrationtool : http://sourceforge.net/projects/migrationtool/
imapmigrate : http://sourceforge.net/projects/cyrus-utils/
wonko_imapsync: http://wonko.com/article/554
- see also tools/wonko_ruby_imapsync
- isync : http://isync.sourceforge.net/
+ see also file W/tools/wonko_ruby_imapsync
+ exchange-away : http://exchange-away.sourceforge.net/
pop2imap : http://www.linux-france.org/prj/pop2imap/
Feedback (good or bad) will often be welcome.
-$Id: imapsync,v 1.468 2011/11/18 01:23:37 gilles Exp gilles $
+$Id: imapsync,v 1.476 2011/12/10 01:33:50 gilles Exp gilles $
=cut
@@ -571,7 +572,7 @@ my(
@folder, @include, @exclude, @folderrec,
$prefix1, $prefix2,
@regextrans2, @regexmess, @regexflag,
- $flagsCase,
+ $flagsCase, $filterflags,
$sep1, $sep2,
$syncinternaldates,
$idatefromheader,
@@ -625,13 +626,14 @@ my(
$delete2folders, $delete2foldersonly, $delete2foldersbutnot,
$usecache, $debugcache, $cacheaftercopy,
$wholeheaderifneeded, %h1_msgs_copy_by_uid, $useuid, $h2_uidguess,
+ $addheader,
);
# main program
# global variables initialisation
-$rcs = '$Id: imapsync,v 1.468 2011/11/18 01:23:37 gilles Exp gilles $ ';
+$rcs = '$Id: imapsync,v 1.476 2011/12/10 01:33:50 gilles Exp gilles $ ';
$total_bytes_transferred = 0;
$total_bytes_skipped = 0;
@@ -695,6 +697,9 @@ $wholeheaderifneeded = defined( $wholeheaderifneeded ) ? $wholeheaderifneeded
# turn on RFC standard flags correction like \SEEN -> \Seen
$flagsCase = defined( $flagsCase ) ? $flagsCase : 1 ;
+# Use PERMANENTFLAGS if available
+$filterflags = defined( $filterflags ) ? $filterflags : 1 ;
+
# turn on relogin 5 by default
$relogin1 = defined( $relogin1 ) ? $relogin1 : 5 ;
$relogin2 = defined( $relogin2 ) ? $relogin2 : 5 ;
@@ -723,8 +728,8 @@ check_lib_version() or
exit_clean(0) if ($justbanner);
# By default, 1000 at a time, not more.
-$split1 ||= 1000;
-$split2 ||= 1000;
+$split1 ||= 500;
+$split2 ||= 500;
$host1 || missing_option("--host1") ;
$port1 ||= (defined $ssl1 and !defined $tls1) ? 993 : 143;
@@ -848,7 +853,7 @@ $fastio2 = (defined($fastio2)) ? $fastio2 : 0;
$reconnectretry1 = (defined($reconnectretry1)) ? $reconnectretry1 : 3;
$reconnectretry2 = (defined($reconnectretry2)) ? $reconnectretry2 : 3;
-@useheader = ( "Message-Id", "Message-ID", "Date" ) unless ( @useheader ) ;
+@useheader = ( "Message-Id", "Message-ID", "Received" ) unless ( @useheader ) ;
my %useheader ;
@@ -1188,7 +1193,7 @@ FOLDER: foreach my $h1_fold (@h1_folders_wanted) {
$debug and print "Host1 getting flags idate and sizes of folder [$h1_fold] took ", timenext(), " s\n";
unless ($h1_fir_ref) {
print
- "Host1 folder $h1_fold: Could not fetch_hash_2 ",
+ "Host1 folder $h1_fold: Could not fetch_hash ",
scalar(@h1_msgs), " msgs: ", $imap1->LastError, "\n";
$nb_errors++;
next FOLDER;
@@ -1223,7 +1228,7 @@ FOLDER: foreach my $h1_fold (@h1_folders_wanted) {
$debug and print "Host2 parsing headers of folder [$h2_fold] took ", timenext(), " s\n" ;
$debug and print "Host2 getting flags idate and sizes of folder [$h2_fold]\n" ;
- @$h2_fir_ref{@h2_msgs} = ( ); # fetch_hash_2 can select by uid with last arg as ref
+ @$h2_fir_ref{@h2_msgs} = ( ); # fetch_hash can select by uid with last arg as ref
$h2_fir_ref = $imap2->fetch_hash("FLAGS", "INTERNALDATE", "RFC822.SIZE", $h2_fir_ref)
if (@h2_msgs);
$debug and print "Host2 getting flags idate and sizes of folder [$h2_fold] took ", timenext(), " s\n" ;
@@ -1407,11 +1412,14 @@ sub sync_flags {
my $h1_flags = $h1_fir_ref->{ $h1_msg }->{ "FLAGS" } || '' ;
my $h2_flags = $h2_fir_ref->{ $h2_msg }->{ "FLAGS" } || '' ;
+ ( $debug or $debugflags ) and
+ print "init msg h1 $h1_fold/$h1_msg flags( $h1_flags ) h2 $h2_fold/$h2_msg flags( $h2_flags )\n" ;
+
# RFC 2060: This flag can not be altered by any client
$h1_flags =~ s@\\Recent\s?@@gi ;
$h1_flags = flags_regex( $h1_flags ) if @regexflag;
$h1_flags = flagsCase( $h1_flags ) if $flagsCase ;
- $h1_flags = flags_filter( $h1_flags, $permanentflags2) if ( $permanentflags2 ) ;
+ $h1_flags = flags_filter( $h1_flags, $permanentflags2) if ( $permanentflags2 and $filterflags ) ;
# compare flags - set flags if there a difference
my @h1_flags = sort split(' ', $h1_flags );
@@ -1419,7 +1427,7 @@ sub sync_flags {
my $diff = compare_lists( \@h1_flags, \@h2_flags );
#$diff = 1 ;
- $debugflags and print "msg h1 $h1_fold/$h1_msg flags( $h1_flags ) h2 $h2_fold/$h2_msg flags( $h2_flags )\n" ;
+ ( $debug or $debugflags ) and print "filt msg h1 $h1_fold/$h1_msg flags( $h1_flags ) h2 $h2_fold/$h2_msg flags( $h2_flags )\n" ;
$diff and ( $debug or $debugflags )
and print "msg $h2_fold/$h2_msg replacing h2 flags( $h2_flags ) with h1 flags( $h1_flags )\n";
# This sets flags so flags can be removed with this
@@ -1837,8 +1845,8 @@ sub banner_imapsync {
my @argv_copy = @_;
my $banner_imapsync = join("",
'$RCSfile: imapsync,v $ ',
- '$Revision: 1.468 $ ',
- '$Date: 2011/11/18 01:23:37 $ ',
+ '$Revision: 1.476 $ ',
+ '$Date: 2011/12/10 01:33:50 $ ',
"\n",localhost_info(), "\n",
"Command line used:\n",
"$0 ", command_line_nopassword(@argv_copy), "\n",
@@ -2289,7 +2297,7 @@ sub foldersizes {
printf ( "Nb messages: %11s\n", $total_nb ) ;
printf ( "Total size: %11s bytes\n", $total_size ) ;
printf ( "Biggest message: %11s bytes\n", $biggest ) ;
- printf ( "Time: %11s secondes\n", timenext( ) ) ;
+ printf ( "Time: %11s seconds\n", timenext( ) ) ;
}
sub timenext {
@@ -2693,6 +2701,11 @@ sub copy_message {
$debug and print "header date from host1: [$h1_date] (fixed)\n";
}
+ if ( $addheader and defined $h1_fir_ref->{$h1_msg}->{"NO_HEADER"} ) {
+ my $header = add_header( $h1_msg ) ;
+ $debug and print "msg $h1_fold/$h1_msg adding custom header [$header]\n" ;
+ $string = $header . "\r\n" . $string ;
+ }
# RFC 2060: This flag can not be altered by any client
$h1_flags =~ s@\\Recent\s?@@gi;
$h1_flags = flags_regex($h1_flags) if @regexflag;
@@ -3260,6 +3273,9 @@ sub stats {
$timeend = time();
$timediff = $timeend - $timestart;
+ my $timestart_str = localtime( $timestart ) ;
+ my $timeend_str = localtime( $timeend ) ;
+
my $memory_consumption = memory_consumption();
my $memory_ratio = ($max_msg_size_in_bytes) ?
sprintf('%.1f', $memory_consumption / $max_msg_size_in_bytes) : "NA";
@@ -3268,6 +3284,8 @@ sub stats {
my $host2_reconnect_count = $imap2->Reconnect_counter() || 0;
print "++++ Statistics\n";
+ print "Transfer started on : $timestart_str\n";
+ print "Transfer ended on : $timeend_str\n";
print "Transfer time : $timediff sec\n";
print "Messages transferred : $nb_msg_transferred ";
print "(could be $nb_msg_skipped_dry_mode without dry mode)" if ($dry);
@@ -3355,6 +3373,7 @@ sub get_options {
"regextrans2=s" => \@regextrans2,
"regexmess=s" => \@regexmess,
"regexflag=s" => \@regexflag,
+ "filterflags!" => \$filterflags,
"flagsCase!" => \$flagsCase,
"delete!" => \$delete,
"delete2!" => \$delete2,
@@ -3424,6 +3443,7 @@ sub get_options {
"cacheaftercopy!" => \$cacheaftercopy,
"debugcache!" => \$debugcache,
"useuid!" => \$useuid,
+ "addheader!" => \$addheader,
);
$debug and print "get options: [$opt_ret]\n";
@@ -3518,6 +3538,13 @@ sub parse_header_msg {
}
}
+ if ( ( ! $headstr) and ( $addheader ) and ( $s eq "Host1" )){
+ my $header = add_header( $m_uid ) ;
+ print "Host1 uid $m_uid no header found so adding our own [$header]\n";
+ $headstr .= uc( $header ) ;
+ $s_fir->{$m_uid}->{"NO_HEADER"} = 1;
+ }
+
return() if ( ! $headstr );
my $size = $s_fir->{$m_uid}->{"RFC822.SIZE"};
@@ -3606,7 +3633,7 @@ sub check_last_release {
}
sub imapsync_version {
- my $rcs = '$Id: imapsync,v 1.468 2011/11/18 01:23:37 gilles Exp gilles $ ';
+ my $rcs = '$Id: imapsync,v 1.476 2011/12/10 01:33:50 gilles Exp gilles $ ';
$rcs =~ m/,v (\d+\.\d+)/;
my $VERSION = ($1) ? $1: "UNKNOWN";
return($VERSION);
@@ -3896,7 +3923,7 @@ sub usage_complete {
--reconnectretry2 : same as --reconnectretry1 but for host2
--split1 : split the requests in several parts on host1.
is the number of messages handled per request.
- default is like --split1 1000.
+ default is like --split1 500.
--split2 : same thing on host2.
--timeout : imap connect timeout.
@@ -4382,12 +4409,24 @@ sub tests_epoch {
ok( '1282658400' eq epoch( '24-Aug-2010 14:01:00 +0001' ), 'epoch 24-Aug-2010 14:01:00 +0001 -> 1282658400' ) ;
}
+sub add_header {
+ my $uid = shift || 'mistake' ;
+ my $header = 'Message-Id: <' . $uid . '@imapsync>' ;
+ return( $header ) ;
+}
+
+sub tests_add_header {
+ ok( 'Message-Id: ' eq add_header(), 'add_header no arg' ) ;
+ ok( 'Message-Id: <123456789@imapsync>' eq add_header(123456789), 'add_header 123456789' ) ;
+
+}
+
+
sub tests_debug {
SKIP: {
skip "No test in normal run" if ( not $tests_debug );
- tests_good_date();
- tests_epoch( ) ;
+ tests_add_header( ) ;
}
}
diff --git a/index.shtml b/index.shtml
index cb2253b..c1a0071 100644
--- a/index.shtml
+++ b/index.shtml
@@ -5,7 +5,7 @@
Imapsync: an IMAP migration tool ( release )
-
+
@@ -31,7 +31,7 @@
@@ -44,23 +44,27 @@
What is imapsync?
imapsync software is a command line tool allowing incremental and
-recursive imap transfers from one mailbox to another, both anywhere on the internet
-or in your local network.
+recursive IMAP transfers from one mailbox to another, both anywhere on the internet
+or in your local network. Incremental means you can stop the transfer at any time
+and restart it later efficiently. Recursive means all folders hierarchy can be copied.
imapsync is useful for imap account migration or imap account backup.
-imapsync is not adequate for maintaining two active imap accounts in synchronization
-where the user plays independently on both sides. Use offlineimap
-(written by John Goerzen) for this purpose.
+
+
imapsync is not adequate for maintaining two active imap accounts
+in synchronization where the user plays independently on both sides.
+Use offlineimap (written by John Goerzen)
+or mbsync (written by Michael R. Elkins)
+for 2 ways synchronizations.
Some numbers for 2011
- Number of imapsync users per month: between 2 and 3 thousands users
-- Number of imapsync transfers per month: between 3 and 11 millions transfers
+- Number of imapsync transfers per month: between 3 and 11 millions mailboxes transfers
- Pourcentage between operating systems users running imapsync:
- Linux: 65 %
@@ -142,18 +146,26 @@ where the user plays independently on both sides. Use offlineimap
imapsync mailing-list (see below section Mailing-List).
-Buy imapsync source code
-
-The Perl imapsync source code will run anywhere a Perl interpreter can run: any Unix, Linux, Windows, or Mac OS operating system.
-
+
+Buy imapsync source code
Buy latest imapsync Perl source code for 30 EUR
+
+
++ One year of imapsync updates without extra payment.
++ 30 days money-back guarantee!
++ A little support.
+
+
30 EUR is equal to around 45 USD, no problem to pay in USD (or any currency) with paypal:
+
+The Perl imapsync source code will run anywhere a Perl interpreter can run: any Unix, Linux, Windows, or Mac OS operating system.
+
-
-
-You will receive a download link just after the payment.
-One year of imapsync updates without extra payment.
-30 days money-back guarantee!
+You will receive a download link just after the payment.
+
Buy professional support for imapsync
+You will be able to expose your issues by email or phone and to converse until your issues are solved.
+
+
For 180 EUR buy imapsync support by the developper who wrote and maintains imapsync.
@@ -197,14 +209,22 @@ name="submit" alt="PayPal - The safer, easier way to pay online!"/>
-Then you will be able to expose your issues by email or phone and to converse until your issues are solved.
-
Buy standalone imapsync.exe for win32
+
+
+
Struggle free from source code and Perl installation by
buying the latest win32 standalone imapsync.exe for 30 EUR
+
++ One year of imapsync updates without extra payment.
++ 30 days money-back guarantee!
++ A little support.
+
+
+
30 EUR is equal to around 45 USD, no problem to pay in USD (or any currency) with paypal:
@@ -225,8 +245,7 @@ name="submit" alt="PayPal - The safer, easier way to pay online!"/>
You will receive a download link just after the payment.
-One year of imapsync updates without extra payment.
-30 days money-back guarantee!
+
This document last modified on
-($Id: index.shtml,v 1.97 2011/11/18 16:11:33 gilles Exp gilles $)
+($Id: index.shtml,v 1.99 2011/11/24 09:38:35 gilles Exp gilles $)