Set up replication
authorAlex Dehnert <alex@dehnerts.com>
Fri, 15 Mar 2019 17:14:26 +0000 (13:14 -0400)
committerAlex Dehnert <alex@dehnerts.com>
Fri, 15 Mar 2019 17:14:26 +0000 (13:14 -0400)
conf.d/10-mail.conf
conf.d/30-replication.conf [new file with mode: 0644]
conf.d/auth-system.conf.ext

index 89ea4c6a9e48d6652fc3f78ddf7bc77e6fe10052..2aaf3df44aa87f568a53624490f1ac9ba8ad5cc1 100644 (file)
@@ -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 =
 # 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
 
 ##
 ## Mail processes
diff --git a/conf.d/30-replication.conf b/conf.d/30-replication.conf
new file mode 100644 (file)
index 0000000..0c3583b
--- /dev/null
@@ -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
+}
index 23f943c7b6fc318a5d72d5e5428e592a8edf9070..399424b5f65c4b2ce7179f64684b9e9c372095c6 100644 (file)
@@ -49,6 +49,10 @@ passdb {
 userdb {
   # <doc/wiki/AuthDatabase.Passwd.txt>
   driver = passwd
 userdb {
   # <doc/wiki/AuthDatabase.Passwd.txt>
   driver = passwd
+
+  # Only available in 2.2.30+
+  #username_filter = !nobody
+
   # [blocking=no]
   #args = 
 
   # [blocking=no]
   #args =