Set up LMTP so Postfix can deliver locally too
authorAlex Dehnert <adehnert@mit.edu>
Fri, 27 Mar 2020 06:23:51 +0000 (06:23 +0000)
committerAlex Dehnert <adehnert@mit.edu>
Fri, 27 Mar 2020 06:25:27 +0000 (06:25 +0000)
Previously mail was just getting replicated here, but if we want this to
be a viable backup MX, we should support receiving mail, which means
Postfix integration. Apparently LMTP is better than LDA, so use it.

conf.d/10-master.conf
conf.d/20-lmtp.conf [new file with mode: 0644]

index 5068100037b2812fd6fdf47159927272851c86d0..31b8e22bf7148c046dc2ed8bcc7d31264f98f121 100644 (file)
@@ -46,8 +46,13 @@ service pop3-login {
 }
 
 service lmtp {
-  unix_listener lmtp {
+  #unix_listener lmtp {
     #mode = 0666
+  #}
+  unix_listener /var/spool/postfix/private/dovecot-lmtp {
+   group = postfix
+   mode = 0600
+   user = postfix
   }
 
   # Create inet listener only if you can't use the above UNIX socket
diff --git a/conf.d/20-lmtp.conf b/conf.d/20-lmtp.conf
new file mode 100644 (file)
index 0000000..a95bea4
--- /dev/null
@@ -0,0 +1,32 @@
+##
+## LMTP specific settings
+##
+
+# Support proxying to other LMTP/SMTP servers by performing passdb lookups.
+#lmtp_proxy = no
+
+# When recipient address includes the detail (e.g. user+detail), try to save
+# the mail to the detail mailbox. See also recipient_delimiter and
+# lda_mailbox_autocreate settings.
+#lmtp_save_to_detail_mailbox = no
+
+# Verify quota before replying to RCPT TO. This adds a small overhead.
+#lmtp_rcpt_check_quota = no
+
+# Which recipient address to use for Delivered-To: header and Received:
+# header. The default is "final", which is the same as the one given to
+# RCPT TO command. "original" uses the address given in RCPT TO's ORCPT
+# parameter, "none" uses nothing. Note that "none" is currently always used
+# when a mail has multiple recipients.
+#lmtp_hdr_delivery_address = final
+
+protocol lmtp {
+  # Space separated list of plugins to load (default is global mail_plugins).
+  mail_plugins = $mail_plugins sieve
+
+  auth_username_format = %Ln
+
+  deliver_log_format = msgid=%m, subj=%s: %$
+  log_path = /var/log/mail/dovecot-lmtp.log
+  info_log_path = /var/log/mail/dovecot-lmtp.info.log
+}