main.cf 7.3 KB

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