Odd replication behaviour

James Pattinson james at pattinson.org
Sat Oct 31 16:49:11 EET 2020


Solved. I knew this would happen. The act of writing it all out and including the configuration output gave me the solution.

I am using lmtp to deliver mail from postfix to Dovecot. I was missing the notify and replication plugins from 20-lmtp.conf

They were only present in 10-mail.conf as

mail_plugins = notify replication

Now, adding to 20-lmtp.conf:

protocol lmtp {
  mail_plugins = sieve notify replication
}

Works fine now. Hope this helps someone else.

Cheers
James

> On 31 Oct 2020, at 14:40, James Pattinson <james at pattinson.org> wrote:
> 
> Hi,
> 
> I have just built a new pair of similar machines both running CentOS 8.2 (selinux disabled) and Dovecot 2.3.8 (9df20d2db).
> 
> One machine is a VPS (host A) and one is on my home network (host B). The idea is that they are set up in a master/master config with Dovecot replication.
> 
> I seem to have this 95% working but there is one strange issue I can’t work out.
> 
> Currently B is a perfect replica of A. I have pointed an instance of Thunderbird at it, and I can see all my mails. If I delete any mails or change any flags, I see the same changes almost instantly on the A side.
> 
> PROBLEM: if host A receives a new mail, I don’t see it on B until I do ‘something’ to change metadata, for example deleting any random email, or marking an email as read on EITHER side causes the new email to appear almost instantly on the B side.
> 
> I would have expected emails on B to appear immediately. Am I doing something wrong?
> 
> Extra info -  my mailboxes are in Maildir format with single OS user (vmail). I have about 4000 emails in the Inbox and about 30k in other folders.
> 
> There are only 5 users and I’m using passdb as the very simple backend.
> 
> Replication is via doveadm on a specified port (not SSH). Some output from dovecot -n is below.
> 
> Cheers
> James
> 
> HOST A
> 
> # 2.3.8 (9df20d2db): /etc/dovecot/dovecot.conf
> # Pigeonhole version 0.5.8 (b7b03ba2)
> # OS: Linux 4.18.0-193.28.1.el8_2.x86_64 x86_64 CentOS Linux release 8.2.2004 (Core)  xfs
> # Hostname: hosta.domain
> auth_mechanisms = plain login
> doveadm_password = # hidden, use -P to show it
> doveadm_port = 4040
> first_valid_uid = 1000
> mail_debug = yes
> mail_home = /srv/vmail/%u
> mail_location = maildir:/srv/vmail/%u
> mail_plugins = notify replication
> managesieve_notify_capability = mailto
> managesieve_sieve_capability = fileinto reject envelope encoded-character vacation subaddress comparator-i;ascii-numeric relational regex imap4flags copy include variables body enotify environment mailbox date index ihave duplicate mime foreverypart extracttext
> mbox_write_locks = fcntl
> namespace inbox {
>  inbox = yes
>  location = 
>  mailbox Drafts {
>    auto = subscribe
>    special_use = \Drafts
>  }
>  mailbox Junk {
>    auto = subscribe
>    special_use = \Junk
>  }
>  mailbox Sent {
>    special_use = \Sent
>  }
>  mailbox "Sent Messages" {
>    special_use = \Sent
>  }
>  mailbox Trash {
>    auto = subscribe
>    special_use = \Trash
>  }
>  prefix = 
> }
> passdb {
>  args = scheme=BLF-CRYPT username_format=%u /etc/dovecot/users
>  driver = passwd-file
> }
> plugin {
>  mail_replica = tcp:b.b.b.b:4040
>  sieve = file:~/sieve;active=~/.dovecot.sieve
>  sieve_before = /var/mail/SpamToJunk.sieve
> }
> protocols = imap lmtp
> service aggregator {
>  fifo_listener replication-notify-fifo {
>    group = root
>    mode = 0660
>    user = vmail
>  }
>  unix_listener replication-notify {
>    group = root
>    mode = 0660
>    user = vmail
>  }
> }
> service auth {
>  unix_listener /var/spool/postfix/private/auth {
>    group = postfix
>    mode = 0600
>    user = postfix
>  }
> }
> service doveadm {
>  inet_listener {
>    port = 4040
>  }
> }
> service lmtp {
>  unix_listener /var/spool/postfix/private/dovecot-lmtp {
>    group = postfix
>    mode = 0600
>    user = postfix
>  }
> }
> service replicator {
>  process_min_avail = 1
>  unix_listener replicator-doveadm {
>    mode = 0600
>    user = vmail
>  }
> }
> ssl = required
> ssl_cert = </etc/letsencrypt/live/mail2.pattinson.org/fullchain.pem
> ssl_cipher_list = PROFILE=SYSTEM
> ssl_dh = # hidden, use -P to show it
> ssl_key = # hidden, use -P to show it
> ssl_min_protocol = TLSv1.2
> ssl_prefer_server_ciphers = yes
> userdb {
>  args = username_format=%u /etc/dovecot/users
>  default_fields = uid=vmail gid=mail home=/srv/vmail/%u
>  driver = passwd-file
> }
> protocol lmtp {
>  mail_plugins = sieve
> }
> protocol lda {
>  mail_plugins = notify replication sieve
> }
> 
> HOST B
> 
> # 2.3.8 (9df20d2db): /etc/dovecot/dovecot.conf
> # Pigeonhole version 0.5.8 (b7b03ba2)
> # OS: Linux 4.18.0-193.28.1.el8_2.x86_64 x86_64 CentOS Linux release 8.2.2004 (Core)  ext4
> # Hostname: hostb
> auth_mechanisms = plain login
> doveadm_password = # hidden, use -P to show it
> doveadm_port = 4040
> first_valid_uid = 1000
> mail_debug = yes
> mail_home = /srv/vmail/%u
> mail_location = maildir:/srv/vmail/%u
> mail_plugins = notify replication
> managesieve_notify_capability = mailto
> managesieve_sieve_capability = fileinto reject envelope encoded-character vacation subaddress comparator-i;ascii-numeric relational regex imap4flags copy include variables body enotify environment mailbox date index ihave duplicate mime foreverypart extracttext
> mbox_write_locks = fcntl
> namespace inbox {
>  inbox = yes
>  location = 
>  mailbox Drafts {
>    auto = subscribe
>    special_use = \Drafts
>  }
>  mailbox Junk {
>    auto = subscribe
>    special_use = \Junk
>  }
>  mailbox Sent {
>    special_use = \Sent
>  }
>  mailbox "Sent Messages" {
>    special_use = \Sent
>  }
>  mailbox Trash {
>    auto = subscribe
>    special_use = \Trash
>  }
>  prefix = 
> }
> passdb {
>  args = scheme=BLF-CRYPT username_format=%u /etc/dovecot/users
>  driver = passwd-file
> }
> plugin {
>  mail_replica = tcp:a.a.a.a:4040
>  sieve = file:~/sieve;active=~/.dovecot.sieve
>  sieve_before = /var/mail/SpamToJunk.sieve
> }
> protocols = imap lmtp
> service aggregator {
>  fifo_listener replication-notify-fifo {
>    group = root
>    mode = 0660
>    user = vmail
>  }
>  unix_listener replication-notify {
>    group = root
>    mode = 0660
>    user = vmail
>  }
> }
> service auth {
>  unix_listener /var/spool/postfix/private/auth {
>    group = postfix
>    mode = 0600
>    user = postfix
>  }
> }
> service doveadm {
>  inet_listener {
>    port = 4040
>  }
> }
> service lmtp {
>  unix_listener /var/spool/postfix/private/dovecot-lmtp {
>    group = postfix
>    mode = 0600
>    user = postfix
>  }
> }
> service replicator {
>  process_min_avail = 1
>  unix_listener replicator-doveadm {
>    mode = 0600
>    user = vmail
>  }
> }
> ssl = required
> ssl_cert = </etc/letsencrypt/live/mail2.pattinson.org/fullchain.pem
> ssl_cipher_list = PROFILE=SYSTEM
> ssl_dh = # hidden, use -P to show it
> ssl_key = # hidden, use -P to show it
> ssl_min_protocol = TLSv1.2
> ssl_prefer_server_ciphers = yes
> userdb {
>  args = username_format=%u /etc/dovecot/users
>  default_fields = uid=vmail gid=mail home=/srv/vmail/%u
>  driver = passwd-file
> }
> protocol lmtp {
>  mail_plugins = sieve
> }
> protocol lda {
>  mail_plugins = notify replication sieve
> }
> 
> 



More information about the dovecot mailing list