main.cf 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. # --------------------------------------------------------------------------
  2. # Please create a file "extra.cf" for persistent overrides to main.cf
  3. # --------------------------------------------------------------------------
  4. biff = no
  5. append_dot_mydomain = no
  6. smtpd_tls_cert_file = /etc/ssl/mail/cert.pem
  7. smtpd_tls_key_file = /etc/ssl/mail/key.pem
  8. tls_server_sni_maps = hash:/opt/postfix/conf/sni.map
  9. smtpd_tls_received_header = yes
  10. smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
  11. smtpd_relay_restrictions = permit_mynetworks,
  12. permit_sasl_authenticated,
  13. defer_unauth_destination
  14. # alias maps are auto-generated in postfix.sh on startup
  15. alias_maps = hash:/etc/aliases
  16. alias_database = hash:/etc/aliases
  17. relayhost =
  18. mynetworks_style = subnet
  19. mailbox_size_limit = 0
  20. recipient_delimiter = +
  21. inet_interfaces = all
  22. inet_protocols = all
  23. bounce_queue_lifetime = 1d
  24. broken_sasl_auth_clients = yes
  25. disable_vrfy_command = yes
  26. maximal_backoff_time = 1800s
  27. maximal_queue_lifetime = 5d
  28. delay_warning_time = 4h
  29. message_size_limit = 104857600
  30. milter_default_action = tempfail
  31. milter_protocol = 6
  32. minimal_backoff_time = 300s
  33. plaintext_reject_code = 550
  34. postscreen_access_list = permit_mynetworks,
  35. cidr:/opt/postfix/conf/custom_postscreen_whitelist.cidr,
  36. cidr:/opt/postfix/conf/postscreen_access.cidr,
  37. tcp:127.0.0.1:10027
  38. postscreen_bare_newline_enable = no
  39. postscreen_blacklist_action = drop
  40. postscreen_cache_cleanup_interval = 24h
  41. postscreen_cache_map = proxy:btree:$data_directory/postscreen_cache
  42. postscreen_dnsbl_action = enforce
  43. postscreen_dnsbl_threshold = 6
  44. postscreen_dnsbl_ttl = 5m
  45. postscreen_greet_action = enforce
  46. postscreen_greet_banner = $smtpd_banner
  47. postscreen_greet_ttl = 2d
  48. postscreen_greet_wait = 3s
  49. postscreen_non_smtp_command_enable = no
  50. postscreen_pipelining_enable = no
  51. proxy_read_maps = proxy:mysql:/opt/postfix/conf/sql/mysql_sasl_passwd_maps_transport_maps.cf,
  52. proxy:mysql:/opt/postfix/conf/sql/mysql_mbr_access_maps.cf,
  53. proxy:mysql:/opt/postfix/conf/sql/mysql_tls_enforce_in_policy.cf,
  54. $sender_dependent_default_transport_maps,
  55. $smtp_tls_policy_maps,
  56. $local_recipient_maps,
  57. $mydestination,
  58. $virtual_alias_maps,
  59. $virtual_alias_domains,
  60. $virtual_mailbox_maps,
  61. $virtual_mailbox_domains,
  62. $relay_recipient_maps,
  63. $relay_domains,
  64. $canonical_maps,
  65. $sender_canonical_maps,
  66. $sender_bcc_maps,
  67. $recipient_bcc_maps,
  68. $recipient_canonical_maps,
  69. $relocated_maps,
  70. $transport_maps,
  71. $mynetworks,
  72. $smtpd_sender_login_maps,
  73. $smtp_sasl_password_maps
  74. queue_run_delay = 300s
  75. relay_domains = proxy:mysql:/opt/postfix/conf/sql/mysql_virtual_relay_domain_maps.cf
  76. relay_recipient_maps = proxy:mysql:/opt/postfix/conf/sql/mysql_relay_recipient_maps.cf
  77. sender_dependent_default_transport_maps = proxy:mysql:/opt/postfix/conf/sql/mysql_sender_dependent_default_transport_maps.cf
  78. smtp_tls_CAfile = /etc/ssl/certs/ca-certificates.crt
  79. smtp_tls_cert_file = /etc/ssl/mail/cert.pem
  80. smtp_tls_key_file = /etc/ssl/mail/key.pem
  81. smtp_tls_loglevel = 1
  82. smtp_dns_support_level = dnssec
  83. smtp_tls_security_level = dane
  84. smtpd_data_restrictions = reject_unauth_pipelining, permit
  85. smtpd_delay_reject = yes
  86. smtpd_error_sleep_time = 10s
  87. smtpd_hard_error_limit = ${stress?1}${stress:5}
  88. smtpd_helo_required = yes
  89. smtpd_proxy_timeout = 600s
  90. smtpd_recipient_restrictions = check_recipient_mx_access proxy:mysql:/opt/postfix/conf/sql/mysql_mbr_access_maps.cf,
  91. permit_sasl_authenticated,
  92. permit_mynetworks,
  93. check_recipient_access proxy:mysql:/opt/postfix/conf/sql/mysql_tls_enforce_in_policy.cf,
  94. reject_invalid_helo_hostname,
  95. reject_unauth_destination
  96. smtpd_sasl_auth_enable = yes
  97. smtpd_sasl_authenticated_header = yes
  98. smtpd_sasl_path = inet:dovecot:10001
  99. smtpd_sasl_type = dovecot
  100. smtpd_sender_login_maps = proxy:mysql:/opt/postfix/conf/sql/mysql_virtual_sender_acl.cf
  101. smtpd_sender_restrictions = reject_authenticated_sender_login_mismatch,
  102. permit_mynetworks,
  103. permit_sasl_authenticated,
  104. reject_unlisted_sender,
  105. reject_unknown_sender_domain
  106. smtpd_soft_error_limit = 3
  107. smtpd_tls_auth_only = yes
  108. smtpd_tls_dh1024_param_file = /etc/ssl/mail/dhparams.pem
  109. smtpd_tls_eecdh_grade = auto
  110. smtpd_tls_exclude_ciphers = ECDHE-RSA-RC4-SHA, RC4, aNULL, DES-CBC3-SHA, ECDHE-RSA-DES-CBC3-SHA, EDH-RSA-DES-CBC3-SHA
  111. smtpd_tls_loglevel = 1
  112. # Mandatory protocols and ciphers are used when a connections is enforced to use TLS
  113. # Does _not_ apply to enforced incoming TLS settings per mailbox
  114. smtp_tls_mandatory_protocols = !SSLv2, !SSLv3, !TLSv1, !TLSv1.1
  115. lmtp_tls_mandatory_protocols = !SSLv2, !SSLv3, !TLSv1, !TLSv1.1
  116. smtpd_tls_mandatory_protocols = !SSLv2, !SSLv3, !TLSv1, !TLSv1.1
  117. smtpd_tls_mandatory_ciphers = high
  118. smtp_tls_protocols = !SSLv2, !SSLv3
  119. lmtp_tls_protocols = !SSLv2, !SSLv3, !TLSv1, !TLSv1.1
  120. smtpd_tls_protocols = !SSLv2, !SSLv3
  121. smtpd_tls_security_level = may
  122. tls_preempt_cipherlist = yes
  123. tls_ssl_options = NO_COMPRESSION, NO_RENEGOTIATION
  124. virtual_alias_maps = proxy:mysql:/opt/postfix/conf/sql/mysql_virtual_alias_maps.cf,
  125. proxy:mysql:/opt/postfix/conf/sql/mysql_virtual_resource_maps.cf,
  126. proxy:mysql:/opt/postfix/conf/sql/mysql_virtual_spamalias_maps.cf,
  127. proxy:mysql:/opt/postfix/conf/sql/mysql_virtual_alias_domain_maps.cf
  128. virtual_gid_maps = static:5000
  129. virtual_mailbox_base = /var/vmail/
  130. virtual_mailbox_domains = proxy:mysql:/opt/postfix/conf/sql/mysql_virtual_domains_maps.cf
  131. # -- moved to rspamd on 2021-06-01
  132. #recipient_bcc_maps = proxy:mysql:/opt/postfix/conf/sql/mysql_recipient_bcc_maps.cf
  133. #sender_bcc_maps = proxy:mysql:/opt/postfix/conf/sql/mysql_sender_bcc_maps.cf
  134. recipient_canonical_maps = proxy:mysql:/opt/postfix/conf/sql/mysql_recipient_canonical_maps.cf
  135. recipient_canonical_classes = envelope_recipient
  136. virtual_mailbox_maps = proxy:mysql:/opt/postfix/conf/sql/mysql_virtual_mailbox_maps.cf
  137. virtual_minimum_uid = 104
  138. virtual_transport = lmtp:inet:dovecot:24
  139. virtual_uid_maps = static:5000
  140. smtpd_milters = inet:rspamd:9900
  141. non_smtpd_milters = inet:rspamd:9900
  142. milter_mail_macros = i {mail_addr} {client_addr} {client_name} {auth_authen}
  143. mydestination = localhost.localdomain, localhost
  144. smtp_address_preference = any
  145. smtp_sender_dependent_authentication = yes
  146. smtp_sasl_auth_enable = yes
  147. smtp_sasl_password_maps = proxy:mysql:/opt/postfix/conf/sql/mysql_sasl_passwd_maps_sender_dependent.cf
  148. smtp_sasl_security_options =
  149. smtp_sasl_mechanism_filter = plain, login
  150. smtp_tls_policy_maps = proxy:mysql:/opt/postfix/conf/sql/mysql_tls_policy_override_maps.cf
  151. smtp_header_checks = pcre:/opt/postfix/conf/anonymize_headers.pcre
  152. mail_name = Postcow
  153. # local_transport map catches local destinations and prevents routing local dests when the next map would route "*"
  154. # Use custom_transport.pcre for custom transports
  155. transport_maps = pcre:/opt/postfix/conf/custom_transport.pcre,
  156. pcre:/opt/postfix/conf/local_transport,
  157. proxy:mysql:/opt/postfix/conf/sql/mysql_relay_ne.cf,
  158. proxy:mysql:/opt/postfix/conf/sql/mysql_transport_maps.cf
  159. smtp_sasl_auth_soft_bounce = no
  160. postscreen_discard_ehlo_keywords = silent-discard, dsn
  161. compatibility_level = 2
  162. smtputf8_enable = no
  163. # Define protocols for SMTPS and submission service
  164. submission_smtpd_tls_mandatory_protocols = !SSLv2, !SSLv3, !TLSv1, !TLSv1.1
  165. smtps_smtpd_tls_mandatory_protocols = !SSLv2, !SSLv3, !TLSv1, !TLSv1.1
  166. parent_domain_matches_subdomains = debug_peer_list,fast_flush_domains,mynetworks,qmqpd_authorized_clients
  167. # DO NOT EDIT ANYTHING BELOW #
  168. # Overrides #