1
0
mirror of https://github.com/imapsync/imapsync.git synced 2024-11-17 00:02:29 +01:00
imapsync/FAQ

2181 lines
72 KiB
Plaintext
Raw Normal View History

2011-03-12 03:44:47 +01:00
#!/bin/cat
2014-02-13 18:34:20 +01:00
# $Id: FAQ,v 1.166 2014/01/27 02:23:30 gilles Exp gilles $
2011-03-12 03:43:55 +01:00
+------------------+
| FAQ for imapsync |
+------------------+
2012-04-17 00:33:16 +02:00
http://imapsync.lamiral.info/FAQ
2011-06-14 13:04:24 +02:00
Unix versus Windows syntax.
2013-04-22 21:50:50 +02:00
There are several differences between Unix and Windows
in the command line syntax.
- Character \ versus ^
- Character ' versus "
2012-04-17 00:26:18 +02:00
A) \ versus ^
2011-06-14 13:04:24 +02:00
On Unix shells you can write a single command on multiple lines
by using the escape character \ at the end of each line
2011-09-25 22:31:48 +02:00
(except the last one). On Windows this character is ^
Unix example:
2011-06-14 13:04:24 +02:00
./imapsync \
--host1 imap.truc.org --user1 foo --password1 secret1 \
--host2 imap.trac.org --user2 bar --password2 secret2
2011-09-25 22:31:48 +02:00
Windows example:
2011-06-14 13:04:24 +02:00
imapsync ^
--host1 imap.truc.org --user1 foo --password1 secret1 ^
--host2 imap.trac.org --user2 bar --password2 secret2
Of course you can write the command on one only line without
characters \ nor ^. I use them because the output is
better, no truncation, pretty print. It's just sugar.
In this FAQ I use \ for examples. Transcript to ^ if
you're on a Windows system.
2012-04-17 00:26:18 +02:00
B) ' versus "
On Windows the single quote character ' doesn't work
like on Unix so in the examples of this FAQ the
command containing single quotes ' will fail on Windows.
To fix it just replace single quotes ' by double quotes "
2012-04-17 00:34:41 +02:00
=======================================================================
Q. How to verify imapsync.exe I got is the right file bit per bit?
R. Use md5sum to check integrity of the file.
Get md5sum.exe at http://etree.org/md5com.html
md5sum imapsync.exe
Then compare the checksum with the one given by the author.
2012-04-17 00:26:18 +02:00
2011-03-12 03:44:36 +01:00
=======================================================================
2011-03-12 03:44:51 +01:00
Q. How to install imapsync?
2011-03-12 03:44:36 +01:00
2012-04-17 00:27:13 +02:00
R. Read the INSTALL file in the tarball also available at
http://imapsync.lamiral.info/INSTALL
2011-03-12 03:44:36 +01:00
=======================================================================
2012-04-17 00:27:13 +02:00
Q. How to configure and run imapsync?
2011-03-12 03:44:36 +01:00
2012-04-17 00:27:13 +02:00
R. Read the README and FAQ files in the tarball also available at
http://imapsync.lamiral.info/README
http://imapsync.lamiral.info/FAQ
2011-03-12 03:44:36 +01:00
=======================================================================
2011-03-12 03:44:51 +01:00
Q. Can you give some configuration examples?
2011-03-12 03:44:36 +01:00
2012-04-17 00:27:13 +02:00
R. The FAQ file contains many examples for several scenarios
http://www.linux-france.org/prj/imapsync/FAQ
2011-03-12 03:44:36 +01:00
2011-03-12 03:44:47 +01:00
=======================================================================
2011-03-12 03:44:51 +01:00
Q. How can I have commercial support?
2011-09-25 22:31:48 +02:00
R. Buy support from imapsync author and expert: Gilles LAMIRAL
2012-04-17 00:27:13 +02:00
http://imapsync.lamiral.info/#buy_support
2011-03-12 03:44:51 +01:00
=======================================================================
Q. How can I have gratis support?
2011-03-12 03:44:47 +01:00
R. Use the mailing-list
To write on the mailing-list, the address is:
<imapsync@linux-france.org>
To subscribe, send a message to:
<imapsync-subscribe@listes.linux-france.org>
To unsubscribe, send a message to:
<imapsync-unsubscribe@listes.linux-france.org>
To contact the person in charge for the list:
<imapsync-request@listes.linux-france.org>
The list archives may be available at:
http://www.linux-france.org/prj/imapsync_list/
So consider that the list is public, anyone
can see your post. Use a pseudonym or do not
post to this list if you want to stay private.
Thank you for your participation.
2013-04-22 21:50:50 +02:00
=======================================================================
Q. Can I copy or sync Calendar or Contacts with imapsync?
R. No. It's because most IMAP servers don't get contacts and calendar
events via IMAP. In other words, messages synced by imapsync from
Calendar or Contacts folders are not used by email servers to set
or get the contacts or calendars.
No way via IMAP, no way via imapsync.
2013-12-30 03:03:13 +01:00
See next question.
2013-04-22 21:50:50 +02:00
=======================================================================
Q. How can I copy or synchronize Calendars or Contacts?
R1. It can't be done with imapsync.
R2. It can be done, depending on the email server softwares used.
a) From Exchange to Exchange, export contacts and calendar to
PST format files on host1 and import them on host2.
b) From Gmail to Gmail, export and import calandars in ical format,
extension for those files is .ics.
Contacts can be copied using a csv file. See the help page
http://support.google.com/mail/bin/topic.py?hl=en&topic=1669027
c) Etc. Search the web. There's also specific tools and paid services.
There's no silver bullet to migrate Calendars and Contacts,
if you find one, tell me!
2011-03-12 03:44:31 +01:00
=======================================================================
2011-09-25 22:31:48 +02:00
Q. I need to migrate hundred accounts, how can I do?
2011-03-12 03:44:31 +01:00
2011-09-25 22:31:48 +02:00
R. If you have many mailboxes to migrate think about a little
2012-04-17 00:26:18 +02:00
shell program. Write a file called file.txt (for example)
2011-09-25 22:31:48 +02:00
containing users and passwords.
2012-07-21 04:18:22 +02:00
The separator used in this example is ";"
2011-03-12 03:44:34 +01:00
2012-04-17 00:26:18 +02:00
The file.txt file contains:
2011-03-12 03:44:34 +01:00
2011-09-25 22:31:48 +02:00
user001_1;password001_1;user001_2;password001_2
user002_1;password002_1;user002_2;password002_2
user003_1;password003_1;user003_2;password003_2
user004_1;password004_1;user004_2;password004_2
user005_1;password005_1;user005_2;password005_2
...
2011-03-12 03:44:57 +01:00
2011-09-25 22:31:48 +02:00
On Unix the shell program can be:
2011-03-12 03:44:39 +01:00
2011-09-25 22:31:48 +02:00
{ while IFS=';' read u1 p1 u2 p2; do
imapsync --host1 imap.side1.org --user1 "$u1" --password1 "$p1" \
--host2 imap.side2.org --user2 "$u2" --password2 "$p2" ...
2012-04-17 00:26:18 +02:00
done ; } < file.txt
2011-03-12 03:44:34 +01:00
2011-09-25 22:31:48 +02:00
On Windows the batch program can be:
2011-03-12 03:44:34 +01:00
2012-04-17 00:26:18 +02:00
FOR /F "tokens=1,2,3,4 delims=; eol=#" %%G IN (file.txt) DO imapsync ^
2011-09-25 22:31:48 +02:00
--host1 imap.side1.org --user1 %%G --password1 %%H ^
--host2 imap.side2.org --user2 %%I --password2 %%J ...
2011-03-12 03:44:34 +01:00
2011-09-25 22:31:48 +02:00
The ... can be replaced by nothing or any supplementary imapsync option.
2011-03-12 03:44:31 +01:00
2011-03-12 03:44:35 +01:00
=======================================================================
2011-03-12 03:44:51 +01:00
Q. Where I can find old imapsync releases?
2011-03-12 03:44:35 +01:00
2011-04-24 23:19:36 +02:00
R. Search the internet.
2011-03-12 03:44:35 +01:00
2012-04-17 00:27:13 +02:00
=======================================================================
Q. Where I can find free open and gratis imapsync releases?
R. Search the internet.
2013-04-22 21:50:50 +02:00
Q. Is is legal to find imapsync gratis (or not) elsewhere?
2012-04-17 00:27:13 +02:00
R. Yes, the license permits it
2013-09-26 23:59:52 +02:00
http://imapsync.lamiral.info/NOLIMIT
2012-04-17 00:27:13 +02:00
2013-09-27 00:00:32 +02:00
=======================================================================
Q. How "Facts and figures" are known on http://imapsync.lamiral.info/
R. To know wether a newer imapsync exists or not imapsync does a http
GET to http://imapsync.lamiral.info/VERSION
Via the User-agent parameter it also send:
* imapsync release
* Perl version
* Mail::IMAPClient version
* Operating System
You can remove this behavior by adding option --noreleasecheck on the
command line (or by setting $releasecheck = 0 in the source code)
2012-04-17 00:30:19 +02:00
=======================================================================
Q. I use --useuid which uses a cache in /tmp or --tmpdir, the hostnames
host1 or host2 has changed but mailboxes are the same. Will imapsync
generate duplicate messages on next runs?
R. Yes
Q. How can I fix this?
R. The cache path reflects hostnames or ip adresses, just change the
directory names of host1 or host2. Use --dry to see if next runs
will generate duplucates.
By default the cache is like
/tmp/imapsync_cache/host1/user1/host2/user2/...
2012-04-17 00:28:48 +02:00
=======================================================================
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
2013-02-09 03:40:54 +01:00
useful to see what has to be done on each folder and guess when
the transfer will end (ETA).
R. Add also --nocheckmessageexists
Since transfer can be long on a huge mailbox imapsync checks
a message exist before copying it, but it takes time and
cpu on the host1 server.
--nocheckmessageexists is on by default since release 1.520
R. Add also --noexpungeaftereach if you use --delete but be warn
that an interrupted transfer can loose messages on host2 in a
second run if you use a combination like
imapsync ... --delete --noexpunge --noexpungeaftereach --expunge2
2012-04-17 00:28:48 +02:00
2012-07-21 04:18:22 +02:00
Notes about --useuid
Case where building the cache first is necessary (to avoid multiples transfers)
If you run again imapsync with --useuid on a transfert already done without --useuid
then, to avoid messages be copied again, first run imapsync with --usecache
but without --useuid, example scenario:
A] Running with the default options, I began without --useuid
1) First run with default options
imapsync ...
Too slow, I want to speed up!
2) Build the cache
imapsync ... --usecache
3) Speed up now
imapsync ... --useuid
B] I began with --useuid from the first time
1) First run and next runs with --useuid
imapsync ... --useuid
Inodes number issue
The cache is simple, it uses the filsystem natively,
it's just an empty file per message transfered.
When mailboxes are huge the cache can exhaust the number of inodes
allowed in the filesystem, that's a limitation like size but less
often encountered.
On Unix, to predict whether your tmpdir filesystem used by imapsync
will support the whole cache, just run the command "df -i /var/tmp",
if /var/tmp is the --tmpdir argument.
On windows, search and drop me a note about how to count the number
of files allowed in the filesystem.
It seems FAT32 supports 268 435 445 clusters.
Choosing the number of inodes allowed by a filesystem can be done
at the creation of it with "mkfs -N number-of-inodes ..."
imapsync can predict how many messages have to be synced with the
option --justfoldersizes (no transfer will be done)
imapsync ... --justfoldersizes
2012-04-17 00:28:48 +02:00
=======================================================================
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
2011-03-12 03:44:36 +01:00
=======================================================================
2013-09-27 00:00:32 +02:00
Q. On Windows, with --useuid or --usecache a problem occurs with long
nested folder names. The error message is:
"No such file or directory; The filename or extension is too long"
R. This comes from a Windows limitation on pathnames.
No more than 260 characters are allowed for pathnames.
See more details on page
http://msdn.microsoft.com/en-us/library/windows/desktop/aa365247.aspx#maxpath
Two workarounds to reduce the cache directory name:
1) Use --tmpdir "D:\\temp" or simply --tmpdir "D:"
2013-10-18 02:11:27 +02:00
Currently (until 1.568) there is a bug with --tmpdir "D:\\temp" or "D:".
Since character : is forbidden in Windows paths the directory is transform
to convert those characters and others () to character _
So "D:\\temp" becomes "D_\\temp".
A fix is to change to D: before running imapsync and use --tmpdir "."
like this in a batch file:
D:
cd \
cd .\temp
%~dp0\imapsync.exe ... --tmpdir "."
This bug should be fixed in release 1.569
2013-09-27 00:00:32 +02:00
2) add two equivalent entries in the etc/hosts for host1 imap.truc.org
and host2 imap.trac.org.
If you map the ip of imap.truc.org just with the letter a
and same thing for imap.trac.org then you gain characters
etc/hosts
192.168.12.1 a
192.168.55.3 b
Then use:
imapsync --host1 a --host2 b ...
You can get the ip of a host with the ping command line
C:\> ping imap.truc.org
Fixing the long path problem directly in imapsync is in the TODO file.
=======================================================================
Q. How can I try imapsync with latest Mail::IMAPClient 3.xx perl module?
2011-03-12 03:44:47 +01:00
2013-12-30 03:03:13 +01:00
Three solutions at least.
2013-04-22 21:50:50 +02:00
2013-12-30 03:03:13 +01:00
R1 - Look at the script named "i3" in the tarball, it can be used to
run imapsync with the included Mail-IMAPClient-3.35/ wherever you
2013-04-22 21:50:50 +02:00
unpacked the imapsync tarball
2013-12-30 03:03:13 +01:00
R2 Run:
perl -MCPAN -e "install Mail::IMAPClient"
or
cpan -i Mail::IMAPClient
R3 If you want to install the Perl module locally in a directory
- Download latest Mail::IMAPClient 3.xx at
http://search.cpan.org/dist/Mail-IMAPClient/
2011-03-12 03:44:47 +01:00
- untar it anywhere:
tar xzvf Mail-IMAPClient-3.xx.tar.gz
2012-04-17 00:27:13 +02:00
- Get any imapsync (latest is better).
2011-03-12 03:44:47 +01:00
2011-03-12 03:44:51 +01:00
- run imapsync with perl and -I option tailing to use the perl
module Mail-IMAPClient-3.xx. Example:
2013-12-30 03:03:13 +01:00
perl -I./Mail-IMAPClient-3.35/lib ./imapsync ...
2011-03-12 03:44:57 +01:00
or if imapsync is in directory /path/
2013-12-30 03:03:13 +01:00
perl -I./Mail-IMAPClient-3.35/lib /path/imapsync ...
2012-04-17 00:26:18 +02:00
2011-03-12 03:44:47 +01:00
=======================================================================
2011-04-24 23:19:36 +02:00
Q. How can I use imapsync with Mail::IMAPClient 2.2.9 perl module?
2011-03-12 03:44:36 +01:00
2013-04-22 21:50:50 +02:00
R. Mail::IMAPClient 2.2.9 is no longer supported.
2012-04-17 00:26:18 +02:00
2013-12-30 03:03:13 +01:00
=======================================================================
Q. I get "Out of memory" errors. How to fix that?
R. Usually "Out of memory" errors are related to old days,
to old Mail::IMAPClient module releases, before 3.26.
Look at imapsync output first lines to get the Mail::IMAPClient release used.
Then upgrade Mail::IMAPClient Perl module.
2011-03-12 03:44:52 +01:00
=======================================================================
2011-04-24 23:19:36 +02:00
Q. Can I use imapsync to migrate emails from pop3 server to imap server?
2011-03-12 03:44:40 +01:00
2011-04-24 23:19:36 +02:00
R1. No.
2011-03-12 03:44:52 +01:00
You can migrate emails from pop server to imap server with pop2imap:
http://www.linux-france.org/prj/pop2imap/
2011-03-12 03:44:40 +01:00
2011-04-24 23:19:36 +02:00
R2. Yes
2013-02-09 03:40:54 +01:00
Many pop3 servers runs in parallel with an imap server on exactly
the same mailboxes. They serve the same INBOX
2011-04-24 23:19:36 +02:00
(imap serves INBOX and several other folders, pop3 serves only INBOX)
So have a try with imapsync on the same host1.
2013-12-30 03:03:13 +01:00
=======================================================================
Q. Folders are not created on host2. What happens?
R. Do you use IMAP or POP3 with your client software?
It looks like you use POP3 instead of IMAP, POP3 has only INBOX.
2011-03-12 03:44:40 +01:00
=======================================================================
Q. I am interested in creating a local clone of the IMAP on a LAN
2011-03-12 03:44:51 +01:00
server for faster synchronisations, email will always be delivered
to the remote server and so the synchronisation will be one way - from
remote to local. How suited is imapsync for continuous one-way
2011-03-12 03:44:40 +01:00
synchronisation of mailboxes? Is there a better solution?
R. If messages are delivered remotely and you play locally with the
copy, in order to have fast access, then the synchronisation can't
be one way. You may change flags, you may move messages in
different folders etc.
A better tool with this scenario is offlineimap,
designed for this issue, and faster than 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
2013-02-09 03:40:54 +01:00
time at which the file was synchronized.
2011-03-12 03:44:16 +01:00
2011-03-12 03:44:26 +01:00
R. This is the case with:
- Eudora
2011-03-12 03:44:29 +01:00
- Outlook 2003
2013-05-21 00:04:57 +02:00
but not with
2011-03-12 03:44:26 +01:00
- Mutt
- Thunderbird
2013-05-21 00:04:57 +02:00
and no longer with
- Zimbra
- Gmail
2011-03-12 03:44:26 +01:00
2011-03-12 03:44:51 +01:00
Eurora shows by default the time the imap server received the email. I
think it is quite a wrong behavior since the messages can have
2013-05-21 00:04:57 +02:00
traveled some time before the reception.
2011-03-12 03:44:16 +01:00
2011-03-12 03:44:51 +01:00
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.).
2011-03-12 03:44:16 +01:00
2011-09-25 22:31:48 +02:00
imapsync does not touch any byte of messages unless told to do so
by an option. Messages on both parts should be identical
(some IMAP servers add or even change header lines).
2011-03-12 03:44:16 +01:00
2011-03-12 03:44:21 +01:00
Solutions:
2011-09-25 22:31:48 +02:00
a) Use the --syncinternaldates option and keep using Eudora.
But --syncinternaldates is now turn on by default so if you
encounter the issue then the solution is harder, depending
on email client softwares and IMAP server softwares.
b) use --idatefromheader to set the internal dates on host2 same as the
"Date:" headers. It won't work if a) doesn't work.
c) In Maildir boxes, after the sync (too late...), use the script
2011-03-12 03:44:53 +01:00
learn/adjust_time.pl to change the internal dates from the "Date:" header.
2012-04-17 00:27:13 +02:00
(this a Unix fix using touch command)
2011-09-25 22:31:48 +02:00
2012-04-17 00:27:13 +02:00
d) Use a better email client or configure it in order it sorts messages
by sent date.
2011-03-12 03:44:26 +01:00
2011-03-12 03:44:57 +01:00
=======================================================================
Q. imapsync calculates 479 messages in a folder but only transfers 400
messages. What's happen?
2012-04-17 00:27:13 +02:00
R1. Unless --useuid is used, imapsync considers a header part
2011-09-25 22:31:48 +02:00
of a message to identify a message on both sides.
2013-02-09 03:40:54 +01:00
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
2011-03-12 03:44:57 +01:00
2011-04-24 23:19:36 +02:00
Consequences:
2011-03-12 03:44:57 +01:00
2011-04-24 23:19:36 +02:00
1) Duplicate messages (identical header) are not transferred
2011-03-12 03:44:57 +01:00
several times.
The result is that you can have more messages on host1 than on host2.
2011-04-24 23:19:36 +02:00
R2. With option --useuid imapsync doesn't use headers to identify
2012-04-17 00:28:48 +02:00
messages on both sides but it uses their imap uid. In that case
2012-04-17 00:27:13 +02:00
duplicates on host1 are transfered on host2.
2011-04-24 23:19:36 +02:00
2012-04-17 00:34:41 +02:00
=======================================================================
Q. How can I remove duplicates on a uniq host
R. Just run imapsync on the same account with option --delete2,
ie with host1 == host2 and user1 == user2
2011-09-25 22:31:48 +02:00
=======================================================================
Q. I need to log every output on a file named log.txt
R. Use redirections of both standard and error outputs "> log.txt 2>&1"
imapsync ... > log.txt 2>&1
2013-04-22 21:50:50 +02:00
This syntax is available both on Windows and Unix.
2011-09-25 22:31:48 +02:00
=======================================================================
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
2013-04-22 21:50:50 +02:00
http://stackoverflow.com/questions/796476/displaying-windows-command-prompt-output-and-redirecting-it-to-a-file
http://code.google.com/p/wintee/
2011-09-25 22:31:48 +02:00
imapsync ... 2>&1 | tee log.txt
2011-04-24 23:19:36 +02:00
=======================================================================
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?
2012-04-17 00:27:13 +02:00
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.
2011-04-24 23:19:36 +02:00
The file imapsync.pid contains the PID of the imapsync process.
This file is removed at the end of a normal run.
2012-04-17 00:27:13 +02:00
You can safely ignore the warning if you don't use imapsync.pid file.
2011-04-24 23:19:36 +02:00
2013-10-18 02:11:27 +02:00
=======================================================================
Q. Couldn't create folder [trash] from [INBOX.trash]:
588 NO Mailbox already exists.
R. Some servers take care about character case in folder names,
some servers do not, like Exchange. Since non-respecting case
can merge two different folders into one then imapsync respects case.
For example, if a host1 server has a folder name called "trash"
and the host2 server already has a folder "Trash" or "TRASH"
then imapsync will try to create the folder "trash" on host2,
because trash and Trash are different strings. But if host2
does not repect character case it will consider folder "trash"
already exists and will say it, that's the error message
reported by imapsync: "Mailbox already exists", message coming
from the server.
The folder creation fails but messages are well transfered in
so take a look at this warning, understand why it happens
and it should be fine most of the time.
To avoid this warning use --regextrans2 to map the folder names
imapsync ... --regextrans2 "s/^trash$/Trash/"
If there are two folders Trash and trash on host1 then both
will be merge into only one Trash folder on host2.
In case option --delete2 is used the regextans2 above becomes
mandatory, otherwise imapsync will sync messages from the
first Trash and then delete them when syncing trash.
2011-03-12 03:44:51 +01:00
=======================================================================
Q. Couldn't create [INBOX.Ops/foo/bar]: NO Invalid mailbox name:
INBOX.Ops/foo/bar
2012-04-17 00:27:13 +02:00
Let begin by an explanation.
2011-03-12 03:44:51 +01:00
Example:
2012-04-17 00:27:13 +02:00
sep1 = /
sep2 = .
2011-03-12 03:44:51 +01:00
2012-04-17 00:27:13 +02:00
imapsync reverts each separator automaticaly.
2011-03-12 03:44:51 +01:00
a) All / character coming from host1 are converted to . (convert the separator)
b) All . character coming from host1 are converted to / (to avoid
intermediate unwanted folder creation).
2012-04-17 00:27:13 +02:00
So
INBOX/Ops.foo.bar (Ops.foo.bar is just one folder name) will be translated to
INBOX.Ops/foo/bar
2011-03-12 03:44:51 +01:00
Sometimes the sep1 character is not valid on host2 (character "/" usualy)
R. Try :
2011-04-24 23:19:36 +02:00
--regextrans2 "s,/,X,g"
2011-03-12 03:44:51 +01:00
It'll convert / character to X
Choose X as you wish: _ or SEP or
any string (including the empty string).
2013-12-30 03:03:13 +01:00
=======================================================================
Q. Is it possible to sync also the UIDL of the POP3 server?
R. imapsync does not POP3 but I think you mean UID in IMAP.
See next question.
=======================================================================
Q. Is it possible to sync also the UIDs of the IMAP server?
UIDs in IMAP are chosen and created by the servers, not by the clients,
imapsync is a client. So UIDs can not be synced by any method,
unless the server is duplicated as is.
2011-03-12 03:44:37 +01:00
=======================================================================
Q. The option --subscribe does not seem to work
2012-04-17 00:27:13 +02:00
R1. Use it with --subscribed
R2. There is also the --subscribe_all option that subscribe
to all folders on host2.
2011-03-12 03:44:37 +01:00
2013-10-18 02:11:27 +02:00
=======================================================================
Q. Is there a way we can specify a date range to sync emails?
If yes, can you please share an example?
Yes, with the --search option.
imapsync ... --search "SENTSINCE 1-Jan-2010 SENTBEFORE 31-Dec-2010"
Jan
Feb
Mar
Apr
May
Jun
Jul
Aug
Sep
Oct
Nov
Dec
2011-03-12 03:44:35 +01:00
=======================================================================
Q. Does imapsync retain the \Answered and $Forwarded flags?
2011-03-12 03:44:51 +01:00
R. It depends on the destination server.
a) If the destination server honors the "PERMAENTFLAGS \*"
2012-04-17 00:27:13 +02:00
directive (meaning it accepts any flag) or no PERMAENTFLAGS at all
2013-02-09 03:40:54 +01:00
then imapsync synchronizes all flags except the \Recent flag
2012-04-17 00:27:13 +02:00
(RFC 3501 says about \Recent flag "This flag can not be
altered by the client.").
2011-03-12 03:44:51 +01:00
b) If the destination server honors the "PERMAENTFLAGS without the
2013-02-09 03:40:54 +01:00
special "\*" then imapsync synchronizes only the flags listed
2012-04-17 00:27:13 +02:00
in PERMANENTFLAGS.
2011-03-12 03:44:35 +01:00
Some imap servers have problems with flags not beginning with
the backslash character \
2011-03-12 03:44:57 +01:00
(see next question to find a solution to this issue)
2011-03-12 03:44:35 +01:00
2013-02-09 03:40:54 +01:00
=======================================================================
Q. Is there a way to only sync messages with a specific flag set,
for example, the \Seen flag?
R. use --search
imapsync ... --search SEEN
or
imapsync ... --search UNSEEN
or ...
The complete list of search things are listed below
http://www.faqs.org/rfcs/rfc3501.html
6.4.4. SEARCH Command
...
ALL
All messages in the mailbox; the default initial key for
ANDing.
ANSWERED
Messages with the \Answered flag set.
BCC <string>
Messages that contain the specified string in the envelope
structure's BCC field.
BEFORE <date>
Messages whose internal date (disregarding time and timezone)
is earlier than the specified date.
BODY <string>
Messages that contain the specified string in the body of the
message.
CC <string>
Messages that contain the specified string in the envelope
structure's CC field.
DELETED
Messages with the \Deleted flag set.
DRAFT
Messages with the \Draft flag set.
FLAGGED
Messages with the \Flagged flag set.
FROM <string>
Messages that contain the specified string in the envelope
structure's FROM field.
HEADER <field-name> <string>
Messages that have a header with the specified field-name (as
defined in [RFC-2822]) and that contains the specified string
in the text of the header (what comes after the colon). If the
string to search is zero-length, this matches all messages that
have a header line with the specified field-name regardless of
the contents.
KEYWORD <flag>
Messages with the specified keyword flag set.
LARGER <n>
Messages with an [RFC-2822] size larger than the specified
number of octets.
NEW
Messages that have the \Recent flag set but not the \Seen flag.
This is functionally equivalent to "(RECENT UNSEEN)".
NOT <search-key>
Messages that do not match the specified search key.
OLD
Messages that do not have the \Recent flag set. This is
functionally equivalent to "NOT RECENT" (as opposed to "NOT
NEW").
ON <date>
Messages whose internal date (disregarding time and timezone)
is within the specified date.
OR <search-key1> <search-key2>
Messages that match either search key.
RECENT
Messages that have the \Recent flag set.
SEEN
Messages that have the \Seen flag set.
SENTBEFORE <date>
Messages whose [RFC-2822] Date: header (disregarding time and
timezone) is earlier than the specified date.
SENTON <date>
Messages whose [RFC-2822] Date: header (disregarding time and
timezone) is within the specified date.
SENTSINCE <date>
Messages whose [RFC-2822] Date: header (disregarding time and
timezone) is within or later than the specified date.
SINCE <date>
Messages whose internal date (disregarding time and timezone)
is within or later than the specified date.
SMALLER <n>
Messages with an [RFC-2822] size smaller than the specified
number of octets.
SUBJECT <string>
Messages that contain the specified string in the envelope
structure's SUBJECT field.
TEXT <string>
Messages that contain the specified string in the header or
body of the message.
TO <string>
Messages that contain the specified string in the envelope
structure's TO field.
UID <sequence set>
Messages with unique identifiers corresponding to the specified
unique identifier set. Sequence set ranges are permitted.
UNANSWERED
Messages that do not have the \Answered flag set.
UNDELETED
Messages that do not have the \Deleted flag set.
UNDRAFT
Messages that do not have the \Draft flag set.
UNFLAGGED
Messages that do not have the \Flagged flag set.
UNKEYWORD <flag>
Messages that do not have the specified keyword flag set.
UNSEEN
Messages that do not have the \Seen flag set.
2011-07-11 23:24:12 +02:00
=======================================================================
Q. How to convert flags?
R. use --regexflag
For example to convert flag IMPORTANT to flag CANWAIT
2012-04-17 00:26:18 +02:00
imapsync ... --regexflag "s/IMPORTANT/CANWAIT/g" --debugflags
2011-07-11 23:24:12 +02:00
option --debugflags is usefull to see in details what imapsync
does with flags.
2013-09-27 00:00:32 +02:00
=======================================================================
Q. How to fix this error: BAD Invalid system flag \FORWARDED
R. Filter flag \FORWARDED with
imapsync ... --regexflag "s/\\FORWARDED//g"
2011-07-11 23:24:12 +02:00
=======================================================================
Q. How to convert flags with $ to \ character?
R. $ and \ are special characters we have to "escape" them.
For example to convert flag $label1 to \label1
2012-07-21 04:18:22 +02:00
imapsync ... --regexflag "s/\$label1/\\label1/g" --debugflags
2011-07-11 23:24:12 +02:00
2011-03-12 03:44:51 +01:00
=======================================================================
Q. I need to keep only a defind list of flags, how can I do?
The destination imap server complains about bad flags (Exchange).
2012-04-17 00:27:13 +02:00
R1. Recent imapsync deals with this issue by filter with PERMANENTFLAGS
automatically.
R2. For example if you want to keep only the following flags
2011-03-12 03:44:51 +01:00
\Seen \Answered \Flagged \Deleted \Draft
then use these magic --regexflag options (thanks to Phil):
--regexflag 's/.*?(?:(\\(?:Answered|Flagged|Deleted|Seen|Draft)\s?)|$)/defined($1)?$1:q()/eg'
Analysis is left to the reader.
This one is longer and may be use with old perl (no /e regex extension):
--regexflag 's/(.*)/$1 jrdH8u/' \
--regexflag 's/.*?(\\Seen|\\Answered|\\Flagged|\\Deleted|\\Draft|jrdH8u)/$1 /g' \
--regexflag 's/(\\Seen|\\Answered|\\Flagged|\\Deleted|\\Draft|jrdH8u) (?!(\\Seen|\\Answered|\\Flagged|\\Deleted|\\Draft|jrdH8u)).*/$1 /g' \
--regexflag 's/jrdH8u *//'
2011-03-12 03:44:35 +01:00
======================================================================
Q. imapsync fails with the following error:
flags from : [\Seen NonJunk]["10-Aug-2006 13:00:30 -0400"]
Error trying to append string: 58 NO APPEND Invalid flag list
2011-03-12 03:44:35 +01:00
R. For some servers, flags have to begin with a \ character.
The flag "NonJunk" may be a invalid flag for your server
so use for example:
2011-03-12 03:44:35 +01:00
2011-04-24 23:19:36 +02:00
imapsync ... --regexflag "s/NonJunk//g"
2011-03-12 03:44:35 +01:00
2011-03-12 03:44:35 +01:00
Remark (thanks to Arnt Gulbrandsen):
IMAP system flags have to begin with \ character.
Any other flag must begin with another character.
System flags are just flags defined by an RFC instead of by users.
Conclusion, some imap server coders don't read the RFCs (so do I).
2012-04-17 00:27:13 +02:00
Recent imapsync deals with this issue by filter with PERMANENTFLAGS
2011-03-12 03:44:57 +01:00
automatically.
2011-03-12 03:44:33 +01:00
=======================================================================
2011-03-12 03:44:51 +01:00
Q. Flags are not well synchonized. Is it a bug?
2011-03-12 03:44:33 +01:00
R. It happens with some servers on the first sync.
Also, it was a bug from revision 1.200 to revision 1.207
2013-10-18 02:11:27 +02:00
Two solutions:
* Run imapsync a second time. imapsync synchronizes flags on each run.
* Use option --syncflagsaftercopy. With this option imapsync will
also sync flags after each message transfer. Flags are already
synced during the transfer with the imap APPEND command but
option --syncflagsaftercopy does it again using the imap STORE
command.
2011-03-12 03:44:34 +01:00
2011-03-12 03:44:35 +01:00
=======================================================================
2012-04-17 00:30:19 +02:00
Q. On Unix, some passwords contain * and " characters. Login fails.
2011-03-12 03:44:51 +01:00
R. Use a backslash to escape the characters:
2011-03-12 03:44:35 +01:00
2012-04-17 00:30:19 +02:00
imapsync ... --password1 \"password\"
2011-03-12 03:44:35 +01:00
2011-03-12 03:44:51 +01:00
It works for the star * character,
2011-03-12 03:44:35 +01:00
I don't know if it works for the " character.
=======================================================================
2012-04-17 00:30:19 +02:00
Q. On Windows, some passwords contain $ characters. Login fails.
R1. Enclose passwords between ""
imapsync ... --password1 "zzz$zz$$z"
R2. Prefix each $ character with a ^ since ^ is the escape character
on Windows
2011-03-12 03:44:35 +01:00
2012-04-17 00:30:19 +02:00
imapsync ... --password1 zzz^$zz^$^$z
2011-03-12 03:44:35 +01:00
2012-04-17 00:30:19 +02:00
For a password that is exactly the 8 characters string $%&<>|^"
you have to enter
2011-03-12 03:44:35 +01:00
2012-04-17 00:30:19 +02:00
imapsync ... --password1 "$%%&<>|^"^"
2011-03-12 03:44:35 +01:00
2012-04-17 00:33:16 +02:00
=======================================================================
Q. On Windows, some passwords begin with an equal = character.
Login fails. What can I do?
R. Use twice equals == characters instead; For example, if =secret
is the password then use:
imapsync ... --password1 ==secret
or even
imapsync ... --password1 "==secret"
2011-03-12 03:44:36 +01:00
=======================================================================
Q. With huge account (many messages) when it comes to reading the
destination server it comes out this error:
"To Folder [INBOX.foobar] Not connected"
2011-03-12 03:44:51 +01:00
What can I do?
2011-03-12 03:44:36 +01:00
R. May be spending too much time on the source server, the connection
timed out on the destination server.
2012-04-17 00:27:13 +02:00
Try options --nofoldersizes
2011-03-12 03:44:36 +01:00
2011-03-12 03:44:57 +01:00
2011-03-12 03:44:26 +01:00
=======================================================================
Q. imapsync failed with a "word too long" error from the imap server,
2011-03-12 03:44:51 +01:00
What can I do?
2011-03-12 03:44:26 +01:00
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
=======================================================================
2013-09-26 23:59:52 +02:00
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)?
2011-03-12 03:44:17 +01:00
2011-03-12 03:44:23 +01:00
R. Yes natively since release 1.161.
still, 2 ways, at least :
2013-09-26 23:59:52 +02:00
a) Use native --ssl1 and/or --ssl2 options
2011-03-12 03:44:23 +01:00
2013-09-26 23:59:52 +02:00
--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.
2013-09-26 23:59:52 +02:00
If the local port 143 is already taken then use a free one, 10143.
2011-03-12 03:44:17 +01:00
2013-08-04 03:27:37 +02:00
=======================================================================
Q. On windows ssl use to work with imapsync.exe 1.536 or previous then
an upgrade to next release makes it fail.
R. The I0::Socket::SSL can have SSL_version set by default to
"SSLv23:!SSLv2" but the auto-negociation can fail with
some ssl servers. Use --ssl1_SSL_version or
--ssl2_SSL_version to change SSL_version.
Try:
imapsync ... --ssl1 --ssl1_SSL_version "SSLv3"
2011-03-12 03:44:16 +01:00
2011-03-12 03:44:23 +01:00
=======================================================================
2011-03-12 03:44:51 +01:00
Q: How to have an imaps server?
2011-03-12 03:44:23 +01:00
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:35 +01:00
=======================================================================
2012-04-17 00:27:13 +02:00
Q: I'm trying to use imapsync on win32 for gmail and it requires ssl.
Imapsync appears to require IO::Socket::SSL. What can I do?
R1: use standalone imapsync.exe, it contains IO::Socket::SSL
Perl module embeded.
2013-08-04 03:27:37 +02:00
R2: Module IO::Socket::SSL is available on Win32
2012-04-17 00:27:13 +02:00
with Strawberry Perl.
2011-03-12 03:44:35 +01:00
2011-03-12 03:44:26 +01:00
=======================================================================
Q: Multiple copies when I run imapsync twice ore more.
2012-04-17 00:27:13 +02:00
R1. You can use option --useuid, imapsync then won't use header lines to
compare messages in folders. Keep in ming it uses a local cache.
imapsync ... --useuid
R2. Multiple copies of the emails on the destination server. Some IMAP
2011-03-12 03:44:51 +01:00
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
2011-03-12 03:44:33 +01:00
line added) and size too (the header part).
2011-03-12 03:44:51 +01:00
You can look at the headers found by imapsync by using the --debug
option (and search for the message on both part), Header lines from
the source server begin with a "FH:" prefix, Header lines from the
destination server begin with a "TH:" prefix. Since --debug is very
verbose I suggest to isolate a email in a specific folder in case you
want to forward me the output.
2011-03-12 03:44:33 +01:00
The way to avoid this problem is by using options --skipheader and
2011-03-12 03:44:51 +01:00
--skipsize, like this (avoid headers beginning whith the string "X-"):
2011-03-12 03:44:26 +01:00
2012-07-21 04:18:22 +02:00
imapsync ... --skipheader "^X-" --skipsize
2011-03-12 03:44:26 +01:00
2011-03-12 03:44:33 +01:00
To skip several headers you can use --skipheader one time
2011-03-12 03:44:26 +01:00
2012-07-21 04:18:22 +02:00
imapsync ... --skipheader "^X-|^Status|^Bcc"
2011-03-12 03:44:26 +01:00
2011-03-12 03:44:33 +01:00
If you think you have too many header to avoid just use
2012-07-21 04:18:22 +02:00
imapsync ... --useheader "Message-ID" --skipsize
2011-03-12 03:44:33 +01:00
2011-03-12 03:44:47 +01:00
Remark. (Trick found by Tomasz Kaczmarski)
2011-03-12 03:44:51 +01:00
2012-07-21 04:18:22 +02:00
Option --useheader "Message-ID" asks the server to send only header
lines begining with "Message-ID". Some (buggy) servers send the whole
header (all lines) instead of the "Message-ID" line. In that case, a
2011-03-12 03:44:51 +01:00
trick to keep the --useheader filtering behavior is to use
2011-03-12 03:44:47 +01:00
--skipheader with a negative lookahead pattern :
2012-07-21 04:18:22 +02:00
imapsync ... --skipheader "^(?!Message-ID)" --skipsize
2011-03-12 03:44:47 +01:00
Read it as "skip every header except Message-ID".
======================================================================
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)
2011-03-12 03:44:33 +01:00
2011-03-12 03:45:06 +01:00
======================================================================
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.
2011-03-12 03:44:32 +01:00
======================================================================
Q. I want to exclude a folder hierarchy like "public"
2011-03-12 03:45:04 +01:00
R. Use:
2011-03-12 03:44:32 +01:00
2012-07-21 04:18:22 +02:00
--exclude "^public\."
2011-03-12 03:44:32 +01:00
or maybe
--exclude '^"public\.'
2011-03-12 03:44:51 +01:00
In the example given the character "." is the folder separator, you
can ommit it. Just take the string as it appears on the imapsync
output line :
2011-03-12 03:44:32 +01:00
From folders list : [INBOX] [public.dreams] [etc.]
2011-03-12 03:44:26 +01:00
2013-02-09 03:40:54 +01:00
2011-03-12 03:45:04 +01:00
======================================================================
Q. I want to exclude only INBOX
R. Use:
2012-07-21 04:18:22 +02:00
imapsync ... --exclude "^INBOX$"
2011-03-12 03:45:04 +01:00
A good way to see what will be done is to first use:
2012-07-21 04:18:22 +02:00
imapsync ... --exclude "^INBOX$" --justfolders --nofoldersizes --dry
2011-03-12 03:45:04 +01:00
2013-02-09 03:40:54 +01:00
======================================================================
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
2011-03-12 03:45:04 +01:00
2011-03-12 03:44:21 +01:00
======================================================================
2012-07-21 04:18:22 +02:00
Q. I want the --folder "MyFolder" option be recursive.
2011-03-12 03:44:21 +01:00
2011-03-12 03:44:57 +01:00
Two solutions:
2011-06-14 13:04:24 +02:00
R1. Use
2011-03-12 03:44:57 +01:00
2012-07-21 04:18:22 +02:00
--folderrec "MyFolder"
2011-03-12 03:44:57 +01:00
2012-07-21 04:18:22 +02:00
R2. 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.
2012-07-21 04:18:22 +02:00
======================================================================
Q. Migrating to Exchange 201O, messages get date of the transfer,
this is bad for sorting and listing.
R1. Be sure to have at least Exchange 2010 SP2 Rollup 5
http://www.tribalchicken.com.au/15-technical/29-imapsync-exchange2010
R2. See also the Outlook side (thanks to Martin Hochreiter for this solution)
http://www.howto-outlook.com/faq/archivenotworking.htm
by changing Archive to sent/receive date
It's often shorter to change one server than thousands clients
so R1 might be easier to do.
2011-03-12 03:44:39 +01:00
2012-04-17 00:28:48 +02:00
======================================================================
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
2011-03-12 03:45:04 +01:00
======================================================================
Q. How to migrate from or to Exchange 2007/2010 with an
admin/authuser account?
2011-06-14 13:02:33 +02:00
R. The tricks comes from Michele Marcionelli and Benjamin Priestman:
2011-03-12 03:45:04 +01:00
This doesn't work:
2011-06-14 13:02:33 +02:00
imapsync ... --user2 user2 --authuser2 admin2 --password2 adminpassword2 ...
2011-03-12 03:45:04 +01:00
2011-06-14 13:02:33 +02:00
This might works:
2012-07-21 04:18:22 +02:00
imapsync ... --user2 "domain\admin2\user2" --password2 adminpassword2 ...
2011-06-14 13:02:33 +02:00
or
2012-07-21 04:18:22 +02:00
imapsync ... --user2 "admin2@domain\user2" --password2 adminpassword2 ...
2011-03-12 03:45:04 +01:00
2011-06-14 13:02:33 +02:00
where "domain" is set be the user's UPN in Active Directory
or the NETBIOS or DNS name of the domain.
The exact format might vary depending on local configuration and you
should experiment with the different formats.
2011-03-12 03:45:04 +01:00
2012-07-21 04:18:22 +02:00
A little note from Michael Scherer.
The previous workaround in the FAQ seems to be obsolete.
I can confirm that
imapsync ... --host2 exchange_server --authmech2 PLAIN \
--authuser2 admin@domain --user2 user_alias
is working without any glitches, running Exchange 2010 SP2 here.
Explanation, Exchange knows a) about a username
and b) about a mailNickname which can be different to the username.
As it seems you need to use the mailNickname (e.g. alias) defined
for user2, not the username itself.
http://blogs.technet.com/b/exchange/archive/2004/03/31/105275.aspx
======================================================================
Q. How to migrate from or to Office 365 with an admin/authuser account?
Note from Yago Torres Fernandez:
(a working command using admin/authuser on host2 Office 365)
imapsync ... --authuser2 user_admin@domain.com --user2 user_to_be_migrated@domain.com ^
--password2 XXXX --ssl2 --exclude "Shared Folders" ^
--regextrans2 "s#Trash$#Papelera#" --regextrans2 "s#^Deleted Items$#Papelera#"
but previous in Office365 you must do something like that, using powershell:
Add-MailboxPermission -identity user_to_be_migrated@domain.com -user user_admin@domain.com -accessrights fullaccess -inheritancetype all
2011-03-12 03:44:39 +01:00
======================================================================
2011-03-12 03:44:51 +01:00
Q. How to migrate from uw-imap with an admin/authuser account?
2011-03-12 03:44:39 +01:00
R. Use
2011-03-12 03:44:57 +01:00
2011-03-12 03:44:39 +01:00
--user1="user*admin_user" --password1 "admin_user_password"
2011-03-12 03:44:25 +01:00
======================================================================
2011-03-12 03:44:51 +01:00
Q. How to migrate from cyrus with an admin account?
2011-03-12 03:44:25 +01:00
2013-02-09 03:40:54 +01:00
R. Use:
imapsync ... \
--authuser1 admin_user ----password1 admin_user_password \
--user1 foo_user --ssl1
2011-03-12 03:44:35 +01:00
In this case, --authmech1 PLAIN will be used by default since it
is the only way to go for now. So don't use --authmech1 SOMETHING
with --authuser1 admin_user, it will not work.
Same behavior with the --authuser2 option.
2011-03-12 03:44:26 +01:00
Do not forget the option --ssl1 since PLAIN auth is only
2011-03-12 03:44:35 +01:00
supported with ssl encryption most of the time. But it can
work without --ssl1 if PLAIN is permitted in normal use.
2011-03-12 03:44:26 +01:00
2011-03-12 03:44:25 +01:00
Here is an example:
imapsync \
--host1 server1 \
2011-03-12 03:44:29 +01:00
--user1 joe \
2011-03-12 03:44:25 +01:00
--authuser1 AdminAccount \
--password1 AdminAccountPassword \
2011-03-12 03:44:29 +01:00
--ssl1 \
--host2 server2 \
2011-03-12 03:44:25 +01:00
--user2 joe \
--password2 joespassonserver2 \
2012-07-21 04:18:22 +02:00
--exclude "^user\."
2011-03-12 03:44:29 +01:00
2011-03-12 03:45:04 +01:00
======================================================================
Q: How to migrate from Sun Java Enterprise System / Sun One / iPlanet /
Netscape servers with an admin account?
R: Those imap servers don't allow the typical use of --authuser1 to use an
administrative account. They expect the use of an IMAP command called
proxyauth that is issued after login in as an administrative account.
For example, consider the administrative account 'administrator' and your
real user 'real_user'. The IMAP sequence would be:
OK [CAPABILITY IMAP4 IMAP4rev1 ACL QUOTA LITERAL+ NAMESPACE UIDPLUS
CHILDREN BINARY UNSELECT LANGUAGE STARTTLS XSENDER X-NETSCAPE XSERVERINFO
AUTH=PLAIN] imap.server IMAP4 service (Sun Java(tm) System Messaging
Server ...))
1 LOGIN administrator password
1 OK User logged in
2 PROXYAUTH real_user
2 OK Completed
In imapsync, you can achieve this by using the following options:
--host1 source.imap.server \
--user1 real_user \
--authuser1 administrator \
--proxyauth1 \
--passfile admin.txt
2011-03-12 03:44:29 +01:00
======================================================================
2011-03-12 03:44:51 +01:00
Q. Is there anyway of making imapsync purge the destination folder
when the source folder is deleted?
2011-03-12 03:44:57 +01:00
R. No, that's too dangerous. May be coded in future release.
2011-03-12 03:44:29 +01:00
2011-03-12 03:44:51 +01:00
But if the source folder is empty (not deleted) and options --delete2
--expunge2 are used then the destination folder will be empty.
2011-03-12 03:44:29 +01:00
2011-03-12 03:44:38 +01:00
======================================================================
Q. Is it possible to synchronize all messages from one server to
2011-03-12 03:44:51 +01:00
another without recreating the folder structure and the target server.
2011-03-12 03:44:38 +01:00
R. Yes.
2011-03-12 03:44:57 +01:00
For example, to synchronize all messages in all forders on host1
to folder INBOX only on host2:
2011-03-12 03:44:38 +01:00
1) First try (safe mode):
imapsync \
...
2012-07-21 04:18:22 +02:00
--regextrans2 "s/(.*)/INBOX/" \
2011-03-12 03:44:38 +01:00
--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, you should
2011-03-12 03:44:51 +01:00
only have one: the classical INBOX.
2011-03-12 03:44:38 +01:00
4) Remove --justfolders
2011-03-12 03:44:21 +01:00
2011-03-12 03:44:20 +01:00
======================================================================
2011-03-12 03:44:51 +01:00
Q. I have moved from Braunschweig to Graz, so I would like to have my
2011-03-12 03:45:04 +01:00
whole Braunschweig mail sorted into a subfolder INBOX.Braunschweig
of my new mail account.
2011-03-12 03:44:20 +01:00
R.
1) First try (safe mode):
imapsync \
...
2013-09-27 00:00:32 +02:00
--regextrans2 "s/INBOX(.*)/INBOX.Braunschweig\$1/" \
2011-03-12 03:44:20 +01:00
--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
2011-03-12 03:44:57 +01:00
R. --regextrans2 is used to transform folder names
2012-04-17 00:28:48 +02:00
Remember that --regextrans2 applies after the default
inversion prefix1 <-> prefix2 and sep1 <-> sep2
2011-03-12 03:44:57 +01:00
Examples:
2011-03-12 03:44:20 +01:00
2011-03-12 03:44:51 +01:00
0) First try with --dry --justfolders options since imapsync shows the
transformations it will do without really doing them. Then when
happy with the output remove the --dry --justfolders options.
2011-03-12 03:44:35 +01:00
2011-03-12 03:44:20 +01:00
1) To remove INBOX. in the name of destination folders:
2011-03-12 03:45:04 +01:00
2011-03-12 03:44:20 +01:00
--regextrans2 's/^INBOX\.(.+)/$1/'
2013-07-06 00:26:28 +02:00
2a) To sync all folders to INBOX:
imapsync ... --regextrans2 "s/.*/INBOX/"
2b) To sync a complete account in a subfolder called FOO:
2011-03-12 03:44:36 +01:00
2011-03-12 03:44:51 +01:00
a) Seperator is dot character "." and "INBOX" prefixes every folder
2011-03-12 03:45:04 +01:00
2011-03-12 03:44:20 +01:00
--regextrans2 's/^INBOX(.*)/INBOX.FOO$1/'
2011-03-12 03:45:04 +01:00
or:
b) Seperator is slash character "/" and there is no prefix
2011-03-12 03:44:36 +01:00
--regextrans2 's#(.*)#FOO/$1#'
2011-03-12 03:45:04 +01:00
or:
2012-04-17 00:28:48 +02:00
2011-03-12 03:45:04 +01:00
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.
2012-04-17 00:28:48 +02:00
--regextrans2 's,${h2_prefix}(.*),${h2_prefix}FOO${h2_sep}$1,' \
--regextrans2 's,^INBOX$,${h2_prefix}FOO{h2_sep}INBOX,'
2011-03-12 03:45:04 +01:00
2011-03-12 03:44:36 +01:00
2011-03-12 03:44:35 +01:00
3) to substitute all characters dot "." by underscores "_"
--regextrans2 's/\./_/g'
2011-03-12 03:45:02 +01:00
4) to change folder names like this:
[mail/Sent Items] -> [Sent]
[mail/Test] -> [INBOX/Test]
[mail/Test2] -> [INBOX/Test2]
--regextrans2 's#^mail/Sent Items$#Sent#' \
--regextrans2 's#^mail/#INBOX/#'
2011-03-12 03:44:22 +01:00
=======================================================================
2011-03-12 03:44:51 +01:00
Q. I would like to move emails from InBox to a sub-folder called,
2012-04-17 00:27:13 +02:00
say "2010-INBOX" based on the date (Like all emails received in the
Year 2010 should be moved to the folder called "2010-INBOX").
2011-03-12 03:44:22 +01:00
R. 2 ways :
a) Manually:
------------
2012-04-17 00:27:13 +02:00
1) You create a folder INBOX.2010-INBOX
2011-03-12 03:44:51 +01:00
2012-04-17 00:27:13 +02:00
2) Mostly every email software allow sorting by date. In INBOX, you
select from 1 january to 31 december 2010 messages with the shift key.
2011-03-12 03:44:51 +01:00
(in mutt, use ~d)
2012-04-17 00:27:13 +02:00
3) Cut/paste in INBOX.2010-INBOX
2011-03-12 03:44:22 +01:00
b) With imapsync:
-----------------
2012-04-17 00:27:13 +02:00
imapsync ... \
--search 'SENTSINCE 1-Jan-2010 SENTBEFORE 31-Dec-2010'
--regextrans2 's/^INBOX$/INBOX.2010-INBOX/' \
2011-03-12 03:44:22 +01:00
--folder INBOX
2011-03-12 03:44:47 +01:00
=======================================================================
Q. I want to play with headers line and --regexmess but I want to leave
the body as is
R. The header/body separation is a blank line so an example:
--regexmess 's{\A(.*?(?! ^$))^Date:(.*?)$}{$1Date:$2\nX-Date:$2}gxms'
2011-03-12 03:44:57 +01:00
Will replace (HeaderBegin and HeaderEnd are not part of the header)
2011-03-12 03:44:47 +01:00
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
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.
2011-03-12 03:44:23 +01:00
=======================================================================
Q. My imap server does not accept a message and warns
2011-03-12 03:44:51 +01:00
"Invalid header". What is the problem?
2011-03-12 03:44:23 +01:00
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: ...
2011-03-12 03:44:51 +01:00
Any Maildir/ configured imap server may refuse this message since its
header is invalid. The first "From " line is not valid. It lacks a
2011-03-12 03:44:57 +01:00
colon character ":". To solve this issue you have several solutions
2011-03-12 03:44:23 +01:00
2011-03-12 03:44:54 +01:00
a) Remove manually this first "From " line for each message before
using imapsync.
2011-03-12 03:44:23 +01:00
2011-03-12 03:44:54 +01:00
b) Replace manually the whitespace by a colon in string "From " but you
2011-03-12 03:44:57 +01:00
might end with two "From:" lines (just have a look at the other
header lines of the message)
2011-03-12 03:44:54 +01:00
2011-03-12 03:44:57 +01:00
c) Run imapsync with the following option (this replaces "From "by "From:"):
2011-03-12 03:44:53 +01:00
--regexmess 's/\AFrom /From:/'
or may be better (no other "From:" collision):
2011-03-12 03:44:57 +01:00
d) Run imapsync with the following option (this replaces "From "by "X-om:"):
2011-03-12 03:44:54 +01:00
--regexmess 's/\AFrom /X-om:/'
2011-03-12 03:44:57 +01:00
e) Run imapsync with the following option (this removes the whole "From " line):
2011-03-12 03:44:54 +01:00
--regexmess 's{\AFrom\ [^\n]*(\n)?}{}gxms'
Solution e) is solution a) made by imapsync itself.
Solutions c) and d) keep "From " lines information
(normally it's useless to keep them)
2011-03-12 03:44:53 +01:00
2011-03-12 03:44:54 +01:00
Best solutions are e) or d).
2011-03-12 03:44:39 +01:00
=======================================================================
Q. The contact folder isn't well copied.
2011-03-12 03:44:51 +01:00
How to copy the contact folder?
2011-03-12 03:44:39 +01:00
2011-03-12 03:44:51 +01:00
R. Forget the destination server (choose the same)
2011-03-12 03:44:39 +01:00
Change the script around line 1426
# ITSD
$new_id = $from->copy($t_fold,$f_msg);
#$new_id = $to->append_string($t_fold,$string, $flags_f, $d);
2011-03-12 03:44:51 +01:00
and tried a copy of the mail instead an append_string. Because we are
using the same server, we can use $from->copy Therefore we seem to not
download and upload the message and therefore we do not have any
format issues. And now it works fine. (Thanks to Hansjoerg.Maurer)
2011-03-12 03:44:39 +01:00
2011-03-12 03:44:57 +01:00
=======================================================================
Server specific issues and solutions
=======================================================================
2013-09-27 00:00:32 +02:00
2013-12-30 03:03:13 +01:00
=======================================================================
Q. From XXX to Exchange 2013 or Office365 read receipts are all resent
again after a sync. Even for old messages. How can I fix that?
R. imapsync can remove the header containing this read receipt request.
On Unix, add:
--regexmess 's{\A(.*?(?! ^$))(^Disposition-Notification-To:.*?\n)}{$1}gxms'
On Windows, add:
--regexmess "s{\A(.*?(?! ^$))(^Disposition-Notification-To:.*?\n)}{$1}gxms"
Since those read receipts should be sent for unseen messages going
to a seen state after the migration, you could be strict and apply
the regex only to seen messages.
Selecting seen message can be done with:
imapsync ... --search1 "SEEN" --regexmess "..."
Of course a second run has to be run without the --regexmess for
unseen messages:
imapsync ... --search1 "SEEN"
If you want to keep the header content and still suppress read receipts
then use the following instead, it adds a prefix "X-" to "Disposition-Notification-To:"
--regexmess 's{\A(.*?(?! ^$))^Disposition-Notification-To:(.*?)$}{$1X-Disposition-Notification-To:$2}igxms'
The small regex remove the header Disposition-Notification-To, the long one
replace it so users can still see messages had a Disposition-Notification-To
header before.
I will add an option to set this regex.
Thanks to David Karnowski for pointing and solving this issue.
2013-09-27 00:00:32 +02:00
=======================================================================
Q. From XXX to Exchange 2013 or Office365 I get this error message
sometimes: "BAD Command Argument Error 11"
R. This error message comes from Exchange IMAP server when it
encounters any problem. Most of the time it is one of the following:
* Some messages are bigger than the size limit. 10 MB by default
2014-02-13 18:34:20 +01:00
on Exchange. It can be upped by configuration for Exchange.
If you configure this limit then use option --maxsize 10000000
for 10 MB, change it if needed) to tell imapsync to skip those messages.
This value is 25 MB for Office365 --maxsize 25000000
2013-09-27 00:00:32 +02:00
2014-02-13 18:34:20 +01:00
imapsync ... --maxsize 10000000 # 10 MB for Exchange
imapsync ... --maxsize 25000000 # 25 MB for Office365
2013-09-27 00:00:32 +02:00
* Quota reached. The whole account is full.
It can be upped by configuration.
* Some messages have some lines too long. Use option --maxlinelength
to skip messages whose max line length is over a number of bytes.
--maxlinelength 1000 is a RFC2822 must but most server support
higher values.
imapsync ... --maxlinelength 1000
2013-12-30 03:03:13 +01:00
Have also in mind that Exchange closes the connection after 10 errors
encountered so you might also see "BYE Connection closed" errors from
Exchange, which means Exchange leaves the session and say goodbye,
come back later. Rerun a sync then.
=======================================================================
Q. From XXX to Exchange 2010 or 2013 or Office365 the flag Flagged does
not seem to be well synced.
R. Use the following trick. Run imapsync twice, one with --regexflag
and one without, like this:
1) imapsync ... --regexflag "s/\\Flagged//g"
2) imapsync ...
You can add --debugflags if you want to see what imapsync gets and
does in details with flags.
The magic of this trick is on ignoring the \Flagged flag on the first
sync and setting it on the second sync, with STORE instead of APPEND.
This Exchange bug seems that Exchange gets and sets well the Flagged
flag with APPEND in IMAP but then it forgets it with other protocols;
With STORE it sets and gets the "\Flagged" flag everywhere.
Thanks to Dave Murray and Simon Savva for reporting and solving
this issue.
2011-06-14 13:02:33 +02:00
=======================================================================
2014-02-13 18:34:20 +01:00
Q. Synchronizing from XXX to Gmail
2011-03-12 03:44:35 +01:00
2011-03-12 03:44:51 +01:00
R. There are some details to get the special [Gmail] sub-folders
right. Here's an example of migrating an old "Sent" folder to
Gmail's structure:
2011-03-12 03:44:35 +01:00
2011-03-12 03:44:57 +01:00
imapsync --host1 mail.oldhost.com \
2011-03-12 03:44:35 +01:00
--user1 my_email@oldhost.com \
--password1 password \
2014-02-13 18:34:20 +01:00
--host2 imap.gmail.com \
2011-03-12 03:44:35 +01:00
--user2 my_email@gmail.com \
--password2 password \
2014-02-13 18:34:20 +01:00
--ssl2 \
2012-12-29 01:43:39 +01:00
--exitwhenover 500000000 \
2013-04-22 21:50:50 +02:00
--addheader \
2014-02-13 18:34:20 +01:00
--exclude "\[Gmail\]$" \
--regextrans2 "s/[ ]+/_/g" \
--regextrans2 "s/[\^]/_/g" \
--regextrans2 "s/['\"\\\\]/_/g" \
--regextrans2 "s,^Sent$,[Gmail]/Sent Mail,"
2011-03-12 03:44:35 +01:00
2014-02-13 18:34:20 +01:00
Explanations:
2012-12-29 01:43:39 +01:00
2014-02-13 18:34:20 +01:00
--ssl2 is mandatory since Gmail only supports imap ssl connections.
2012-12-29 01:43:39 +01:00
2014-02-13 18:34:20 +01:00
--exitwhenover 500000000 option is here to avoid locking when
transfers exceed maximum limit.
See http://support.google.com/a/bin/answer.py?hl=en&answer=1071518
--exitwhenover is not mandatory in the sense you may be able to
use an upper value than 500 MB without disconnections; I don't
know the hard value, it seems to vary, so just have some tries
and report me what you discover in case you detect something.
2012-12-29 01:43:39 +01:00
2013-04-22 21:50:50 +02:00
The --addheader option is there because "Sent" folder messages
2014-02-13 18:34:20 +01:00
sometimes lack the "Message-Id:" and "Received:" headers needed
by imapsync to identify messages (only when --useuid is not used).
So option --addheader adds a "Message-Id" header consiting fo
the imap UID of the message on the host1 folder, like
"Message-Id: 12345@imapsync".
2012-11-27 23:32:36 +01:00
2013-04-22 21:50:50 +02:00
--exclude "\[Gmail\]$" is there to avoid a small examine/select error:
"Could not examine: 43 NO [NONEXISTENT] Unknown Mailbox: [Gmail]
(now in authenticated state) (Failure)".
2013-09-27 00:00:32 +02:00
--regextrans2 "s/[ ]+/_/g" is there to convert blank characters not
accepted by gmail to character _ underscore. In fact only leading
2013-12-30 03:03:13 +01:00
and trailing blank characters are problems with gmail, and
also succesive blank ending whith the IMAP error
"NO [CANNOT] Folder contains excess whitespace (Failure)"
2013-09-27 00:00:32 +02:00
--regextrans2 "s/[\^]/_/g" is mandatory. It converts, since
not accepted by gmail, character ^ to character _ underscore.
--regextrans2 "s/['\"\\\\]/_/g" is optional. It converts
characters ' or " or \ to character _ underscore.
2013-04-22 21:50:50 +02:00
2014-02-13 18:34:20 +01:00
--regextrans2 "s,^Sent$,[Gmail]/Sent Mail," is to transform the
folder name "Sent" and adapt it to Gmail "Sent Mail" folder.
If you're using a different language in Gmail you might adapt
this example with the folder name translated, an example in French:
imapsync ...
--regextrans2 "s,^Messages envoy&AOk-s$,[Gmail]/Messages envoy&AOk-s," \
You can add --folder "INBOX.Sent" in the example in case
you want to sync only the "Sent" folder.
2012-12-29 01:43:39 +01:00
You can select folders exported to imap within the gmail preferences,
2013-04-22 21:50:50 +02:00
unselect all "System labels" depending on your needs.
2012-12-29 01:43:39 +01:00
2014-02-13 18:34:20 +01:00
The "All Mail" archive pseudo-folder should be updated automaticaly.
2013-10-18 02:11:27 +02:00
=======================================================================
Q. Some of the folders are getting created with [IMAP] prefix on Google
side. How to stop creating folder with this prefix?
Any switch we can use? e.g. [IMAP]/Archive
R. No switch in imapsync since [IMAP]/ prefix is done by Gmail,
it might be configurable with Gmail parameters.
2012-12-29 01:43:39 +01:00
2011-03-12 03:44:40 +01:00
=======================================================================
2014-02-13 18:34:20 +01:00
Q. Synchronizing from Gmail to XXX
2011-03-12 03:44:40 +01:00
2011-03-12 03:44:51 +01:00
R. Gmail needs SSL
2011-03-12 03:44:40 +01:00
./imapsync \
2011-03-12 03:45:02 +01:00
--host1 imap.gmail.com \
2011-03-12 03:44:40 +01:00
--user1 gilles.lamiral@gmail.com \
2011-03-12 03:45:02 +01:00
--password1 gmailsecret \
2011-03-12 03:44:40 +01:00
--host2 localhost
2011-03-12 03:45:02 +01:00
--user2 tata \
--password2 tatasecret \
2014-02-13 18:34:20 +01:00
--ssl1 \
--exitwhenover 2500000000 \
2011-03-12 03:45:02 +01:00
--useheader="X-Gmail-Received" \
2014-02-13 18:34:20 +01:00
--useheader "Message-Id" \
--skipcrossduplicates \
--folderfirst "Work" \
--folderfirst "Friends" \
--folderlast "CanWait" \
--folderlast "[Gmail]/All Mail"
Explanations:
--ssl1 is mandatory since Gmail only supports imap ssl connections.
--exitwhenover 2500000000 option is here to avoid locking when
transfers exceed maximum limit.
See http://support.google.com/a/bin/answer.py?hl=en&answer=1071518
--exitwhenover is not mandatory in the sense you may be able to
use an upper value than 2.5 GB without disconnections; I don't
know the hard value, it seems to vary, so just have some tries
and report me what you discover in case you detect something.
--useheader="X-Gmail-Received" --useheader "Message-Id" are not
mandatory. I use them because I found (several years ago, it may
have changed) that Gmail always adds a different header
"X-Gmail-Received:" to all messages it gets. So the identification
by imapsync can not fall using this header. "Message-Id" is there
for safety about this Gmail rule.
2011-03-12 03:44:40 +01:00
If your destination imap server doesn't like "[Gmail]" name, just add
option:
--regextrans2 's/\[Gmail\]/Gmail/'
2012-04-17 00:27:13 +02:00
You can select folders exported to imap within the gmail preferences,
2012-11-27 23:32:36 +01:00
unselect all "System labels".
--exitwhenover option is here to avoid locking when transfers
exceed maximum limit.
See http://support.google.com/a/bin/answer.py?hl=en&answer=1071518
2014-02-13 18:34:20 +01:00
--skipcrossduplicates is optional but it can save Gigabytes of hard
disk memory. Within imap protocol, Gmail presents Gmail labels as
folders so a message labeled "Work" "ProjectX" "Urgent" ends up
in three different imap folders "Work" "ProjectX" and "Urgent"
after an imap sync. --skipcrossduplicates prevent this behavior.
An issue with --skipcrossduplicates is that the first label synced
by imapsync goes to its corresponding folder and other labels are
ignored. This way, at least you can choose what labels have the
priority by using the --folderfirst option. For example
--folderfirst "Work" will sync messages labeled "Work" before
messages labeled "CanWait" or "Urgent". By default imapsync
syncs folders (Gmail labels) using the classical alphanumeric order.
--folderlast "CanWait" will sync only messages that have the
label CanWait and only it.
--folderlast "[Gmail]/All Mail", in conjonction with option
--skipcrossduplicates, will only put in "[Gmail]/All Mail"
the messages that are not labeled at all.
2011-03-12 03:44:23 +01:00
2013-05-21 00:04:57 +02:00
=======================================================================
Q. How to use XOAUTH to globally authenticate gmail users?
The XOAUTH code and this FAQ item come from Eduardo Bortoluzzi
Thanks Eduardo!
R. The goal of OAUTH is to migrate all users from/to Google Apps
Premier Edition without knowing their passwords.
The global password is available at the Google Apps control panel,
at Advanced Tools -> Manage OAuth domain key.
./imapsync \
--host1 imap.gmail.com --ssl1 \
--user1 foo@lab3.dedal.br \
--password1 secret1 \
--authmech1 XOAUTH \
--host2 imap.gmail.com --ssl2 \
--user2 bar@lab3.dedal.br \
--password2 secret2 \
--authmech2 XOAUTH
Google Apps is a paid service, but you can try it for 30 days without any cost.
Some notes about configuring the Google Apps XOAUTH:
On "Advanced Tools > Manage OAuth domain key > Two-legged OAuth access control"
the "Allow access to all APIs" must be checked
(https://support.google.com/a/bin/answer.py?answer=162105)
OR
On "Advanced Tools > Manage third party OAuth client access",
the configured costumer key must have the scope
"https://mail.google.com/" configured
(https://support.google.com/a/bin/answer.py?answer=162106).
2011-03-12 03:44:47 +01:00
=======================================================================
Q. migrate email from gmail to google apps
R. Take a look at:
2011-03-12 03:45:04 +01:00
http://www.linux-france.org/prj/imapsync_list/msg00639.html
http://biasecurities.com/blog/2009/migrate-email-from-gmail-to-google-apps/
2011-03-12 03:44:47 +01:00
http://www.thamtech.com/blog/2008/03/29/gmail-to-google-apps-email-migration/
2014-02-13 18:34:20 +01:00
=======================================================================
Q. From Zimbra to XXX
imapsync ... \
--exclude "Conversation Action Settings" \
--exclude "Quick Step Settings" \
--exclude "News Feed"
=======================================================================
Q. From or to HMailServer version 4.4.1.
R. You have to add prefix and separator manually because 4.4.1 doesn't
honor the NAMESPACE imap command.
Example for host1:
imapsync ... \
--prefix1 "" --sep1 .
No specific option for HMailServer 5.3.3 since NAMESPACE is supported.
Maybe --subscribe_all will help you to see all migrated folders.
=======================================================================
Q. Synchronizing from SmarterMail to XXX
imapsync --host1 imap.d1.org --user1 joe --password1 secret1 --sep1 "/" \
--host2 imap.d2.org --user2 joe --password2 secret2 \
--prefix1 "" \
--regextrans2 "s#Sent Items$#Sent#" \
--dry --justfolders
Maybe add other --regextrans2 to change folder names and see the result.
When satisfied, run without --dry --justfolders
2012-04-17 00:26:18 +02:00
=======================================================================
2012-07-21 04:18:22 +02:00
Q. Synchronizing from Yahoo to XXX
2012-04-17 00:26:18 +02:00
R. Use --host1 imap.mail.yahoo.com --sep1 '/'
./imapsync \
--host1 imap.mail.yahoo.com \
--user1 billy \
--password1 secret \
--host2 XXX \
--user2 billy \
--password2 secret \
--sep1 '/'
Can also add --ssl1 to gain encrypted transfer from yahoo.
2012-04-17 00:27:13 +02:00
SSL seems to be mandatory for yahoo (since november 2011)
2012-04-17 00:26:18 +02:00
2011-03-12 03:44:47 +01:00
=======================================================================
Q. from Microsoft's Exchange 2007 to Google Apps for your Domain
(GAFYD)
R. Take a look at:
http://mark.ossdl.de/2009/02/migrating-from-exchange-2007-to-google-apps-mail/
=======================================================================
Q. Syncing from Google Apps domain to Googlemail account
A known bug encountered with this output (Alexander is a folder name):
2011-03-12 03:44:51 +01:00
2011-03-12 03:44:47 +01:00
++++ Verifying [Alexander] -> [Alexander] ++++
+ NO msg #16 [A96Dh4AwlLVphOAW5MS/eQ:779824] in Alexander
+ Copying msg #16:779824 to folder Alexander
flags from : [\Seen]["04-Jul-2007 14:32:22 +0100"]
Couldn't append msg #16 (Subject:[Rieter-Event (please accept with
comments)]) to folder Alexander: 46 NO Invalid folder: Sent (Failure)
In fact folder "Sent" is just the last folder listed previously
as a:
...
To Folder [Sent] does not exist yet
To Folder [Sonja] Size: 1024546 Messages: 96
...
R. Just run imapsync a time like this :
imapsync ... --folder Alexander
2013-10-18 02:11:27 +02:00
=======================================================================
Q. Migrating from or to Parallels Plex Server
R. It depends on the OS
Parallells Plesk Panel for Windows requires --sep2 / --prefix2 ""
Parallells Plesk Panel for Linux works with default parameters.
2011-03-12 03:44:16 +01:00
=======================================================================
2011-03-12 03:44:51 +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?
2011-03-12 03:43:55 +01:00
2011-03-12 03:44:57 +01:00
Two solutions:
2011-03-12 03:43:55 +01:00
R. Use
imapsync ... --include '^mail'
2011-03-12 03:44:57 +01:00
R. or (better)
2011-03-12 03:43:55 +01:00
imapsync ... --subscribed --subscribe
2011-03-12 03:44:16 +01:00
=======================================================================
2011-03-12 03:44:51 +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.
2011-03-12 03:43:55 +01:00
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
2011-03-12 03:44:51 +01:00
this is required to stop duplicates.
2011-03-12 03:44:15 +01:00
--maxage 3650
- some messages just don't seem to want to transfer and produce the
2011-03-12 03:44:51 +01:00
perl errors I mentioned before. This prevents the errors, but the
bad messages don't transfer.
2011-03-12 03:44:15 +01:00
Even though the mail migrated OK, there are a couple of gotchas with
Groupwise IMAP:
2011-03-12 03:44:51 +01:00
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).
2011-03-12 03:44:15 +01:00
It think this problem has been rectified in GW6.5.
2) The "skipheader '^Content-Type'" directive is required to stop
2011-03-12 03:44:51 +01:00
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.
2011-03-12 03:44:15 +01:00
3) Version 6.0.1 of the Groupwise Internet Connector sucks. I was
2011-03-12 03:44:51 +01:00
getting server aborts when I pushed it a bit hard! I eventually had to
2011-03-12 03:44:15 +01:00
upgrade to 6.0.4 which seems to be a lot more stable.
2011-03-12 03:44:16 +01:00
=======================================================================
2011-03-12 03:44:28 +01:00
Q. Migrating from iPlanet Messaging Server
5.2 Patch 2 (built Jul 14 2004)) to Groupwise 7.0
I encounter many errors like this:
"Error trying to append string: 17847 BAD APPEND"
R. GroupWise 7 seems buggy. Apply GroupWise 7 support pack 1
2011-03-12 03:44:29 +01:00
2012-07-21 04:18:22 +02:00
=======================================================================
Q. Migrating from David Tobit V10
2012-09-12 03:50:53 +02:00
R. Use the following options:
2012-07-21 04:18:22 +02:00
2012-09-12 03:50:53 +02:00
imapsync ... --prefix1 "" --sep1 / --idatefromheader ^
--nofoldersizes --useuid --nocheckmessageexists
2011-03-12 03:44:29 +01:00
=======================================================================
Q. Migrating from David Tobit V8
2012-09-12 03:50:53 +02:00
First try above V10 solution since improvments have been made
to support Tobit.
2011-03-12 03:44:29 +01:00
R. Use the following options :
2011-03-12 03:44:37 +01:00
imapsync ... --prefix1 INBOX. --sep1 / --subscribe --subscribed
2011-03-12 03:44:29 +01:00
2011-03-12 03:44:57 +01:00
=======================================================================
Q. Migrating from Tobit David Server 6
("DvISE Mail Access Server MA-6.60a (0118)")
2012-09-12 03:50:53 +02:00
First try above V10 solution since improvments have been made
to support Tobit.
2011-03-12 03:44:57 +01:00
R. Look at the discussion:
http://www.linux-france.org/prj/imapsync_list/msg00582.html
http://www.linux-france.org/prj/imapsync_list/threads.html#00582
patch saved in ./patches/imapsync-1.337_tobit_V6.patch
2011-03-12 03:44:29 +01:00
=======================================================================
2012-04-17 00:27:13 +02:00
Q. I need to migrate 1250 mailboxes, passwords are in a MySQL Database.
2011-03-12 03:44:29 +01:00
Can you tell me if your script suits my needs?
2012-04-17 00:27:13 +02:00
R. Mailboxes must exist before running imapsync.
You have to extract users logins and passwords in a csv file.
2011-03-12 03:44:29 +01:00
See the "HUGE MIGRATION" section in the README file.
2011-03-12 03:44:30 +01:00
======================================================================
Q. From Cyrus to Notes
2012-04-17 00:27:13 +02:00
Default behavior might works.
2011-03-12 03:44:30 +01:00
2011-03-12 03:44:32 +01:00
======================================================================
Q. From cyrus to dbmail
2012-04-17 00:27:13 +02:00
Default behavior might works.
2011-03-12 03:44:39 +01:00
2011-03-12 03:44:32 +01:00
======================================================================
2011-03-12 03:44:34 +01:00
Q: From MailEnable 1.75
R: --sep1 "/" --prefix1 ""
Q: From MailEnable 2.2
R: --sep1 "." --prefix1 ""
2013-07-25 23:42:01 +02:00
Q: To MailEnable
R: --sep2 / --prefix2 "" --addheader --messageidnodomain --syncflagsaftercopy
2011-03-12 03:44:35 +01:00
======================================================================
Q. From GMX IMAP4 StreamProxy
R. Use:
--prefix1 INBOX and --sep1 .
2011-03-12 03:44:35 +01:00
======================================================================
Q. From Courier to Archiveopteryx
2012-04-17 00:27:13 +02:00
R. You can read http://www.archiveopteryx.org/migration/imapsync
Default values might be fine now with latest imapsync.
2011-03-12 03:44:35 +01:00
2011-03-12 03:44:47 +01:00
======================================================================
Q. To Sun Java(tm) System Messaging Server 6.2-7.05
Q. To Communigate Pro - Solaris version
R. See and run patches/imapsync_1.267_jari
2011-03-12 03:44:35 +01:00
2011-03-12 03:44:39 +01:00
======================================================================
Q. From any to Exchange2007
Several problems:
2011-03-12 03:44:51 +01:00
- Big messages: increase the "send- and receive-connector"
2011-03-12 03:44:39 +01:00
in exchange2007 to 40 MB.
R. 2 solutions
R1. With imapsync (only partial success)
--skipsize --skipheader 'Received' \
--regexmess 's{\A(.*?(?!^$))^Date:(.*?)$}{$1Date:$2\nReceived: From; $2}gxms'
Any user having time to spend to debug Exchange2007 with imapsync
is welcome.
R2. Other solution
Two users succeded by using "MS Transporter Suite" (which is closed
expensive nonfree software).
2011-03-12 03:44:47 +01:00
======================================================================
Q. From Microsoft Exchange 2000 IMAP4rev1 server version 6.0.6487.0.
R. imapsync ... \
2012-04-17 00:27:13 +02:00
--prefix1 INBOX.
2011-03-12 03:44:35 +01:00
2012-12-29 01:43:39 +01:00
======================================================================
Q. From Softalk Workgroup Mail 7.6.4
R. Old Softalk releases don't support the IMAP SEARCH command.
Here are the options to get it working.
imapsync ... --sep1 '.' --prefix1 '' \
--noabletosearch --nocheckmessageexists --addheader
(Thanks to Andrew Tucker)
2013-09-26 23:59:52 +02:00
======================================================================
Q. From or to QQMail IMAP4Server
R. imapsync ... --noabletosearch
2011-03-12 03:44:34 +01:00
======================================================================
Q: How can I write an .rpm with imapsync
2011-06-14 13:04:24 +02:00
R. You'll find an RPM imapsync.spec file in the directory learn/rpm/
It has been downloaded from
https://svn.fysik.dtu.dk/projects/rpmbuild/trunk/SPECS/imapsync.spec
It has been tested with imapsync 1.434 (May 2011) on CentOS5
and RedHat RHEL5 Linux. (Thanks to Ole Holm Nielsen).
This imapsync.spec is derivated from Neil Brown work in 2007.
2011-09-25 22:31:48 +02:00
=======================================================================
Q. Where I can read up on the various IMAP RFCs?
R. Here:
RFC 3501 - INTERNET MESSAGE ACCESS PROTOCOL - VERSION 4rev1
http://www.faqs.org/rfcs/rfc3501.html
RFC2683 - IMAP4 Implementation Recommendations
http://www.faqs.org/rfcs/rfc2683.html
RFC 2595 - Using TLS with IMAP, POP3 and ACAP
http://www.faqs.org/rfcs/rfc2595.html
RFC 2822 - Internet Message Format
http://www.faqs.org/rfcs/rfc2822.html
RFC 2342 - IMAP4 Namespace
http://www.faqs.org/rfcs/rfc2342.html
RFC2180 - IMAP4 Multi-Accessed Mailbox Practice
http://www.faqs.org/rfcs/rfc2180.html
RFC 4549 - Synchronization Operations for Disconnected IMAP4 Clients
http://www.faqs.org/rfcs/rfc4549.html