2011-03-12 03:43:55 +01:00
|
|
|
|
|
|
|
+------------------+
|
|
|
|
| FAQ for imapsync |
|
|
|
|
+------------------+
|
|
|
|
|
2011-03-12 03:44:16 +01:00
|
|
|
=======================================================================
|
2011-03-12 03:44:17 +01:00
|
|
|
Q. We have found that the sent time and date have been changed to the
|
|
|
|
time at which the file was synchronised.
|
2011-03-12 03:44:16 +01:00
|
|
|
|
2011-03-12 03:44:26 +01:00
|
|
|
R. This is the case with:
|
|
|
|
- Eudora
|
|
|
|
- Zimbra
|
|
|
|
but not with
|
|
|
|
- Mutt
|
|
|
|
- Thunderbird
|
|
|
|
|
2011-03-12 03:44:16 +01:00
|
|
|
Eurora shows by default the time the imap server received the email.
|
|
|
|
I think it is quite a strong behavior since the messages can
|
|
|
|
have travelled some time before the reception.
|
|
|
|
|
|
|
|
The sent time and date are given by the "Date:" header
|
|
|
|
and it is set most of the time by the MUA (Mail User Agent,
|
|
|
|
Mutt, Eudora, Thunderbird etc.).
|
|
|
|
|
|
|
|
imapsync does not touch any header since the
|
|
|
|
header is used to identify the messages in
|
|
|
|
both parts.
|
|
|
|
|
2011-03-12 03:44:21 +01:00
|
|
|
Solutions:
|
|
|
|
a) Don't use buggy Eudora.
|
2011-03-12 03:44:16 +01:00
|
|
|
b) Use the --syncinternaldates option and keep using Eudora :-)
|
|
|
|
|
2011-03-12 03:44:26 +01:00
|
|
|
|
|
|
|
=======================================================================
|
|
|
|
Q. imapsync failed with a "word too long" error from the imap server,
|
|
|
|
What can I do ?
|
|
|
|
|
|
|
|
R. Use imapsync release 1.172 or at least 1.166 with options
|
|
|
|
--split1 500 --split2 500
|
|
|
|
or a old old imapsync (before 1.94)
|
|
|
|
|
2011-03-12 03:44:17 +01:00
|
|
|
=======================================================================
|
|
|
|
Q. Does imapsync support IMAP over TLS (IMAPS)?
|
|
|
|
|
2011-03-12 03:44:23 +01:00
|
|
|
R. Yes natively since release 1.161.
|
|
|
|
still, 2 ways, at least :
|
|
|
|
|
|
|
|
a) Use --ssl1 and/or --ssl2 options
|
|
|
|
|
|
|
|
--ssl1 tells imapsync to use ssl on host1
|
|
|
|
--ssl2 tells imapsync to use ssl on host2
|
2011-03-12 03:44:17 +01:00
|
|
|
|
|
|
|
|
|
|
|
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
|
2011-03-12 03:44:23 +01:00
|
|
|
or using names instead of numbers
|
2011-03-12 03:44:17 +01:00
|
|
|
stunnel -c -d 143 -r imap.foo.org:993
|
|
|
|
then use imapsync on localhost (or bar machine) imap (143) port.
|
|
|
|
|
2011-03-12 03:44:16 +01:00
|
|
|
|
2011-03-12 03:44:23 +01:00
|
|
|
=======================================================================
|
|
|
|
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
|
2011-03-12 03:44:21 +01:00
|
|
|
|
2011-03-12 03:44:23 +01:00
|
|
|
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
|
2011-03-12 03:44:21 +01:00
|
|
|
|
2011-03-12 03:44:26 +01:00
|
|
|
=======================================================================
|
|
|
|
Q: Multiple copies when I run imapsync twice ore more.
|
|
|
|
|
|
|
|
R. Multiple copies of the emails on the destination
|
|
|
|
server. Some IMAP servers (Domino for example) add some
|
|
|
|
headers for each message transfered. The message is
|
|
|
|
transfered again and again each time you run imapsync. This
|
|
|
|
is bad of course. The explanation is that imapsync considers
|
|
|
|
the message is not the same since headers have changed (one
|
|
|
|
line added) and size too (the header part). You can look at
|
|
|
|
the headers found by imapsync by using the --debug option
|
|
|
|
(and search for the message on both part). The way to avoid
|
|
|
|
this problem is by using options --skipheader and
|
|
|
|
--skipsize, like this (avoid headers beginning whith the
|
|
|
|
string "X-"):
|
|
|
|
|
|
|
|
imapsync ... --skipheader '^X-' --skipsize
|
|
|
|
|
|
|
|
You can use --skipheader only one time; if you need to skip
|
|
|
|
several different headers use the "or" perl regex caracter
|
|
|
|
which is "|". Example:
|
|
|
|
|
|
|
|
imapsync ... --skipheader '^X-|^Status|^Bcc'
|
|
|
|
|
|
|
|
|
2011-03-12 03:44:21 +01:00
|
|
|
======================================================================
|
|
|
|
Q. I want the --folder 'MyFolder' option be recurse.
|
|
|
|
|
|
|
|
R. Do not use the --folder option.
|
|
|
|
Instead, use --include '^MyFolder'
|
2011-03-12 03:44:25 +01:00
|
|
|
Then the folder "MyFolder" and all its subfolders will be handled
|
|
|
|
and only them.
|
|
|
|
|
|
|
|
======================================================================
|
|
|
|
Q. How to migrate from cyrus with an admin account ?
|
|
|
|
|
|
|
|
R. Use
|
|
|
|
--ssl1 --authuser1 AdminAccount ----password1 AdminAccountPassword
|
2011-03-12 03:44:26 +01:00
|
|
|
|
|
|
|
Do not forget the option --ssl1 since PLAIN auth is only
|
|
|
|
supported with tls encryption most of the time.
|
|
|
|
|
2011-03-12 03:44:25 +01:00
|
|
|
Here is an example:
|
|
|
|
imapsync \
|
|
|
|
--host1 server1 \
|
|
|
|
--ssl1 \
|
|
|
|
--host2 server2 \
|
|
|
|
--authuser1 AdminAccount \
|
|
|
|
--password1 AdminAccountPassword \
|
|
|
|
--user1 joe \
|
|
|
|
--user2 joe \
|
|
|
|
--password2 joespassonserver2 \
|
|
|
|
--exclude '^user\.'
|
|
|
|
|
2011-03-12 03:44:21 +01:00
|
|
|
|
2011-03-12 03:44:20 +01:00
|
|
|
======================================================================
|
|
|
|
Q. I have moved from Braunschweig to Graz, so I would like to have my whole
|
|
|
|
Braunschweig mail sorted into a folder INBOX.Braunschweig of my new mail
|
|
|
|
account.
|
|
|
|
|
|
|
|
R.
|
|
|
|
1) First try (safe mode):
|
|
|
|
|
|
|
|
imapsync \
|
|
|
|
...
|
|
|
|
--regextrans2 's/INBOX(.*)/INBOX.Braunschweig$1/' \
|
|
|
|
--dry --justfolders
|
|
|
|
|
|
|
|
2) See if the output says everything you want imapsync to do,
|
|
|
|
--dry option is safe and does nothing real.
|
|
|
|
|
|
|
|
3) Remove --dry
|
|
|
|
Check the imap folder tree on the target side
|
|
|
|
|
|
|
|
4) Remove --justfolders
|
|
|
|
|
|
|
|
=======================================================================
|
|
|
|
Q. Give examples about --regextrans2
|
|
|
|
|
|
|
|
R. Examples:
|
|
|
|
|
|
|
|
1) To remove INBOX. in the name of destination folders:
|
|
|
|
--regextrans2 's/^INBOX\.(.+)/$1/'
|
|
|
|
|
|
|
|
2) To sync a complete account in a subfolder called FOO:
|
|
|
|
--regextrans2 's/^INBOX(.*)/INBOX.FOO$1/'
|
|
|
|
|
2011-03-12 03:44:22 +01:00
|
|
|
=======================================================================
|
|
|
|
Q. I would like to move emails from InBox to a sub-folder
|
|
|
|
called , say "2005-InBox" based on the date (Like all emails
|
|
|
|
received in the Year 2005 should be moved to the folder
|
|
|
|
called "2005-InBox").
|
|
|
|
|
|
|
|
R. 2 ways :
|
|
|
|
|
|
|
|
a) Manually:
|
|
|
|
------------
|
|
|
|
|
|
|
|
1) You create a folder INBOX.2005-INBOX
|
|
|
|
2) Mostly every email software allow sorting by date.
|
|
|
|
In inbox, you select from 1 january to 31 december
|
|
|
|
messages with the shift key.
|
|
|
|
3) Cut/paste in INBOX.2005-INBOX
|
|
|
|
|
|
|
|
b) With imapsync:
|
|
|
|
-----------------
|
|
|
|
|
2011-03-12 03:44:23 +01:00
|
|
|
You have to calculate the day of year (and
|
|
|
|
add 365). For example, running it today,
|
|
|
|
Sat Mar 11 13:06:01 CET 2006:
|
2011-03-12 03:44:22 +01:00
|
|
|
|
|
|
|
imapsync ...
|
|
|
|
--host1 imap.truc.org --host2 imap.trac.org \
|
|
|
|
--user1 foo --user2 foo \
|
|
|
|
...
|
|
|
|
--maxage 435 --minage 70 \
|
|
|
|
--regextrans2 's/^INBOX$/INBOX.2005-INBOX/' \
|
|
|
|
--folder INBOX
|
|
|
|
|
|
|
|
|
|
|
|
To know the day of year:
|
|
|
|
|
|
|
|
$ date
|
|
|
|
Sat Mar 11 13:06:01 CET 2006
|
|
|
|
|
|
|
|
$ date +%j
|
|
|
|
070
|
|
|
|
|
|
|
|
Also, you must take imapsync 1.159 at least since I tested
|
|
|
|
what I just wrote above and found 2 bugs about --mindate
|
|
|
|
--maxdate options behavior.
|
|
|
|
|
2011-03-12 03:44:23 +01:00
|
|
|
|
|
|
|
=======================================================================
|
|
|
|
Q. My imap server does not accept a message and warns
|
|
|
|
"Invalid header". What is the problem ?
|
|
|
|
|
|
|
|
R. You fall in the classical mbox versus Maildir/ format
|
|
|
|
problem. May be you use a misconfigured procmail rule.
|
|
|
|
|
|
|
|
A header beginning like the following one is in the mbox
|
|
|
|
format, header line 1 has no colon behind "From", header
|
|
|
|
lines 2 through N do have a colon :
|
|
|
|
|
|
|
|
From foo@yoyo.org Sat Jun 22 01:10:21 2002
|
|
|
|
Return-Path: <foo@yoyo.org>
|
|
|
|
Received: ...
|
|
|
|
|
|
|
|
Any Maidir/ configured imap server may refuse this message
|
|
|
|
since its header is invalid. The first "From " line is not
|
|
|
|
valid. It lacks a colon character ":".
|
|
|
|
To solve this problem you have several solutions a) or b):
|
|
|
|
|
|
|
|
a) Remove these first "From " line manually for each message
|
|
|
|
before using imapsync. Don't think to add a colon to this
|
|
|
|
line since you will end with two "From:" lines (just look at
|
|
|
|
the other lines)
|
|
|
|
|
|
|
|
b) Run imapsync with the following option :
|
|
|
|
--regexmess 's/\AFrom \w .*\n//'
|
|
|
|
|
|
|
|
|
2011-03-12 03:44:16 +01:00
|
|
|
=======================================================================
|
2011-03-12 03:43:55 +01:00
|
|
|
Q. I'm migrating from WU to Cyrus, and the mail folders are
|
|
|
|
under /home/user/mail but the tool copies everything in
|
|
|
|
/home/user, how can i avoid that?
|
|
|
|
|
|
|
|
R. Use
|
|
|
|
imapsync ... --include '^mail'
|
|
|
|
or (better)
|
|
|
|
imapsync ... --subscribed --subscribe
|
|
|
|
|
|
|
|
|
2011-03-12 03:44:16 +01:00
|
|
|
=======================================================================
|
2011-03-12 03:43:55 +01:00
|
|
|
Q. I'm migrating from WU to Cyrus, and the mail folders are
|
|
|
|
under /home/user/mail directory. When imapsync creates the
|
|
|
|
folders in the new cyrus imap server, it makes a folder
|
|
|
|
"mail" and below that folder puts all the mail folders the
|
|
|
|
user have in /home/user/mail, i would like to have all those
|
|
|
|
folders directly under INBOX.
|
|
|
|
|
|
|
|
R. Use
|
|
|
|
imapsync ... --regextrans2 's/^mail/INBOX/' --dry
|
|
|
|
look at the simulation and if all transformations seem
|
|
|
|
good then remove the --dry option.
|
|
|
|
|
|
|
|
|
2011-03-12 03:44:16 +01:00
|
|
|
=======================================================================
|
2011-03-12 03:44:15 +01:00
|
|
|
Q. Migrating from Groupwise to Cyrus
|
|
|
|
|
|
|
|
R. By Jamie Neil:
|
|
|
|
|
|
|
|
I eventually managed to get the mail to migrate without errors using the
|
|
|
|
following options:
|
|
|
|
|
|
|
|
--sep1 /
|
|
|
|
- doesn't report separator so has to be set explicitly.
|
|
|
|
|
|
|
|
--nosyncacls
|
|
|
|
- doesn't support ACLs.
|
|
|
|
|
|
|
|
--skipheader '^Content-Type'
|
|
|
|
- MIME separator IDs seem to change every time a mail is accessed so
|
|
|
|
this is required to stop duplicates.
|
|
|
|
|
|
|
|
--maxage 3650
|
|
|
|
- some messages just don't seem to want to transfer and produce the
|
|
|
|
perl errors I mentioned before. This prevents the errors, but the bad
|
|
|
|
messages don't transfer.
|
|
|
|
|
|
|
|
Even though the mail migrated OK, there are a couple of gotchas with
|
|
|
|
Groupwise IMAP:
|
|
|
|
|
|
|
|
1) Some of the GW folders are not real folders and are not available to
|
|
|
|
IMAP, the main problem one being "Sent Items". I could find no way of
|
|
|
|
coping the contents of these folders. The nearest I got was to create a
|
|
|
|
"real" folder and copy/move the sent items into it, but imapsync still
|
|
|
|
didn't see the messages (I think because there is something funny about
|
|
|
|
the reported dates/sizes).
|
|
|
|
It think this problem has been rectified in GW6.5.
|
|
|
|
|
|
|
|
2) The "skipheader '^Content-Type'" directive is required to stop
|
|
|
|
duplicate messages being created. GW seems to generate this field on the
|
|
|
|
fly for messages that have MIME separators and so it's different every time.
|
|
|
|
|
|
|
|
3) Version 6.0.1 of the Groupwise Internet Connector sucks. I was
|
|
|
|
getting server abends when I pushed it a bit hard! I eventually had to
|
|
|
|
upgrade to 6.0.4 which seems to be a lot more stable.
|
|
|
|
|
2011-03-12 03:44:16 +01:00
|
|
|
|
|
|
|
=======================================================================
|
|
|
|
|