Dovecot updates for Bionic (18.04)
[sysconfig/dovecot.git] / conf.d / 10-replication.conf
diff --git a/conf.d/10-replication.conf b/conf.d/10-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
+}