|
- {{ansible_managed|comment}}
-
- # See /usr/share/postfix/main.cf.dist for a commented, more complete version
-
- # Debian specific: Specifying a file name will cause the first
- # line of that file to be used as the name. The Debian default
- # is /etc/mailname.
- myorigin = /etc/mailname
-
- smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
- biff = no
-
- # appending .domain is the MUA's job.
- append_dot_mydomain = no
-
- # Uncomment the next line to generate "delayed mail" warnings
- #delay_warning_time = 4h
-
- readme_directory = no
-
- # See http://www.postfix.org/COMPATIBILITY_README.html -- default to 2 on
- # fresh installs.
- compatibility_level = 2
-
- # TLS parameters
- smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
- smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
- smtpd_use_tls=yes
- smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
- smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
-
- # See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
- # information on enabling SSL in the smtp client.
-
- myhostname = {{mailname}}
- alias_maps = hash:/etc/aliases
- alias_database = hash:/etc/aliases
- mydestination = $myhostname, {{inventory_hostname}}, localhost.localdomain, localhost
- relayhost =
- mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
- mailbox_size_limit = 0
- recipient_delimiter = +
- inet_interfaces = all
- inet_protocols = all
-
- # some rules from http://www.postfix.org/SMTPD_ACCESS_README.html
-
- # Allow connections from trusted networks only.
- #smtpd_client_restrictions = permit_mynetworks, reject
-
- # Don't talk to mail systems that don't know their own hostname.
- #smtpd_helo_restrictions = reject_unknown_helo_hostname
-
- # Don't accept mail from domains that don't exist.
- #smtpd_sender_restrictions = reject_unknown_sender_domain
-
- # Spam control: exclude local clients and authenticated clients
- # from DNSBL and SPF lookups.
- smtpd_recipient_restrictions =
- permit_mynetworks,
- permit_sasl_authenticated,
- {% if postfix_check_spf %}
- check_policy_service unix:private/policyd-spf,
- {% endif %}
- {% if postfix_check_spamhaus %}
- reject_rbl_client zen.spamhaus.org,
- reject_rhsbl_reverse_client dbl.spamhaus.org,
- reject_rhsbl_helo dbl.spamhaus.org,
- reject_rhsbl_sender dbl.spamhaus.org
- {% endif %}
-
- # Relay control: local clients and authenticated clients
- # may specify any destination domain.
- smtpd_relay_restrictions =
- permit_mynetworks,
- {% if postfix_method == "postfixadmin" %}
- permit_sasl_authenticated,
- {% endif %}
- reject_unauth_destination
-
- # Block clients that speak too early.
- smtpd_data_restrictions = reject_unauth_pipelining
-
- {% if postfix_check_spf %}
- # SPF
- policy-spf_time_limit = 3600
- {% endif %}
-
- {#
- # Enforce mail volume quota via policy service callouts.
- smtpd_end_of_data_restrictions = check_policy_service unix:private/policy
- #}
-
- # SASL
- {% if postfix_method == "postfixadmin" %}
- smtpd_sasl_type = dovecot
- smtpd_sasl_path = private/auth
- smtpd_sasl_auth_enable = yes
- {% endif %}
-
- # DKIM and DMARC
- non_smtpd_milters =
- {% if postfix_with_opendkim %}
- unix:/run/opendkim/opendkim.sock,
- {% endif %}
- {% if postfix_with_opendmarc %}
- unix:/run/opendmarc/opendmarc.sock
- {% endif %}
- smtpd_milters =
- {% if postfix_with_opendkim %}
- unix:/run/opendkim/opendkim.sock,
- {% endif %}
- {% if postfix_with_opendmarc %}
- unix:/run/opendmarc/opendmarc.sock
- {% endif %}
-
- # Relay
-
- # Virtual Domain Hosting
- virtual_mailbox_domains =
- {% if postfix_method == "postfixadmin" %}
- proxy:mysql:/etc/postfix/postfixadmin-sql/mysql_virtual_domains_maps.cf
- {% endif %}
- virtual_alias_maps =
- {% if postfix_method == "postfixadmin" %}
- proxy:mysql:/etc/postfix/postfixadmin-sql/mysql_virtual_alias_maps.cf,
- proxy:mysql:/etc/postfix/postfixadmin-sql/mysql_virtual_alias_domain_maps.cf,
- proxy:mysql:/etc/postfix/postfixadmin-sql/mysql_virtual_alias_domain_catchall_maps.cf
- {% endif %}
- virtual_mailbox_maps =
- {% if postfix_method == "postfixadmin" %}
- proxy:mysql:/etc/postfix/postfixadmin-sql/mysql_virtual_mailbox_maps.cf,
- proxy:mysql:/etc/postfix/postfixadmin-sql/mysql_virtual_alias_domain_mailbox_maps.cf
- {% endif %}
-
- virtual_transport =
- {% if postfix_method == "postfixadmin" %}
- # use dovecot lmtp for mail transport
- lmtp:unix:private/dovecot-lmtp
- {% endif %}
|