master.cf 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. # inter-mx with postscreen on 25/tcp
  2. smtp inet n - n - 1 postscreen
  3. 10025 inet n - n - 1 postscreen
  4. -o postscreen_upstream_proxy_protocol=haproxy
  5. -o syslog_name=haproxy
  6. smtpd pass - - n - - smtpd
  7. -o smtpd_helo_restrictions=permit_mynetworks,reject_non_fqdn_helo_hostname
  8. -o smtpd_sasl_auth_enable=no
  9. -o smtpd_sender_restrictions=permit_mynetworks,reject_unlisted_sender,reject_unknown_sender_domain
  10. # smtpd tls-wrapped (smtps) on 465/tcp
  11. # TLS protocol can be modified by setting smtps_smtpd_tls_mandatory_protocols in extra.cf
  12. smtps inet n - n - - smtpd
  13. -o smtpd_tls_wrappermode=yes
  14. -o smtpd_client_restrictions=permit_mynetworks,permit_sasl_authenticated,reject
  15. -o smtpd_tls_mandatory_protocols=$smtps_smtpd_tls_mandatory_protocols
  16. -o tls_preempt_cipherlist=yes
  17. -o cleanup_service_name=smtp_sender_cleanup
  18. -o syslog_name=postfix/smtps
  19. -o smtpd_end_of_data_restrictions=$smtpd_last_auth
  20. 10465 inet n - n - - smtpd
  21. -o smtpd_upstream_proxy_protocol=haproxy
  22. -o smtpd_tls_wrappermode=yes
  23. -o smtpd_client_restrictions=permit_mynetworks,permit_sasl_authenticated,reject
  24. -o smtpd_tls_mandatory_protocols=$smtps_smtpd_tls_mandatory_protocols
  25. -o tls_preempt_cipherlist=yes
  26. -o cleanup_service_name=smtp_sender_cleanup
  27. -o syslog_name=postfix/smtps-haproxy
  28. -o smtpd_end_of_data_restrictions=$smtpd_last_auth
  29. # smtpd with starttls on 587/tcp
  30. # TLS protocol can be modified by setting submission_smtpd_tls_mandatory_protocols in extra.cf
  31. submission inet n - n - - smtpd
  32. -o smtpd_client_restrictions=permit_mynetworks,permit_sasl_authenticated,reject
  33. -o smtpd_enforce_tls=yes
  34. -o smtpd_tls_security_level=encrypt
  35. -o smtpd_tls_mandatory_protocols=$submission_smtpd_tls_mandatory_protocols
  36. -o tls_preempt_cipherlist=yes
  37. -o cleanup_service_name=smtp_sender_cleanup
  38. -o syslog_name=postfix/submission
  39. -o smtpd_end_of_data_restrictions=$smtpd_last_auth
  40. 10587 inet n - n - - smtpd
  41. -o smtpd_upstream_proxy_protocol=haproxy
  42. -o smtpd_client_restrictions=permit_mynetworks,permit_sasl_authenticated,reject
  43. -o smtpd_enforce_tls=yes
  44. -o smtpd_tls_security_level=encrypt
  45. -o smtpd_tls_mandatory_protocols=$submission_smtpd_tls_mandatory_protocols
  46. -o tls_preempt_cipherlist=yes
  47. -o cleanup_service_name=smtp_sender_cleanup
  48. -o syslog_name=postfix/submission-haproxy
  49. -o smtpd_end_of_data_restrictions=$smtpd_last_auth
  50. # used by SOGo
  51. # smtpd_sender_restrictions should match main.cf, but with check_sasl_access prepended for login-as-mailbox-user function
  52. 588 inet n - n - - smtpd
  53. -o smtpd_client_restrictions=permit_mynetworks,permit_sasl_authenticated,reject
  54. -o smtpd_tls_auth_only=no
  55. -o smtpd_sender_restrictions=check_sasl_access,regexp:/opt/postfix/conf/allow_mailcow_local.regexp,reject_authenticated_sender_login_mismatch,permit_mynetworks,permit_sasl_authenticated,reject_unlisted_sender,reject_unknown_sender_domain
  56. -o cleanup_service_name=smtp_sender_cleanup
  57. -o syslog_name=postfix/sogo
  58. -o smtpd_end_of_data_restrictions=$smtpd_last_auth
  59. # used to reinject quarantine mails
  60. 590 inet n - n - - smtpd
  61. -o smtpd_helo_restrictions=
  62. -o smtpd_client_restrictions=permit_mynetworks,reject
  63. -o smtpd_tls_auth_only=no
  64. -o smtpd_milters=
  65. -o non_smtpd_milters=
  66. -o syslog_name=postfix/quarantine
  67. -o smtpd_end_of_data_restrictions=$smtpd_last_auth
  68. # used to send bcc mails
  69. 591 inet n - n - - smtpd
  70. -o smtpd_helo_restrictions=
  71. -o smtpd_client_restrictions=permit_mynetworks,reject
  72. -o smtpd_tls_auth_only=no
  73. -o smtpd_milters=
  74. -o non_smtpd_milters=
  75. -o syslog_name=postfix/bcc
  76. -o smtpd_end_of_data_restrictions=$smtpd_last_auth
  77. # enforced smtp connector
  78. smtp_enforced_tls unix - - n - - smtp
  79. -o smtp_tls_security_level=encrypt
  80. -o syslog_name=enforced-tls-smtp
  81. -o smtp_delivery_status_filter=pcre:/opt/postfix/conf/smtp_dsn_filter
  82. # smtp connector used, when a transport map matched
  83. # this helps to have different sasl maps than we have with sender dependent transport maps
  84. smtp_via_transport_maps unix - - n - - smtp
  85. -o smtp_sasl_password_maps=proxy:mysql:/opt/postfix/conf/sql/mysql_sasl_passwd_maps_transport_maps.cf
  86. tlsproxy unix - - n - 0 tlsproxy
  87. dnsblog unix - - n - 0 dnsblog
  88. pickup fifo n - n 60 1 pickup
  89. cleanup unix n - n - 0 cleanup
  90. qmgr fifo n - n 300 1 qmgr
  91. tlsmgr unix - - n 1000? 1 tlsmgr
  92. rewrite unix - - n - - trivial-rewrite
  93. bounce unix - - n - 0 bounce
  94. defer unix - - n - 0 bounce
  95. trace unix - - n - 0 bounce
  96. verify unix - - n - 1 verify
  97. flush unix n - n 1000? 0 flush
  98. proxymap unix - - n - - proxymap
  99. proxywrite unix - - n - 1 proxymap
  100. smtp unix - - n - - smtp
  101. relay unix - - n - - smtp
  102. showq unix n - n - - showq
  103. error unix - - n - - error
  104. retry unix - - n - - error
  105. discard unix - - n - - discard
  106. local unix - n n - - local
  107. virtual unix - n n - - virtual
  108. lmtp unix - - n - - lmtp
  109. anvil unix - - n - 1 anvil
  110. scache unix - - n - 1 scache
  111. maildrop unix - n n - - pipe flags=DRhu
  112. user=vmail argv=/usr/bin/maildrop -d ${recipient}
  113. # used to anonymize sender IP
  114. smtp_sender_cleanup unix n - y - 0 cleanup
  115. -o header_checks=$smtp_header_checks
  116. # start whitelist_fwd
  117. 127.0.0.1:10027 inet n n n - 0 spawn user=nobody argv=/usr/local/bin/whitelist_forwardinghosts.sh
  118. # end whitelist_fwd
  119. # start watchdog-specific
  120. # logs to local7 (hidden)
  121. 589 inet n - n - - smtpd
  122. -o smtpd_client_restrictions=permit_mynetworks,reject
  123. -o syslog_name=watchdog
  124. -o syslog_facility=local7
  125. -o smtpd_milters=
  126. -o cleanup_service_name=watchdog_cleanup
  127. -o non_smtpd_milters=
  128. watchdog_cleanup unix n - n - 0 cleanup
  129. -o syslog_name=watchdog
  130. -o syslog_facility=local7
  131. -o queue_service_name=watchdog_qmgr
  132. watchdog_qmgr fifo n - n 300 1 qmgr
  133. -o syslog_facility=local7
  134. -o syslog_name=watchdog
  135. -o rewrite_service_name=watchdog_rewrite
  136. watchdog_rewrite unix - - n - - trivial-rewrite
  137. -o syslog_facility=local7
  138. -o syslog_name=watchdog
  139. -o local_transport=watchdog_discard
  140. watchdog_discard unix - - n - - discard
  141. -o syslog_facility=local7
  142. -o syslog_name=watchdog
  143. # end watchdog-specific