NoPaste

main.cf

von Tulskie

SNIPPET_TEXT:
  1. # SMTPd greeting banner: You MUST specify $myhostname at the start of the text. This is required by the SMTP protocol.
  2. smtpd_banner = $myhostname
  3.  
  4. # Disable local biff service
  5. biff = no
  6.  
  7. # Do not append the string $mydomain to -locally- submitted email.
  8. append_dot_mydomain = no
  9.  
  10. # Readme directory
  11. readme_directory = /usr/share/doc/postfix
  12.  
  13. # HTML directory
  14. html_directory = /usr/share/doc/postfix/html
  15.  
  16. # Certificates
  17. smtpd_tls_cert_file = /etc/ssl/mail/mail.crt
  18. smtpd_tls_key_file = /etc/ssl/mail/mail.key
  19.  
  20. # Opportunistic TLS. TLS auth only.
  21. smtpd_tls_security_level=may
  22. smtpd_tls_auth_only=yes
  23.  
  24. # DH parameters, actually 2048 bit long
  25. smtpd_tls_dh1024_param_file = /etc/ssl/mail/dhparams.pem
  26.  
  27. # CA path for SMTP client connections to external servers
  28. # smtp_tls_CAfile = /etc/ssl/certs/ca-certificates.crt
  29.  
  30. # TLS session cache for SMTPd
  31. smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
  32.  
  33. # Disallow SSLv2 and SSLv3, only accept secure ciphers
  34. smtpd_tls_mandatory_protocols = !SSLv2, !SSLv3
  35. smtpd_tls_mandatory_ciphers=high
  36. smtpd_tls_exclude_ciphers = ECDHE-RSA-RC4-SHA
  37. smtpd_tls_mandatory_exclude_ciphers = ECDHE-RSA-RC4-SHA
  38.  
  39. # Log TLS handling
  40. smtpd_tls_loglevel = 1
  41. smtp_tls_loglevel = 1
  42.  
  43. # Delay reject until RCPT TO
  44. smtpd_delay_reject = yes
  45.  
  46. # Enable elliptic curve cryptography, "ultra" needs more cpu time
  47. smtpd_tls_eecdh_grade = strong
  48.  
  49. # Default: Anonymize outgoing mail headers
  50. smtp_header_checks = pcre:/etc/postfix/mailcow_anonymize_headers.pcre
  51.  
  52. # Sender, recipient, client and data restrictions
  53. smtpd_sender_restrictions = reject_authenticated_sender_login_mismatch,
  54.    permit_mynetworks,
  55.    reject_sender_login_mismatch,
  56.    permit_sasl_authenticated,
  57.    reject_unlisted_sender,
  58.    reject_unknown_sender_domain
  59.  
  60. smtpd_recipient_restrictions = permit_sasl_authenticated,
  61.    permit_mynetworks,
  62.    reject_non_fqdn_helo_hostname,
  63.    reject_invalid_helo_hostname,
  64.    reject_unknown_reverse_client_hostname,
  65.    reject_unauth_destination
  66.  
  67. smtpd_data_restrictions =
  68.    reject_unauth_pipelining,
  69.    permit
  70.  
  71. smtpd_restriction_classes = z1_greylisting
  72.  
  73. z1_greylisting = permit_dnswl_client list.dnswl.org,
  74.    check_policy_service inet:127.0.0.1:10023
  75.  
  76. # Determine valid MAIL FROM addresses for a SASL authenticated user.
  77.  
  78. smtpd_sender_login_maps =
  79.    proxy:mysql:/etc/postfix/sql/mysql_virtual_sender_acl.cf,
  80.    proxy:mysql:/etc/postfix/sql/mysql_virtual_alias_maps.cf
  81.  
  82. # Set a higher timeout for connecting, sending and receiving information from/to a proxy (FuGlu)
  83. smtpd_proxy_timeout = 600s
  84.  
  85. # Opportunistic TLS. Use TLS if this is supported by the remote SMTP server, otherwise use plaintext.
  86. smtp_tls_security_level=may
  87.  
  88. # TLS session cache for SMTP
  89. smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
  90.  
  91. # A custom list with secure ciphers.
  92. tls_high_cipherlist=EDH+CAMELLIA:EDH+aRSA:EECDH+aRSA+AESGCM:EECDH+aRSA+SHA384:EECDH+aRSA+SHA256:EECDH:+CAMELLIA256:+AES256:+CAMELLIA128:+AES128:+SSLv3:!aNULL:!eNULL:!LOW:!3DES:!MD5:!EXP:!PSK:!DSS:!RC4:!SEED:!ECDSA:CAMELLIA256-SHA:AES256-SHA:CAMELLIA128-SHA:AES128-SHA
  93.  
  94. # Use the FQDN for the local hostname!
  95. myhostname = mail.schmidttulskie.de
  96.  
  97. # Alias maps and database for -local- delivery only
  98. alias_maps = hash:/etc/aliases
  99. alias_database = hash:/etc/aliases
  100.  
  101. # The domain name that locally-posted mail appears to come from, and that locally posted mail is delivered to.
  102. myorigin = /etc/mailname
  103.  
  104. # The list of domains that are delivered via the -local- mail delivery transport. No external domains like "schmidttulskie.de" belong here! "mail.schmidttulskie.de" is fine.
  105. mydestination = mail.schmidttulskie.de, localhost.schmidttulskie.de, localhost
  106.  
  107. # We lookup MX records to send non-local mail, so this stays empty
  108. relayhost =
  109.  
  110. # We relay for these domains
  111. relay_domains= proxy:mysql:/etc/postfix/sql/mysql_virtual_mxdomain_maps.cf
  112.  
  113. # Relay only for these accounts
  114. relay_recipient_maps = proxy:mysql:/etc/postfix/sql/mysql_virtual_alias_maps.cf
  115.  
  116. # Trusted SMTP clients with more privileges. Trusted clients can relay mail.
  117. mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
  118.  
  119. # The maximal size of any -local- individual mailbox
  120. mailbox_size_limit = 0
  121.  
  122. # Handle Postfix-style extensions
  123. recipient_delimiter = +
  124.  
  125. # The network interface addresses that this mail system receives mail on.
  126. inet_interfaces = all
  127.  
  128. # Specifies what protocols Postfix will use when it makes or accepts network connections, and also controls what DNS lookups Postfix will use when it makes network connections.
  129. inet_protocols = all
  130.  
  131. # VRFY command is not really needed anymore
  132. disable_vrfy_command = yes
  133.  
  134. # Please say hello first...
  135. smtpd_helo_required = yes
  136.  
  137. # The SASL plug-in type that the Postfix SMTP server should use for authentication.
  138. smtpd_sasl_type=dovecot
  139.  
  140. # Where to passthrough our authentication information for the above plug-in
  141. smtpd_sasl_path=private/auth_dovecot
  142.  
  143. # Enable SASL authentication in the Postfix SMTP server.
  144. smtpd_sasl_auth_enable = yes
  145.  
  146. # Report the SASL authenticated user name in the smtpd Received message header.
  147. smtpd_sasl_authenticated_header = yes
  148.  
  149. # Have Postfix advertise AUTH support in a non-standard way.
  150. broken_sasl_auth_clients = yes
  151.  
  152. # The lookup tables that the proxymap server is allowed to access for the read-only service.
  153. proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps $recipient_canonical_maps $relocated_maps $transport_maps $mynetworks $smtpd_sender_login_maps
  154.  
  155. ## Virtual transport configuration
  156. # A prefix that the virtual delivery agent prepends to all pathname results from $virtual_mailbox_maps
  157. virtual_mailbox_base = /var/vmail/
  158.  
  159. # THIS contains a list of domains we are the final destination for (unlike "mydestination").
  160. virtual_mailbox_domains = proxy:mysql:/etc/postfix/sql/mysql_virtual_domains_maps.cf
  161.  
  162. # Alias specific mail addresses or domains to other local or remote address.
  163. virtual_alias_maps =
  164.    proxy:mysql:/etc/postfix/sql/mysql_virtual_alias_maps.cf,
  165.    proxy:mysql:/etc/postfix/sql/mysql_virtual_spamalias_maps.cf,
  166.    proxy:mysql:/etc/postfix/sql/mysql_virtual_alias_domain_maps.cf,
  167.    proxy:mysql:/etc/postfix/sql/mysql_virtual_alias_domain_catchall_maps.cf
  168.  
  169. # Specify a left-hand side of "@schmidttulskie.de" to match any user in the specified domain
  170. virtual_mailbox_maps =
  171.    proxy:mysql:/etc/postfix/sql/mysql_virtual_mailbox_maps.cf,
  172.    proxy:mysql:/etc/postfix/sql/mysql_virtual_alias_domain_mailbox_maps.cf
  173.  
  174. # The minimum user ID value that the virtual delivery agent accepts
  175. virtual_minimum_uid = 104
  176.  
  177. # We use "vmail" user with UID/GID 5000 to lookup tables
  178. virtual_uid_maps = static:5000
  179. virtual_gid_maps = static:5000
  180.  
  181. # The default mail delivery transport and next-hop destination for final delivery to domains listed with "virtual_mailbox_domains"
  182. virtual_transport = lmtp:unix:private/dovecot-lmtp
  183.  
  184. ## Queue configuration
  185. # Consider a message as undeliverable, when delivery fails with a temporary error, and the time in the queue has reached this limit.
  186. maximal_queue_lifetime = 1d
  187.  
  188. # Consider a bounce message as undeliverable, when delivery fails with a temporary error, and the time in the queue has reached this limit.
  189. bounce_queue_lifetime = 1d
  190.  
  191. # The time between deferred queue scans by the queue manager.
  192. queue_run_delay = 300s
  193.  
  194. # The maximal/minimal time between attempts to deliver a deferred message.
  195. maximal_backoff_time = 1800s
  196. minimal_backoff_time = 300s
  197.  
  198. # Maximum mail size
  199. message_size_limit = 26214400
  200.  
  201. # This tarpits a client after 3 erroneous commands for 10s
  202. smtpd_soft_error_limit = 3
  203. smtpd_error_sleep_time = 10s
  204. smtpd_hard_error_limit = ${stress?1}${stress:5}
  205.  
  206. # Feel free to maintain a white-/blacklist for Postscreen
  207. postscreen_access_list = permit_mynetworks,
  208.   cidr:/etc/postfix/postscreen_access.cidr
  209.  
  210. # Drop connections from blacklisted servers with a 521 reply
  211. postscreen_blacklist_action = drop
  212.  
  213. # Clean Postscreen cache after 24h
  214. postscreen_cache_cleanup_interval = 24h
  215.  
  216. postscreen_dnsbl_ttl = 5m
  217. postscreen_dnsbl_threshold = 8
  218. postscreen_dnsbl_action = enforce
  219. postscreen_dnsbl_sites =
  220.   b.barracudacentral.org=127.0.0.2*7
  221.   dnsbl.inps.de=127.0.0.2*7
  222.   bl.mailspike.net=127.0.0.2*5
  223.   bl.mailspike.net=127.0.0.[10;11;12]*4
  224.   dnsbl.sorbs.net=127.0.0.10*8
  225.   dnsbl.sorbs.net=127.0.0.5*6
  226.   dnsbl.sorbs.net=127.0.0.7*3
  227.   dnsbl.sorbs.net=127.0.0.8*2
  228.   dnsbl.sorbs.net=127.0.0.6*2
  229.   dnsbl.sorbs.net=127.0.0.9*2
  230.   zen.spamhaus.org=127.0.0.[10;11]*8
  231.   zen.spamhaus.org=127.0.0.[4..7]*6
  232.   zen.spamhaus.org=127.0.0.3*4
  233.   zen.spamhaus.org=127.0.0.2*3
  234.   hostkarma.junkemailfilter.com=127.0.0.2*3
  235.   hostkarma.junkemailfilter.com=127.0.0.4*1
  236.   hostkarma.junkemailfilter.com=127.0.1.2*1
  237.   wl.mailspike.net=127.0.0.[18;19;20]*-2
  238.   hostkarma.junkemailfilter.com=127.0.0.1*-2
  239. postscreen_greet_banner = $smtpd_banner
  240. postscreen_greet_action = enforce
  241. postscreen_greet_wait = 3s
  242. postscreen_greet_ttl = 2d
  243. postscreen_bare_newline_enable = no
  244. postscreen_non_smtp_command_enable = no
  245. postscreen_pipelining_enable = no
  246. postscreen_cache_map = proxy:btree:$data_directory/postscreen_cache
  247.  
  248. # We need milter support for OpenDKIM
  249. milter_protocol = 6
  250. milter_default_action = accept

Quellcode

Hier kannst du den Code kopieren und ihn in deinen bevorzugten Editor einfügen. PASTEBIN_DOWNLOAD_SNIPPET_EXPLAIN