[Dovecot] Dsync didn't updates automatically
Hi,
I'm trying to use the Dsync cluster feature in a simple setup, without director, but I'm having some troubles.
First of all, I want to know if this functionality syncs the mailbox when the user receive a mail or only when the dovecot starts?
Reading the Dovecot mailing list and the design description for a dsync-replicated Dovecot cluster, I understood that it should sync every time a new mail arrives, but it isn't happening in my system. So, can I do this update automatically? If yes, why is it not working properly? Maybe is my configuration files or maybe I'm confusing the capability of this feature.
I'm using Dovecot 2.1.7 included in the Debian Wheezy, with virtual users in a MySQL database, Moreover, I have the following configuration:
mail_plugins = $mail_plugins notify replication
service aggregator { # give enough permissions for mail processes fifo_listener replication-notify-fifo { user = vmail #mode = 0666 } unix_listener replication-notify { user = vmail #mode = 0666 } }
service replicator { # start replication at startup process_min_avail = 1 }
plugin { # host1 replicates to host2 #mail_replica = remote:vmail at 10.127.0.2 # host2 replicates to host1 mail_replica = remote:vmail@10.127.0.5 }
dsync_remote_cmd = ssh -l vmail %{host} doveadm dsync-server -u%u -l%{lock_timeout} -n%{namespace}
service doveadm { # if you're using a single virtual user, set this to # start ssh as vmail (not root) user = vmail }
service config { unix_listener config { user = vmail } }
The vmail user has rsa id's in both servers, so it can do ssh connections without asking for password.
I appreciate your help. Best Regards,
--
Breno Moreira
"I have no idols. I admire work, dedication and competence." Ayrton Senna
On 3.1.2013, at 18.57, Breno Moreira brenoavm@gmail.com wrote:
I'm trying to use the Dsync cluster feature in a simple setup, without director, but I'm having some troubles.
First of all, I want to know if this functionality syncs the mailbox when the user receive a mail or only when the dovecot starts?
Both, if configured correctly.
Reading the Dovecot mailing list and the design description for a dsync-replicated Dovecot cluster, I understood that it should sync every time a new mail arrives, but it isn't happening in my system. So, can I do this update automatically? If yes, why is it not working properly? Maybe is my configuration files or maybe I'm confusing the capability of this feature.
Does it sync at startup either? Anything in error log? http://wiki2.dovecot.org/Replication also describes the configuration.
I'm using Dovecot 2.1.7 included in the Debian Wheezy, with virtual users in a MySQL database, Moreover, I have the following configuration:
I don't see anything obviously wrong in your setup.
Hi Timo, Thanks for your answer.
Good to know that it can sync when a new mail arrives.
I've already seen this wiki page, my configuration is almost the same that the one described there. It syncs at startup, but doesn't syncs when a new email arrives, and that is my problem.
In error log, some messages are printed when Dovecot starts:
Jan 4 13:22:21 srv1 dovecot: master: Dovecot v2.1.7 starting up (core dumps disabled) Jan 4 13:22:21 srv1 dovecot: auth-worker(4322): mysql( supra-lb.testesupra.com.br): Connected to database Supramail Jan 4 13:22:21 srv1 dovecot: doveadm(nobody): Fatal: setgid(65534(nogroup) from userdb lookup) failed with euid=5000(vmail), gid=5000(vmail), egid=5000(vmail): Operation not permitted (This binary should probably be called with process group set to 65534(nogroup) instead of 5000(vmail)) Jan 4 13:22:21 srv1 dovecot: doveadm(mav): Fatal: setgid(1000(mav) from userdb lookup) failed with euid=5000(vmail), gid=5000(vmail), egid=5000(vmail): Operation not permitted (This binary should probably be called with process group set to 1000(mav) instead of 5000(vmail))
But when there is a new mail, it only prints a success message:
Server 1:
an 4 13:24:30 srv1 postfix/smtpd[4264]: connect from srv1[127.0.0.1] Jan 4 13:24:30 srv1 postfix/smtpd[4264]: improper command pipelining after EHLO from srv1[127.0.0.1]: mail from: foo@bar.com\nrcpt to: mav@testesupra.com.br\ndata\nThis is qualquer coisa from proxy\n.\nquit\n Jan 4 13:24:30 srv1 postfix/smtpd[4264]: E5BCE1FF82: client=srv1[127.0.0.1] Jan 4 13:24:30 srv1 postfix/cleanup[4372]: E5BCE1FF82: message-id=< 20130104152430.E5BCE1FF82@srv1.testesupra.com.br> Jan 4 13:24:31 srv1 postfix/smtpd[4264]: disconnect from srv1[127.0.0.1] Jan 4 13:24:31 srv1 postfix/qmgr[2689]: E5BCE1FF82: from=foo@bar.com, size=344, nrcpt=1 (queue active) Jan 4 13:24:31 srv1 dovecot: lmtp(4375): Connect from 127.0.0.1 Jan 4 13:24:31 srv1 dovecot: auth-worker(4376): mysql( supra-lb.testesupra.com.br): Connected to database Supramail Jan 4 13:24:31 srv1 dovecot: lmtp(4375): Disconnect from 127.0.0.1: Client quit (in reset) Jan 4 13:24:31 srv1 postfix/lmtp[4374]: E5BCE1FF82: to=< mav@testesupra.com.br>, relay=localhost[127.0.0.1]:7025, delay=0.42, delays=0.09/0.01/0.01/0.31, dsn=2.0.0, status=sent (250 2.0.0 < mav@testesupra.com.br> LrxIHy/05lBrDwAArsoYNw Saved)
Server 2:
Jan 4 13:24:31 srv2 dovecot: lmtp(3947): Connect from 192.168.100.195 Jan 4 13:24:31 srv2 dovecot: auth-worker(3948): mysql( supra-lb.testesupra.com.br): Connected to database Supramail Jan 4 13:24:31 srv2 dovecot: lmtp(3947, mav@testesupra.com.br): LrxIHy/05lBrDwAArsoYNw: msgid=< 20130104152430.E5BCE1FF82@srv1.testesupra.com.br>: saved mail to INBOX
On Fri, Jan 4, 2013 at 1:16 AM, Timo Sirainen tss@iki.fi wrote:
On 3.1.2013, at 18.57, Breno Moreira brenoavm@gmail.com wrote:
I'm trying to use the Dsync cluster feature in a simple setup, without director, but I'm having some troubles.
First of all, I want to know if this functionality syncs the mailbox when the user receive a mail or only when the dovecot starts?
Both, if configured correctly.
Reading the Dovecot mailing list and the design description for a dsync-replicated Dovecot cluster, I understood that it should sync every time a new mail arrives, but it isn't happening in my system. So, can I do this update automatically? If yes, why is it not working properly? Maybe is my configuration files or maybe I'm confusing the capability of this feature.
Does it sync at startup either? Anything in error log? http://wiki2.dovecot.org/Replication also describes the configuration.
I'm using Dovecot 2.1.7 included in the Debian Wheezy, with virtual users in a MySQL database, Moreover, I have the following configuration:
I don't see anything obviously wrong in your setup.
--
Breno Moreira
"I have no idols. I admire work, dedication and competence." Ayrton Senna
On Fri, 2013-01-04 at 13:29 -0200, Breno Moreira wrote:
Good to know that it can sync when a new mail arrives.
I've already seen this wiki page, my configuration is almost the same that the one described there. It syncs at startup, but doesn't syncs when a new email arrives, and that is my problem.
Show your full doveconf -n output?
# 2.1.7: /etc/dovecot/dovecot.conf # OS: Linux 3.2.0-4-amd64 x86_64 Debian 7.0 auth_mechanisms = plain login auth_socket_path = /var/run/dovecot/auth-userdb disable_plaintext_auth = no dsync_remote_cmd = ssh -l vmail %{host} doveadm dsync-server -u%u -l%{lock_timeout} -n%{namespace} lmtp_proxy = yes mail_fsync = always mail_gid = vmail mail_location = maildir:~/.maildir mail_plugins = " quota notify replication" mail_uid = vmail mmap_disable = yes 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 { driver = pam } passdb { args = /etc/dovecot/dovecot-sql.conf.ext driver = sql } plugin { mail_replica = remote:vmail@10.127.0.2 quota = maildir:Quota sieve = ~/.dovecot.sieve sieve_dir = ~/sieve } protocols = imap pop3 lmtp service aggregator { fifo_listener replication-notify-fifo { user = vmail } unix_listener replication-notify { user = vmail } } service auth { unix_listener /var/spool/postfix/private/auth { mode = 0666 } unix_listener auth-userdb { group = vmail mode = 0666 user = vmail } user = root } service config { unix_listener config { user = vmail } } service doveadm { user = vmail } service imap-login { service_count = 0 } service lmtp { inet_listener lmtp { address = srv1.testesupra.com.br 192.168.100.195 port = 7025 } } service pop3-login { service_count = 0 } service replicator { process_min_avail = 1 } ssl_cert =
On Fri, Jan 4, 2013 at 7:40 PM, Timo Sirainen tss@iki.fi wrote:
doveconf -n
--
Breno Moreira
"I have no idols. I admire work, dedication and competence." Ayrton Senna
On Mon, 2013-01-07 at 13:34 -0200, Breno Moreira wrote:
mail_plugins = " quota notify replication" .. protocol lmtp { mail_plugins = " quota sieve" postmaster_address = postmaster@srv1.testesupra.com.br } protocol imap { mail_plugins = " quota imap_quota" }
Replication plugin isn't enabled for lmtp/imap.
Timo,
It did the trick and solved my problem. Thanks for your help.
I have just one more question: In Dovecot 2.1.7, it will make a full sync every time a new mail arrives or it can make the fast sync?
On Mon, Jan 7, 2013 at 11:07 PM, Timo Sirainen tss@iki.fi wrote:
On Mon, 2013-01-07 at 13:34 -0200, Breno Moreira wrote:
mail_plugins = " quota notify replication" .. protocol lmtp { mail_plugins = " quota sieve" postmaster_address = postmaster@srv1.testesupra.com.br } protocol imap { mail_plugins = " quota imap_quota" }
Replication plugin isn't enabled for lmtp/imap.
--
Breno Moreira
"I have no idols. I admire work, dedication and competence." Ayrton Senna
participants (2)
-
Breno Moreira
-
Timo Sirainen