postfix: offer opening another smtpd on port 26
authorRalf Jung <post@ralfj.de>
Sun, 20 May 2018 20:45:20 +0000 (22:45 +0200)
committerRalf Jung <post@ralfj.de>
Sun, 20 May 2018 20:45:20 +0000 (22:45 +0200)
host_vars/template.yml
roles/email/templates/main.cf
roles/email/templates/master.cf

index 99d2b4b00b441e7f758096a57668fe3852bdcb92..bd5ccb1bbc7a9e301ac7d91d4f50808499619652 100644 (file)
@@ -1,6 +1,10 @@
 postfix:
   # optional: Whether to put a postscreen on port 25
   postscreen: True
+  # optional: Open another SMTP daemon on port 26 that only accepts mail from local hosts
+  # (and whitelisted client certs, if applicable).  Useful when the source of the mail is in
+  # a network that blocks port 25 outgoing.
+  smtpd_26: True
   # optional: Whether to accept emails for arbitrary destination on the submission port,
   # authenticated by dovecot.  Requires a dovecot: section (see below).
   submission: True
index 97f07bdf4ce598c5c4329ffd2a301c301a2a3740..dc72a19a73fbb65a39ab788a951964a4992b948a 100644 (file)
@@ -107,11 +107,12 @@ proxy_read_maps = $virtual_alias_maps $virtual_mailbox_maps $smtpd_sender_login_
 
 # setup mail routes for virtual mail: all mail ends up being forwarded somewhere
 virtual_transport = error
-transport_maps = hash:/etc/postfix/transport_map
+transport_maps = hash:$config_directory/transport_map
 mailman_destination_recipient_limit = 1
 {% endif %}
 
 {% if postfix.smtp_outgoing is defined %}
+# send mail via specific IP
 default_transport = {{ postfix.default_smtp_outgoing }}
 sender_dependent_default_transport_maps = hash:$config_directory/sender_transport_map
 {% endif %}
index f0537462c3bd7439e49a615dfbd1c58350744aed..1d3a3e8e39abb3f849fd9431a492af7878d23eae 100644 (file)
@@ -17,6 +17,12 @@ tlsproxy   unix  -       -       y       -       0       tlsproxy
 {% else %}
 smtp      inet  n       -       y       -       -       smtpd
 {% endif %}
+{% if postfix.smtpd_26 is defined and postfix.smtpd_26 %}
+26      inet  n       -       y       -       -       smtpd
+  -o syslog_name=postfix/smtpd2
+  -o smtpd_tls_security_level=encrypt
+  -o smtpd_recipient_restrictions=permit_mynetworks,permit_tls_clientcerts,reject
+{% endif %}
 
 {% if postfix.submission is defined and postfix.submission %}
 submission inet  n       -       y       -       -       smtpd