Skip to content
Snippets Groups Projects
Commit 1e505a7e authored by Lars Beckers's avatar Lars Beckers
Browse files

postfix: add several options to increase flexibility

parent 1fb7cd00
No related branches found
No related tags found
1 merge request!16Minimal Viable FSMPI Deployment
...@@ -17,6 +17,24 @@ postfix_enable_dovecot: true ...@@ -17,6 +17,24 @@ postfix_enable_dovecot: true
postfix_enable_submission: true postfix_enable_submission: true
postfix_enable_smtps: false postfix_enable_smtps: false
postfix_sasl_auth_header: false
postfix_enable_long_queue_ids: false
postfix_tls_received_header: false
# These variables were introduced for compatibility to a certain setup.
# They may disappear without prior notice and/or may not work as expected.
postfix_smtpd_recipient_limit: 1000
postfix_minimal_backoff_time: 300s
postfix_maximal_backoff_time: 4000s
postfix_mailbox_command: '/usr/lib/dovecot/dovecot-lda -f "$SENDER" -a "$RECIPIENT"'
postfix_relay_domains: []
postfix_alias_maps:
- cdb:/etc/aliases
postfix_virtual_alias_maps:
- cdb:/etc/postfix/virtual
postfix_sender_login_maps:
- proxy:pcre:/etc/postfix/login_maps.pcre
postfix_enable_postscreen: true postfix_enable_postscreen: true
postfix_enable_memcached: false postfix_enable_memcached: false
postfix_login_suffix: '' postfix_login_suffix: ''
......
...@@ -6,6 +6,8 @@ myhostname = {{ ansible_fqdn }} ...@@ -6,6 +6,8 @@ myhostname = {{ ansible_fqdn }}
myorigin = /etc/mailname myorigin = /etc/mailname
mydestination = $myhostname localhost {{ postfix_domains | join(" ") }} mydestination = $myhostname localhost {{ postfix_domains | join(" ") }}
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 {{ postfix_my_networks|join(" ") }} mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 {{ postfix_my_networks|join(" ") }}
relay_domains = {{ postfix_relay_domains|join(" ") }}
relayhost = {{ postfix_relay_host }} relayhost = {{ postfix_relay_host }}
{% if postfix_transport_maps|count > 0 %} {% if postfix_transport_maps|count > 0 %}
transport_maps = cdb:/etc/postfix/transport transport_maps = cdb:/etc/postfix/transport
...@@ -16,37 +18,38 @@ local_recipient_maps = ...@@ -16,37 +18,38 @@ local_recipient_maps =
{% endif %} {% endif %}
{% if not postfix_satellite_only and postfix_enable_dovecot %} {% if not postfix_satellite_only and postfix_enable_dovecot %}
{% if postfix_domains|count > 0 %} {% if postfix_domains|count > 0 and postfix_prefer_lmtp %}
{% if postfix_prefer_lmtp %}
mailbox_transport = lmtp:unix:private/dovecot-lmtp mailbox_transport = lmtp:unix:private/dovecot-lmtp
{% else %} {% elif postfix_domains|count > 0 and not postfix_prefer_lmtp %}
mailbox_command = /usr/lib/dovecot/dovecot-lda -f "$SENDER" -a "$RECIPIENT" mailbox_command = {{ postfix_mailbox_command }}
{% endif %}
{% endif %} {% endif %}
smtpd_sender_login_maps = proxy:pcre:/etc/postfix/login_maps.pcre smtpd_sender_login_maps = {{ postfix_sender_login_maps|join(" ") }}
smtpd_sender_restrictions = reject_sender_login_mismatch
smtpd_sasl_type = dovecot smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth smtpd_sasl_path = private/auth
smtpd_sasl_auth_enable = yes smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
smtpd_sasl_authenticated_header = {{ 'yes' if postfix_sasl_auth_header else 'no' }}
smtpd_sasl_local_domain = $myhostname
{% endif %} {% endif %}
append_dot_mydomain = no
biff = no biff = no
compatibility_level = 2 append_dot_mydomain = no
#delay_warning_time = 4h readme_directory = no
disable_vrfy_command = yes disable_vrfy_command = yes
#enable_long_queue_ids = yes compatibility_level = 2
mailbox_size_limit = 0
enable_long_queue_ids = {{ 'yes' if postfix_enable_long_queue_ids else 'no' }}
minimal_backoff_time = {{ postfix_minimal_backoff_time }}
maximal_backoff_time = {{ postfix_maximal_backoff_time }}
message_size_limit = {{ postfix_message_size_limit }} message_size_limit = {{ postfix_message_size_limit }}
readme_directory = no mailbox_size_limit = 0
recipient_delimiter = + recipient_delimiter = +
#strict_rfc821_envelopes = no
smtpd_banner = $myhostname ESMTP $mail_name smtpd_banner = $myhostname ESMTP $mail_name
smtpd_relay_restrictions = smtpd_recipient_limit = {{ postfix_smtpd_recipient_limit }}
permit_mynetworks
permit_sasl_authenticated
defer_unauth_destination
{% if postfix_verify_spf %} {% if postfix_verify_spf %}
smtpd_recipient_restrictions= smtpd_recipient_restrictions=
permit_mynetworks permit_mynetworks
...@@ -65,6 +68,7 @@ smtp_tls_security_level = may ...@@ -65,6 +68,7 @@ smtp_tls_security_level = may
smtp_tls_CAfile = /etc/ssl/certs/ca-certificates.crt smtp_tls_CAfile = /etc/ssl/certs/ca-certificates.crt
smtpd_tls_security_level = may smtpd_tls_security_level = may
smtpd_tls_auth_only = yes smtpd_tls_auth_only = yes
smtpd_tls_received_header = {{ 'yes' if postfix_tls_received_header else 'no' }}
smtpd_tls_cert_file = {{ postfix_tls_cert }} smtpd_tls_cert_file = {{ postfix_tls_cert }}
smtpd_tls_key_file = {{ postfix_tls_key }} smtpd_tls_key_file = {{ postfix_tls_key }}
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
...@@ -96,10 +100,10 @@ smtpd_tls_dh1024_param_file = /etc/postfix/dh.pem ...@@ -96,10 +100,10 @@ smtpd_tls_dh1024_param_file = /etc/postfix/dh.pem
tls_ssl_options = NO_COMPRESSION tls_ssl_options = NO_COMPRESSION
{% endif %} {% endif %}
alias_maps = cdb:/etc/aliases alias_maps = {{ postfix_alias_maps|join(" ") }}
alias_database = cdb:/etc/aliases alias_database = cdb:/etc/aliases
{% if virtual_aliases|default([])|count > 0 or postfix_virtual_domains|count > 0 %} {% if virtual_aliases|default([])|count > 0 or postfix_virtual_domains|count > 0 %}
virtual_alias_maps = cdb:/etc/postfix/virtual virtual_alias_maps = {{ postfix_virtual_alias_maps|join(" ") }}
{% endif %} {% endif %}
{% if postfix_virtual_domains|count > 0 and postfix_enable_dovecot %} {% if postfix_virtual_domains|count > 0 and postfix_enable_dovecot %}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment