From 267f4213acf2e92bc0ebedfdaac2db328290339a Mon Sep 17 00:00:00 2001 From: Alex Dehnert Date: Fri, 15 Mar 2019 13:14:26 -0400 Subject: [PATCH] Set up replication --- conf.d/10-mail.conf | 1 + conf.d/30-replication.conf | 43 +++++++++++++++++++++++++++++++++++++ conf.d/auth-system.conf.ext | 4 ++++ 3 files changed, 48 insertions(+) create mode 100644 conf.d/30-replication.conf diff --git a/conf.d/10-mail.conf b/conf.d/10-mail.conf index 89ea4c6..2aaf3df 100644 --- a/conf.d/10-mail.conf +++ b/conf.d/10-mail.conf @@ -131,6 +131,7 @@ namespace inbox { # Dictionary for key=value mailbox attributes. Currently used by URLAUTH, but # soon intended to be used by METADATA as well. #mail_attribute_dict = +mail_attribute_dict = file:%h/.maildir/dovecot-attributes ## ## Mail processes diff --git a/conf.d/30-replication.conf b/conf.d/30-replication.conf new file mode 100644 index 0000000..0c3583b --- /dev/null +++ b/conf.d/30-replication.conf @@ -0,0 +1,43 @@ +# Configure Dovecot mail replication +# Based on https://wiki.dovecot.org/Replication + +mail_plugins = $mail_plugins notify replication + +service replicator { + process_min_avail = 1 +} + +dsync_remote_cmd = ssh -l%{login} %{host} doveadm dsync-server -u%u +plugin { + mail_replica = remote:dovecot-vmail@mail-pi.dehnerts.com +} + +service aggregator { + fifo_listener replication-notify-fifo { + user = dovereplicate + mode = 0666 + } + unix_listener replication-notify { + user = dovereplicate + mode = 0666 + } +} + +service replicator { + unix_listener replicator-doveadm { + mode = 0600 + } +} + +service doveadm { + vsz_limit=512M +} + +replication_max_conns = 10 + +plugin { + # When saving a new mail via IMAP or delivering a mail via LDA/LMTP, + # wait for the mail to be synced to the remote site. If it doesn't finish + # in 2 seconds, return success anyway. + #replication_sync_timeout = 2s +} diff --git a/conf.d/auth-system.conf.ext b/conf.d/auth-system.conf.ext index 23f943c..399424b 100644 --- a/conf.d/auth-system.conf.ext +++ b/conf.d/auth-system.conf.ext @@ -49,6 +49,10 @@ passdb { userdb { # driver = passwd + + # Only available in 2.2.30+ + #username_filter = !nobody + # [blocking=no] #args = -- 2.34.1