This commit is contained in:
Nick Bebout 2016-09-19 10:15:41 -05:00
parent d0595b7dfd
commit 8d24f07718
110 changed files with 6018 additions and 4489 deletions

322
FAQ
View file

@ -1,5 +1,5 @@
#!/bin/cat
# $Id: FAQ,v 1.216 2015/11/13 23:58:12 gilles Exp gilles $
# $Id: FAQ,v 1.221 2016/03/07 02:55:01 gilles Exp gilles $
+-------------------+
| FAQs for imapsync |
@ -179,7 +179,8 @@ R. To know wether a newer imapsync exists or not imapsync does a http
* Operating System
You can remove this behavior by adding option --noreleasecheck on the
command line (or by setting $releasecheck = 0 in the source code)
command line (or by setting $releasecheck = 0 in the source code)
or by using github release.
=======================================================================
Q. I use --useuid which uses a cache in /tmp or --tmpdir, the hostnames
@ -359,16 +360,21 @@ Q. How can I try imapsync with latest Mail::IMAPClient 3.xx perl module?
Three solutions at least.
R1 - Look at the script named "i3" in the tarball, it can be used to
run imapsync with the included Mail-IMAPClient-3.37/ wherever you
run imapsync with the included Mail-IMAPClient-3.38/ wherever you
unpacked the imapsync tarball
R2 Run:
perl -MCPAN -e "install Mail::IMAPClient"
cpanm Mail::IMAPClient # this uses cpanminus
or
cpan -i Mail::IMAPClient
cpan -i Mail::IMAPClient
or
perl -MCPAN -e "install Mail::IMAPClient"
R3 If you want to install the Perl module locally in a directory
@ -383,10 +389,10 @@ R3 If you want to install the Perl module locally in a directory
- run imapsync with perl and -I option tailing to use the perl
module Mail-IMAPClient-3.xx. Example:
perl -I./Mail-IMAPClient-3.37/lib ./imapsync ...
perl -I./Mail-IMAPClient-3.38/lib ./imapsync ...
or if imapsync is in directory /path/
perl -I./Mail-IMAPClient-3.37/lib /path/imapsync ...
perl -I./Mail-IMAPClient-3.38/lib /path/imapsync ...
=======================================================================
@ -438,88 +444,6 @@ two-ways sync.
A better tool with this scenario is offlineimap,
designed for this issue, and faster than imapsync.
=======================================================================
Q. We have found that the time and date displayed have been changed to
the time at which the file was synchronized.
R. This is the case by default with some email readers like:
- Outlook 2003
- Ipad
but not with:
- Mutt
- Thunderbird
- Zimbra
- Gmail
A thing to keep in mind, imapsync does not touch any byte of messages
unless told to do so by option --regexmess.
Messages on both parts should be identical.
I explain the whole picture about dates of messages.
There are several different dates for any message.
First, there is the "Date:" header. Most of the time, this date is set
by the MUA. MUA means Mail User Agent; it is Outlook, Mutt
or Thunderbird. The Date header is usually the date the message was written
or sent the first time. It is never changed by any transfer or copy.
If an email reader uses the Date header for displaying the date of a
message then no problem should arise.
There is also the internal date. In IMAP the internal date is handled
and normally it corresponds to the arrival date in the mailbox. The
IMAP protocol allows the internal date to be set by a email client.
Imapsync synchronizes internal dates by default, internal dates on host2
should then be the same as the internal dates on host1.
If an email reader uses the internal date for displaying the date of a
message then the sync date problem only occurs when the host2 server software
ignores the internal date given by imapsync during the APPEND imap
command. It happens with some imap servers.
There are also the Received header lines. Each time a message travels
a SMTP server, this one adds a Received header line. Sometimes
some email clients use the last "Received" header date as the date of the
message. And some IMAP servers softwares add a Received line after
and imap transfer. If those both conditions are met then the date
displayed become the transfer date even if imapsync
has done its best to keep all the dates synchronized. Bad luck.
Solutions:
a) Use a better email client or configure it in order it sorts messages
by sent date, the Date header.
b) Use a imap server that respects the imap RFC and accepts
the internal date set by imapsync.
c) Try to understand why the reader shows another date.
For Exchange look at the next FAQ item.
=======================================================================
Q. imapsync calculates 479 messages in a folder but only transfers 400
messages. What's happen?
R1. Unless --useuid is used, imapsync considers a header part
of a message to identify a message on both sides.
By default the header part used is lines "Message-Id:" "Message-ID:"
and "Received:" or specific lines depending on --useheader
--skipheader. Whole header can be set by --useheader ALL
Consequences:
1) Duplicate messages (identical header) are not transferred
several times.
The result is that you can have more messages on host1 than on host2.
R2. With option --useuid imapsync doesn't use headers to identify
messages on both sides but it uses their imap uid. In that case
duplicates on host1 are transferred on host2.
=======================================================================
Q. I need to log every output on a file named log.txt
@ -533,62 +457,6 @@ R2. To change this default name, use --logfile log.txt
imapsync ... --logfile log.txt
=======================================================================
Q. I need to log every output on a file named log.txt and also to the
screen in order to keep seeing what's going on during execution
R. Use the tee program (also available on Windows)
http://en.wikipedia.org/wiki/Tee_%28command%29
http://stackoverflow.com/questions/796476/displaying-windows-command-prompt-output-and-redirecting-it-to-a-file
http://code.google.com/p/wintee/
imapsync ... 2>&1 | tee log.txt
=======================================================================
Q. Can I run more instances of imapsync in parallel on a Windows host.
R. Yes!
Q. Any performance issue?
You have to try and check the transfer rates, sum them up to
have a uniq numeric criteria.
There is always a limit, depending on remote imap servers
and the one running imapsync;
CPU, memory, Inputs/Outputs are the classical bottlenecks,
the worst bottleneck is the winner that sets the limit.
examples/sync_loop_windows.bat says
...
REM ==== Parallel executions ====
REM If you want to do parallel runs of imapsync then this current script is a good start.
REM Just copy it several times and replace, on each copy, the csvfile variable value.
REM Instead of SET csvfile=file.txt write for example
REM SET csvfile=file01.txt in the first copy
REM then also
REM SET csvfile=file02.txt in the second copy etc.
REM Of course you also have to split the data contained in file.txt
REM into file01.txt file02.txt etc.
REM After that, just double-click on each batch file to launch each process
=======================================================================
Q. I run multiple imapsync applications at the same time then get a
warning "imapsync.pid already exists, overwriting it".
Is this a potential problem when trying to sync multiple
IMAP account in parallel?
R1. No issue with the file imapsync.pid if you don't use its content
by yourself.
This file can help you to manage multiple runs by sending signals
to the processes (sigterm or sigkill) using their PID.
Each run can have its own pid file with --pidfile option.
The file imapsync.pid contains the PID of the imapsync process.
This file is removed at the end of a normal run.
You can safely ignore the warning if you don't use imapsync.pid file.
=======================================================================
Q. Quantifier in {,} bigger than 32766 in regex; marked by <-- HERE in
m/(.{ <-- HERE 1,49947})(?:,|$)/ at Mail/IMAPClient.pm line 2121.
@ -697,134 +565,6 @@ R. May be spending too much time on the source server, the connection
timed out on the destination server.
Try options --nofoldersizes
=======================================================================
Q. Does imapsync support IMAP TLS?
R. Use --tls1 and/or --tls2 options
--tls1 tells imapsync to use tls on host1.
--tls2 tells imapsync to use tls on host2.
=======================================================================
Q. Does imapsync support IMAP over SSL (IMAPS)?
R. Yes natively since release 1.161.
still, 2 ways, at least :
a) Use native --ssl1 and/or --ssl2 options
--ssl1 tells imapsync to use ssl on host1.
--ssl2 tells imapsync to use ssl on host2.
b) Use stunnel
http://www.stunnel.org/
Assuming there is an imaps (993) server on imap.foo.org,
on your localhost machine (or bar machine) run :
stunnel -c -d imap -r imap.foo.org:imaps
or using names instead of numbers
stunnel -c -d 143 -r imap.foo.org:993
then use imapsync on localhost (or bar machine) imap (143) port.
If the local port 143 is already taken then use a free one, 10143.
c) Other example for gmail with no root access to open port 143
stunnel -f -P '' -c -d 9993 -r imap.gmail.com:993
Then, to access gmail as host2 use:
imapsync ... --host2 localhost --port2 9993 --nossl2
=======================================================================
Q. How can I manually test a login via ssl?
R. Use ncat or telnet-ssl like in this example:
ncat --ssl -C imap.gmail.com 993
* OK Gimap ready for requests from 78.196.254.58 q1mb175739668wix
a LOGIN "gilles.lamiral@gmail.com" "secret"
* CAPABILITY IMAP4rev1 UNSELECT IDLE NAMESPACE ... ESEARCH
a OK gilles.lamiral@gmail.com Gilles Lamiral authenticated (Success)
b LOGOUT
* BYE LOGOUT Requested
b OK 73 good day (Success)
The client part to type is "a LOGIN ..." and "b LOGOUT" without
the double-quotes.
=======================================================================
Q: How to have an imaps server?
R.
a) Install one
b) or use stunnel :
Assuming there is an imap (143) server on localhost
stunnel -d 993 -r 143 -f
c) or use stunnel on inetd
imaps stream tcp nowait cyrus /usr/sbin/stunnel -s cyrus -p /etc/ssl/certs/imapd.pem -r localhost:imap2
======================================================================
Q. I am transferring mails from one IMAP server to another. I am using
an SSL connection. Transferring huge mails (>10MB) takes ages.
R. try to transfer the mails without SSL connection. SSL code outside
imapsync uses a memory buffer, which gets increased upon reading of
mails by 4096 bytes. This creates a huge load on the host imapsync
runs on by copying the memory buffers for every 4096 byte step.
This does not occur without SSL.
(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"
R. Use:
--exclude "^public\."
or maybe
--exclude '^"public\.'
In the example given the character "." is the folder separator, you
can omit it. Just take the string as it appears on the imapsync
output line :
From folders list : [INBOX] [public.dreams] [etc.]
======================================================================
Q. I want to exclude only INBOX
R. Use:
imapsync ... --exclude "^INBOX$"
A good way to see what will be done is to first use:
imapsync ... --exclude "^INBOX$" --justfolders --nofoldersizes --dry
======================================================================
Q. Can Imapsync filter Spam during the sync?
@ -839,33 +579,6 @@ http://www.stearns.org/doc/spamassassin-setup.current.html#isbg
http://euer.krebsco.de/using-spamassassin-on-a-remote-imap-host.html
https://github.com/ook/isbg
======================================================================
Q. I want to exclude folders matching SPAM no matter the case,
aka how to be case insensitive
R. Use:
imapsync ... --exclude "(?i)spam"
A good way to see what will be done is to first use:
imapsync ... --exclude "(?i)spam" --justfolders --nofoldersizes --dry
======================================================================
Q. I want the --folder "MyFolder" option be recursive.
Two solutions:
R1. Use
--folderrec "MyFolder"
R2. Use --include "^MyFolder"
Then the folder "MyFolder" and all its subfolders will be handled
and only them.
======================================================================
Q. How to migrate from uw-imap with an admin/authuser account?
@ -974,22 +687,19 @@ Q. I want to play with headers line and --regexmess but I want to leave
R. The header/body separation is a blank line so an example:
--regexmess 's{\A(.*?(?! ^$))^Date:(.*?)$}{$1Date:$2\nX-Date:$2}gxms'
Will replace (HeaderBegin and HeaderEnd are not part of the header)
Will replace the next three lines
HeaderBegin
Message-ID: <499EF800.4030002@blabla.fr>
Date: Fri, 20 Feb 2009 19:35:44 +0100
From: Gilles LAMIRAL <lamiral@linux-france.org>
HeaderEnd
by
by the next four lines
HeaderBegin
Message-ID: <499EF800.4030002@blabla.fr>
Date: Fri, 20 Feb 2009 19:35:44 +0100
X-Date: Fri, 20 Feb 2009 19:35:44 +0100
From: Gilles LAMIRAL <lamiral@linux-france.org>
HeaderEnd
This example just add an header line "X-Date:" based on "Date:" line.