[Dovecot] Problem with dsync replication : mails are not deleted correctly
Nicolas ROCHE
nicolas.roche at fluid-e.com
Mon May 27 17:50:34 EEST 2013
> I have two linux serveurs (Oracle RHEL 5 86_64) and I install both sides dovecot (V2.2.2+), postfix (2.10.0) and mysql (Ver 14.12 Distrib 5.0.77).
> I configured these servers in order to make them replicate, and I created some virtual users.
> I use some java code in order to send mail (with SMTP) and to get mail (with POP3).
> When the java code get a mail, it deletes it from mailbox (the flag "DELETED" is set to true).
>
> When I send a mail on server A, I can see the mail replicated on both servers A and B : a file containing the message data exists in /home/vmail/test03/new/ in both sides.
The mail is delivered via LMTP?
==> I don't think so (but I don't know exactly what is LMTP).
> When I get the mail from server A with my java POP3 client, all is OK : the mail is deleted on both servers A and B (no more file in /home/vmail/test03/new/).
>
> The problem is when I send a mail on server A and I get it from server B : I can get the mail, but the mail is not deleted from server B, and neither from server A.
> When I try a second time to get the mail on server B, then all becomes OK : the mail is deleted on both server A and B.
>
> I can reproduce the problem every time.
>
> Is it a known bug or not ? If yes, is there a patch ? If no, may the problem come from my config ?
Shouldn't happen. Try this:
1. Disable the replication plugin (remove from mail_plugins)
2. Deliver a new mail on A
3. Sync the new mail to the replica: doveadm sync -u user at domain -d
4. Read + delete mail on B (and verify it gets deleted from B)
5. Sync the deletion to the replica with rawlog enabled: doveadm sync -r rawlog -u user at domain -d
Now assuming that the mail was added back to B instead of being deleted from A, send the rawlog to me.
I tried the 5 steps successfully :
1 - I commented "mail_plugins" in my config and restart dovecot service
2 - I delivered I mail on server A : I can see the mail on the server A in /home/vmail/test03/new/ but not in server B.
3 - I synchronized servers : from server A I executed the command "doveadm sync -u test03 test03 at int-proxy2". The mail is then in /home/vmail/test03/new/ on both servers A and B.
4 - I read and delete mail on server B. The mail is deleted from server B but is still on server A in /home/vmail/test03/new/.
5 - I synchronized servers : from server B I executed the command "doveadm sync -r rawlog -u test03 test03 at int-proxy1". The mail is then deleted on both servers.
More information about the dovecot
mailing list