Limit replication to one user

Arne Hoffmann arne at fish.in-berlin.de
Wed Sep 14 09:27:39 UTC 2016


Hello, 

we have a setup here where the main (and only important) feature of the IMAP
server is the public folder. Two Dovecot instances are running in a
active/passive cluster and mailstorage should be replicated between the two. 

Since there is a race condition when using public namespaces (locking on
user level and not on mailbox level) I had the intention of limiting the
replication to one user. 

I read somewhere that dsync is replicating all the users the command
"doveadm user '*'" shows. And the command only shows *one* user because I
have modified the iterate_query: 


,----[/etc/dovecot/mysql.conf]
| iterate_query  = SELECT username AS user FROM mailbox WHERE username = 'data_replication at example.com'
`----


root [~]# doveadm user '*'
data_replication at example.com 
root [~]#


So, why does Dovecot still replicate mails from other users inboxes? And why
does doveadm replicator still show other users? 


root [~]# doveadm replicator status '*'
username                          priority fast sync full sync success sync failed
data_replication at example.com      none     00:57:14  01:13:21  00:57:12 -
arne.hoffmann at example.com         none     00:20:04  00:31:40  00:20:02 -
root [~]#


[I removed some whitespace to keep line length in check] 


Any explanation of this behavior would be just awesome. Hints to possible solution even more! :) 



   

root [~]# doveconf -n
# 2.2.24 (a82c823): /etc/dovecot/dovecot.conf
# Pigeonhole version 0.4.13 (7b14904)
# OS: Linux 3.16.0-4-amd64 x86_64 Debian 8.5 ext4
debug_log_path = /var/log/mail.debug
disable_plaintext_auth = no
doveadm_password =  # hidden, use -P to show it
mail_debug = yes
mail_location = maildir:/var/mail/vmail/%d/%n/Maildir:INBOX=/var/mail/vmail/%d/%n/Maildir
mail_plugins = " listescape notify replication"
mail_privileged_group = vmail
namespace {
  location = maildir:/var/mail/vmail/Öffentliche Ordner:INDEXPVT=~/Maildir/Öffentliche Ordner
  mailbox "Gelöschte Elemente" {
    auto = subscribe
    special_use = \Trash
  }
  mailbox XYZ-Projekt {
    auto = subscribe
  }
  prefix = Öffentliche Ordner/
  separator = /
  subscriptions = no
  type = public
}
namespace inbox {
  inbox = yes
  location =
  mailbox "Gelöschte Elemente" {
    auto = subscribe
    special_use = \Trash
  }
  prefix =
  separator = /
  type = private
}
passdb {
  args = /etc/dovecot/mysql.conf
  driver = sql
}
plugin {
  mail_replica = tcps:10.162.70.70:22001
}
protocols = imap
replication_max_conns = 1
service aggregator {
  fifo_listener replication-notify-fifo {
    user = vmail
  }
  unix_listener replication-notify {
    user = vmail
  }
}
service doveadm {
  inet_listener {
    port = 22001
    ssl = yes
  }
}
service replicator {
  process_min_avail = 1
  unix_listener replicator-doveadm {
    mode = 0660
    user = vmail
  }
}
ssl = required
ssl_ca = </etc/ssl/os/ca-cert.pem
ssl_cert = </etc/ssl/os/cert-10-162-70-71.pem
ssl_client_ca_file = /etc/ssl/os/cert-all.pem
ssl_client_cert = </etc/ssl/os/cert-10-162-70-71.pem
ssl_client_key = </etc/ssl/os/key-10-162-70-71.pem
ssl_key = </etc/ssl/os/key-10-162-70-71.pem
ssl_require_crl = no
userdb {
  args = /etc/dovecot/mysql.conf
  driver = sql
}
local 10.162.70.72 {
  protocol imap {
    ssl_ca = </etc/ssl/os/ca-cert.pem
    ssl_cert = </etc/ssl/os/cert-10-162-70-72.pem
    ssl_client_ca_file = /etc/ssl/os/cert-all.pem
    ssl_client_cert = </etc/ssl/os/cert-10-162-70-72.pem
    ssl_client_key = </etc/ssl/os/key-10-162-70-72.pem
    ssl_key = </etc/ssl/os/key-10-162-70-72.pem
  }
}
root [~]#



Regards,
    Arne


More information about the dovecot mailing list