Hi,

I'm experiencing serious issues using doveadm sync; mails are not
replicating and/or mails are duplicating. I wanted to use this for
migrating external mailboxes to my server (in order to overcome the time
when some servers/clients still use the old server and some already my
server, as described on <https://wiki2.dovecot.org/Tools/Doveadm/Sync>).

Finally I was able to reproduce this with the 2.3 branch (cf.
<https://dovecot.org/pipermail/dovecot/2019-April/115600.html>). I'm
sorry that I can only test the version 2.3.4.1, but according to the
changelog I think this is still an issue with the latest version.

I tried to find a few steps in order to replicate this easily:
For testing purposes I simulate both the remote and local server on my
Dovecot instance. I created rem...@domain.tld and lo...@domain.tld
accounts and both use mdbox and are empty.

First, send two mails to rem...@domail.tld (Subjects: Test1 and Test2).

Start backup remote IMAP account (rem...@domain.tld) to local account
(lo...@domain.tld):
$ doveadm -o imapc_user="rem...@domain.tld" -o imapc_password="PW" -o
imapc_host="localhost" backup -R -u lo...@domain.tld imapc:

Both mailboxes are in sync now (containing Test1 und Test2).

Now send two messages to rem...@domain.tld (Subjects Test3 and Test4)
and two messages to lo...@domain.tld (Subjects Test5 and Test6).

Run sync:
$ doveadm -o imapc_user="rem...@domain.tld" -o imapc_password="PW" -o
imapc_host="localhost" sync -R -u lo...@domain.tld imapc:

See that syncing fails:
rem...@domain.tld contains: Test1,2,3,4,5,6 (as expected)
lo...@domain.tld contains:  Test1,2,5,6,4 (Test3 is missing here)
When not using the "-R" parameter it seems to work.

Running sync again:
$ doveadm -o imapc_user="rem...@domain.tld" -o imapc_password="PW" -o
imapc_host="localhost" sync -R -u lo...@domain.tld imapc:
causes messages to duplicate:
rem...@domain.tld contains: Test1,2,6,5,4,3,5,6,4,6,5,4,3,5,6
lo...@domain.tld contains:  Test1,2,5,4,6,4,5,6 (3 is still missing)
This is independent of the "-R" parameter.

I could also experience this issue when using one-way sync, however, the
first one-way sync is still ok, but then messages start duplicating as
for the two-way sync without "-R":
$ doveadm -o imapc_user="rem...@domain.tld" -o imapc_password="PW" -o
imapc_host="localhost" sync -R -1 -u lo...@domain.tld imapc:

Hope you can replicate this, too, and finally fix the issue.

-- 
Best regards,
 Sven Strickroth
 PGP key id F5A9D4C4 @ any key-server

Reply via email to