Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

146 řádky
3.9KB

  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. ### transport configuration
  32. transport_maps = hash:/etc/postfix/transport_maps
  33. ### rules and restricitons
  34. # some rules from http://www.postfix.org/SMTPD_ACCESS_README.html
  35. # Allow connections from trusted networks only.
  36. #smtpd_client_restrictions = permit_mynetworks, reject
  37. # Require that a remote SMTP client introduces itself
  38. #smtpd_helo_required = yes
  39. # Don't talk to mail systems that don't know their own hostname.
  40. #smtpd_helo_restrictions = reject_unknown_helo_hostname
  41. # Don't accept mail from domains that don't exist.
  42. #smtpd_sender_restrictions = reject_unknown_sender_domain
  43. # Spam control: exclude local clients and authenticated clients
  44. # from DNSBL and SPF lookups.
  45. smtpd_recipient_restrictions =
  46. permit_mynetworks,
  47. permit_sasl_authenticated,
  48. {% if postfix_check_spf %}
  49. check_policy_service unix:private/policyd-spf,
  50. {% endif %}
  51. {% if postfix_check_spamhaus %}
  52. reject_rbl_client zen.spamhaus.org,
  53. reject_rhsbl_reverse_client dbl.spamhaus.org,
  54. reject_rhsbl_helo dbl.spamhaus.org,
  55. reject_rhsbl_sender dbl.spamhaus.org
  56. {% endif %}
  57. # Relay control: local clients and authenticated clients
  58. # may specify any destination domain.
  59. smtpd_relay_restrictions =
  60. permit_mynetworks,
  61. reject_unauth_destination
  62. # Block clients that speak too early.
  63. smtpd_data_restrictions = reject_unauth_pipelining
  64. {% if postfix_check_spf %}
  65. policy-spf_time_limit = 3600
  66. {% endif %}
  67. {#
  68. # Enforce mail volume quota via policy service callouts.
  69. smtpd_end_of_data_restrictions = check_policy_service unix:private/policy
  70. #}
  71. ### DKIM and DMARC
  72. non_smtpd_milters =
  73. {% if postfix_with_opendkim %}
  74. unix:/run/opendkim/opendkim.sock,
  75. {% endif %}
  76. {% if postfix_with_opendmarc %}
  77. unix:/run/opendmarc/opendmarc.sock
  78. {% endif %}
  79. smtpd_milters =
  80. {% if postfix_with_opendkim %}
  81. unix:/run/opendkim/opendkim.sock,
  82. {% endif %}
  83. {% if postfix_with_opendmarc %}
  84. unix:/run/opendmarc/opendmarc.sock
  85. {% endif %}
  86. ### Virtual Domain Hosting
  87. virtual_alias_domains =
  88. hash:/etc/postfix/virtual_alias_domains,
  89. virtual_alias_maps =
  90. hash:/etc/postfix/virtual_alias_maps,
  91. {% if postfix_method == "postfixadmin" %}
  92. proxy:mysql:/etc/postfix/postfixadmin-sql/mysql_virtual_alias_maps.cf,
  93. proxy:mysql:/etc/postfix/postfixadmin-sql/mysql_virtual_alias_domain_maps.cf,
  94. proxy:mysql:/etc/postfix/postfixadmin-sql/mysql_virtual_alias_domain_catchall_maps.cf
  95. {% endif %}
  96. virtual_mailbox_domains =
  97. hash:/etc/postfix/virtual_mailbox_domains,
  98. {% if postfix_method == "postfixadmin" %}
  99. proxy:mysql:/etc/postfix/postfixadmin-sql/mysql_virtual_domains_maps.cf
  100. {% endif %}
  101. virtual_mailbox_maps =
  102. hash:/etc/postfix/virtual_mailbox_maps,
  103. {% if postfix_method == "postfixadmin" %}
  104. proxy:mysql:/etc/postfix/postfixadmin-sql/mysql_virtual_mailbox_maps.cf,
  105. proxy:mysql:/etc/postfix/postfixadmin-sql/mysql_virtual_alias_domain_mailbox_maps.cf
  106. {% endif %}
  107. virtual_transport = {{postfix_virtual_transport}}