No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.

141 líneas
4.1KB

  1. {{ansible_managed|comment}}
  2. # See /usr/share/postfix/main.cf.dist for a commented, more complete version
  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. myorigin = /etc/mailname
  7. smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
  8. biff = no
  9. # appending .domain is the MUA's job.
  10. append_dot_mydomain = no
  11. # Uncomment the next line to generate "delayed mail" warnings
  12. #delay_warning_time = 4h
  13. readme_directory = no
  14. # See http://www.postfix.org/COMPATIBILITY_README.html -- default to 2 on
  15. # fresh installs.
  16. compatibility_level = 2
  17. # TLS parameters
  18. smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
  19. smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
  20. smtpd_use_tls=yes
  21. smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
  22. smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
  23. # See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
  24. # information on enabling SSL in the smtp client.
  25. myhostname = {{mailname}}
  26. alias_maps = hash:/etc/aliases
  27. alias_database = hash:/etc/aliases
  28. mydestination = $myhostname, {{inventory_hostname}}, localhost.localdomain, localhost
  29. relayhost =
  30. mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
  31. mailbox_size_limit = 0
  32. recipient_delimiter = +
  33. inet_interfaces = all
  34. inet_protocols = all
  35. # some rules from http://www.postfix.org/SMTPD_ACCESS_README.html
  36. # Allow connections from trusted networks only.
  37. #smtpd_client_restrictions = permit_mynetworks, reject
  38. # Don't talk to mail systems that don't know their own hostname.
  39. #smtpd_helo_restrictions = reject_unknown_helo_hostname
  40. # Don't accept mail from domains that don't exist.
  41. #smtpd_sender_restrictions = reject_unknown_sender_domain
  42. # Spam control: exclude local clients and authenticated clients
  43. # from DNSBL and SPF lookups.
  44. smtpd_recipient_restrictions =
  45. permit_mynetworks,
  46. permit_sasl_authenticated,
  47. {% if postfix_check_spf %}
  48. check_policy_service unix:private/policyd-spf,
  49. {% endif %}
  50. {% if postfix_check_spamhaus %}
  51. reject_rbl_client zen.spamhaus.org,
  52. reject_rhsbl_reverse_client dbl.spamhaus.org,
  53. reject_rhsbl_helo dbl.spamhaus.org,
  54. reject_rhsbl_sender dbl.spamhaus.org
  55. {% endif %}
  56. # Relay control: local clients and authenticated clients
  57. # may specify any destination domain.
  58. smtpd_relay_restrictions =
  59. permit_mynetworks,
  60. {% if postfix_method == "postfixadmin" %}
  61. permit_sasl_authenticated,
  62. {% endif %}
  63. reject_unauth_destination
  64. # Block clients that speak too early.
  65. smtpd_data_restrictions = reject_unauth_pipelining
  66. {% if postfix_check_spf %}
  67. # SPF
  68. policy-spf_time_limit = 3600
  69. {% endif %}
  70. {#
  71. # Enforce mail volume quota via policy service callouts.
  72. smtpd_end_of_data_restrictions = check_policy_service unix:private/policy
  73. #}
  74. # SASL
  75. {% if postfix_method == "postfixadmin" %}
  76. smtpd_sasl_type = dovecot
  77. smtpd_sasl_path = private/auth
  78. smtpd_sasl_auth_enable = yes
  79. {% endif %}
  80. # DKIM and DMARC
  81. non_smtpd_milters =
  82. {% if postfix_with_opendkim %}
  83. unix:/run/opendkim/opendkim.sock,
  84. {% endif %}
  85. {% if postfix_with_opendmarc %}
  86. unix:/run/opendmarc/opendmarc.sock
  87. {% endif %}
  88. smtpd_milters =
  89. {% if postfix_with_opendkim %}
  90. unix:/run/opendkim/opendkim.sock,
  91. {% endif %}
  92. {% if postfix_with_opendmarc %}
  93. unix:/run/opendmarc/opendmarc.sock
  94. {% endif %}
  95. # Relay
  96. # Virtual Domain Hosting
  97. virtual_mailbox_domains =
  98. {% if postfix_method == "postfixadmin" %}
  99. proxy:mysql:/etc/postfix/postfixadmin-sql/mysql_virtual_domains_maps.cf
  100. {% endif %}
  101. virtual_alias_maps =
  102. {% if postfix_method == "postfixadmin" %}
  103. proxy:mysql:/etc/postfix/postfixadmin-sql/mysql_virtual_alias_maps.cf,
  104. proxy:mysql:/etc/postfix/postfixadmin-sql/mysql_virtual_alias_domain_maps.cf,
  105. proxy:mysql:/etc/postfix/postfixadmin-sql/mysql_virtual_alias_domain_catchall_maps.cf
  106. {% endif %}
  107. virtual_mailbox_maps =
  108. {% if postfix_method == "postfixadmin" %}
  109. proxy:mysql:/etc/postfix/postfixadmin-sql/mysql_virtual_mailbox_maps.cf,
  110. proxy:mysql:/etc/postfix/postfixadmin-sql/mysql_virtual_alias_domain_mailbox_maps.cf
  111. {% endif %}
  112. virtual_transport =
  113. {% if postfix_method == "postfixadmin" %}
  114. # use dovecot lmtp for mail transport
  115. lmtp:unix:private/dovecot-lmtp
  116. {% endif %}