You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

171 lines
4.5KB

  1. {{ansible_managed|comment}}
  2. ### common settings
  3. # Debian specific: Specifying a file name will cause the first
  4. # line of that file to be used as the name. The Debian default
  5. # is /etc/mailname.
  6. smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
  7. biff = no
  8. # appending .domain is the MUA's job.
  9. append_dot_mydomain = no
  10. readme_directory = no
  11. # See http://www.postfix.org/COMPATIBILITY_README.html -- default to 2 on
  12. # fresh installs.
  13. compatibility_level = 2
  14. ### general settings
  15. myhostname = {{mailname}}
  16. alias_maps = hash:/etc/aliases
  17. alias_database = hash:/etc/aliases
  18. mydestination = $myhostname, {{inventory_hostname}}, localhost.localdomain, localhost
  19. relayhost =
  20. mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
  21. mailbox_size_limit = 0
  22. recipient_delimiter = +
  23. inet_interfaces = all
  24. inet_protocols = all
  25. ### TLS parameters
  26. smtpd_tls_cert_file={{postfix_certificate_fullchain_file}}
  27. smtpd_tls_key_file={{postfix_certificate_private_key_file}}
  28. smtpd_use_tls=yes
  29. smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
  30. smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
  31. smtp_tls_security_level = may
  32. ### transport configuration
  33. relay_domains = hash:/etc/postfix/transport_maps
  34. transport_maps =
  35. hash:/etc/postfix/transport_maps,
  36. ### rules and restricitons
  37. message_size_limit = 52428800
  38. # some rules from http://www.postfix.org/SMTPD_ACCESS_README.html
  39. # Allow connections from trusted networks only.
  40. #smtpd_client_restrictions = permit_mynetworks, reject
  41. # Require that a remote SMTP client introduces itself
  42. #smtpd_helo_required = yes
  43. # Don't talk to mail systems that don't know their own hostname.
  44. #smtpd_helo_restrictions = reject_unknown_helo_hostname
  45. # Don't accept mail from domains that don't exist.
  46. #smtpd_sender_restrictions = reject_unknown_sender_domain
  47. # Spam control: exclude local clients and authenticated clients
  48. # from DNSBL and SPF lookups.
  49. smtpd_recipient_restrictions =
  50. permit_mynetworks,
  51. permit_sasl_authenticated,
  52. {% if postfix_check_spf %}
  53. check_policy_service unix:private/policyd-spf,
  54. {% endif %}
  55. {% if postfix_check_spamhaus %}
  56. reject_rbl_client zen.spamhaus.org,
  57. reject_rhsbl_reverse_client dbl.spamhaus.org,
  58. reject_rhsbl_helo dbl.spamhaus.org,
  59. reject_rhsbl_sender dbl.spamhaus.org
  60. {% endif %}
  61. # Relay control: local clients and authenticated clients
  62. # may specify any destination domain.
  63. smtpd_relay_restrictions =
  64. permit_mynetworks,
  65. reject_unauth_destination
  66. # Block clients that speak too early.
  67. smtpd_data_restrictions = reject_unauth_pipelining
  68. {% if postfix_check_spf %}
  69. policy-spf_time_limit = 3600
  70. {% endif %}
  71. {#
  72. # Enforce mail volume quota via policy service callouts.
  73. smtpd_end_of_data_restrictions = check_policy_service unix:private/policy
  74. #}
  75. ### DKIM and DMARC
  76. non_smtpd_milters =
  77. {% if postfix_with_opendkim %}
  78. unix:/run/opendkim/opendkim.sock,
  79. {% endif %}
  80. {% if postfix_with_opendmarc %}
  81. unix:/run/opendmarc/opendmarc.sock
  82. {% endif %}
  83. smtpd_milters =
  84. {% if postfix_with_opendkim %}
  85. unix:/run/opendkim/opendkim.sock,
  86. {% endif %}
  87. {% if postfix_with_opendmarc %}
  88. unix:/run/opendmarc/opendmarc.sock
  89. {% endif %}
  90. ### Virtual Domain Hosting
  91. virtual_alias_domains =
  92. hash:/etc/postfix/virtual_alias_domains,
  93. virtual_alias_maps =
  94. hash:/etc/postfix/virtual_alias_maps,
  95. {% if postfix_with_postfixadmin %}
  96. proxy:mysql:/etc/postfix/postfixadmin-sql/mysql_virtual_alias_maps.cf,
  97. proxy:mysql:/etc/postfix/postfixadmin-sql/mysql_virtual_alias_domain_maps.cf,
  98. proxy:mysql:/etc/postfix/postfixadmin-sql/mysql_virtual_alias_domain_catchall_maps.cf,
  99. {% endif %}
  100. {% if postfix_with_sympa %}
  101. hash:/etc/postfix/virtual.sympa,
  102. {% endif %}
  103. virtual_mailbox_domains =
  104. hash:/etc/postfix/virtual_mailbox_domains,
  105. {% if postfix_with_postfixadmin %}
  106. proxy:mysql:/etc/postfix/postfixadmin-sql/mysql_virtual_domains_maps.cf,
  107. {% endif %}
  108. {% if postfix_with_sympa %}
  109. hash:/etc/postfix/domains.sympa,
  110. {% endif %}
  111. virtual_mailbox_maps =
  112. hash:/etc/postfix/virtual_mailbox_maps,
  113. {% if postfix_with_postfixadmin %}
  114. proxy:mysql:/etc/postfix/postfixadmin-sql/mysql_virtual_mailbox_maps.cf,
  115. proxy:mysql:/etc/postfix/postfixadmin-sql/mysql_virtual_alias_domain_mailbox_maps.cf,
  116. {% endif %}
  117. {% if postfix_with_sympa %}
  118. hash:/etc/postfix/transport.sympa,
  119. hash:/var/lib/sympa/transport,
  120. hash:/etc/postfix/virtual.sympa,
  121. {% endif %}
  122. virtual_transport =
  123. {% if postfix_with_sympa %}
  124. hash:/etc/postfix/transport.sympa,
  125. hash:/var/lib/sympa/transport,
  126. {% endif %}
  127. {% if postfix_with_dovecot_lmtp %}
  128. lmtp:unix:private/dovecot-lmtp,
  129. {% endif %}