Nicolas ROCHE
2013-May-27 14:09 UTC
[Dovecot] Problem with dsync replication : mails are not deleted correctly
Hello, I would like to configure a postfix / dovecot cluster based on ssh / dsync replication. 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. 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 ? Regards, Nicolas. [root at int-proxy1 dovecot-2.2.2-p1]# doveconf -n # 2.2.2: /usr/local/etc/dovecot/dovecot.conf # OS: Linux 2.6.18-194.el5xen x86_64 Red Hat Enterprise Linux Server release 5.5 (Tikanga) ext3 disable_plaintext_auth = no hostname = int-proxy1 mail_location = maildir:/home/vmail/%u mail_plugins = acl quota notify replication mail_privileged_group = mail mbox_write_locks = fcntl namespace inbox { inbox = yes location mailbox Drafts { special_use = \Drafts } mailbox Junk { special_use = \Junk } mailbox Sent { special_use = \Sent } mailbox "Sent Messages" { special_use = \Sent } mailbox Trash { special_use = \Trash } prefix } passdb { args = /usr/local/etc/dovecot/dovecot-sql.conf driver = sql } plugin { mail_replica = remote:vmail at int-proxy2 replication_full_sync_interval = 1 hours } pop3_uidl_format = %g postmaster_address = postmaster at mail.fluid-e.int service aggregator { fifo_listener replication-notify-fifo { mode = 0666 user = vmail } unix_listener replication-notify { mode = 0666 user = vmail } } service auth-worker { user = root } service auth { unix_listener /var/spool/postfix/private/auth { group = postfix mode = 0666 user = postfix } unix_listener auth-userdb { mode = 0666 user = vmail } user = root } service config { unix_listener config { user = vmail } } service doveadm { user = vmail } service lmtp { unix_listener /var/spool/postfix/private/dovecot-lmtp { group = postfix mode = 0666 user = postfix } } service pop3-login { inet_listener pop3 { port = 110 } inet_listener pop3s { port = 995 ssl = yes } } service replicator { process_min_avail = 1 } ssl_cert = </etc/ssl/certs/dovecot.pem ssl_key = </etc/ssl/private/dovecot.pem submission_host = int-proxy1:25 userdb { args = /usr/local/etc/dovecot/dovecot-sql.conf driver = sql } protocol imap { mail_plugins = acl quota imap_acl imap_quota mail_log notify }
Timo Sirainen
2013-May-27 14:19 UTC
[Dovecot] Problem with dsync replication : mails are not deleted correctly
On 27.5.2013, at 17.09, Nicolas ROCHE <nicolas.roche at fluid-e.com> wrote:> 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?> 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.