Advertisement
Guest User

Untitled

a guest
Nov 1st, 2018
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.78 KB | None | 0 0
  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_protocols = !SSLv2, !SSLv3
  36. smtpd_tls_mandatory_ciphers=high
  37. smtpd_tls_exclude_ciphers = ECDHE-RSA-RC4-SHA
  38. smtpd_tls_mandatory_exclude_ciphers = ECDHE-RSA-RC4-SHA
  39.  
  40. # Log TLS handling
  41. smtpd_tls_loglevel = 1
  42. smtp_tls_loglevel = 1
  43.  
  44. # Delay reject until RCPT TO
  45. smtpd_delay_reject = yes
  46.  
  47. # Enable elliptic curve cryptography, "ultra" needs more cpu time
  48. smtpd_tls_eecdh_grade = strong
  49.  
  50. # Default: Anonymize outgoing mail headers
  51. smtp_header_checks = pcre:/etc/postfix/mailcow_anonymize_headers.pcre
  52.  
  53. # Sender, recipient, client and data restrictions
  54. smtpd_sender_restrictions = reject_authenticated_sender_login_mismatch,
  55. permit_mynetworks,
  56. #reject_sender_login_mismatch,
  57. #permit_sasl_authenticated,
  58. #reject_unlisted_sender,
  59. #reject_unknown_sender_domain
  60.  
  61. smtpd_recipient_restrictions = check_recipient_access proxy:mysql:/etc/postfix/sql/mysql_tls_enforce_in_policy.cf,
  62. permit_sasl_authenticated,
  63. permit_mynetworks,
  64. reject_invalid_helo_hostname,
  65. reject_unknown_reverse_client_hostname,
  66. reject_unauth_destination
  67.  
  68. smtpd_data_restrictions =
  69. reject_unauth_pipelining,
  70. permit
  71.  
  72. smtpd_restriction_classes = greylist
  73.  
  74. greylist = permit_dnswl_client list.dnswl.org,
  75. check_policy_service inet:127.0.0.1:10023
  76.  
  77. # Determine valid MAIL FROM addresses for a SASL authenticated user.
  78. smtpd_sender_login_maps = proxy:mysql:/etc/postfix/sql/mysql_virtual_sender_acl.cf
  79.  
  80. # Sender dependent smtp service for TLS enforced connections
  81. sender_dependent_default_transport_maps = proxy:mysql:/etc/postfix/sql/mysql_tls_enforce_out_policy.cf
  82.  
  83. # Certificates
  84. smtp_tls_cert_file = /etc/ssl/mail/mail.crt
  85. smtp_tls_key_file = /etc/ssl/mail/mail.key
  86.  
  87. # Set a higher timeout for connecting, sending and receiving information from/to a proxy (FuGlu)
  88. smtpd_proxy_timeout = 600s
  89.  
  90. # Opportunistic TLS. Use TLS if this is supported by the remote SMTP server, otherwise use plaintext.
  91. smtp_tls_security_level=may
  92.  
  93. # TLS session cache for SMTP
  94. smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
  95.  
  96. # A custom list with secure ciphers.
  97. 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
  98.  
  99. # Use the FQDN for the local hostname!
  100. myhostname = mail.rocketshops.eu
  101.  
  102. # Alias maps and database for -local- delivery only
  103. alias_maps = hash:/etc/aliases
  104. alias_database = hash:/etc/aliases
  105.  
  106. # The domain name that locally-posted mail appears to come from, and that locally posted mail is delivered to.
  107. myorigin = /etc/mailname
  108.  
  109. # The list of domains that are delivered via the -local- mail delivery transport. No external domains like "rocketshops.eu" belong here! "mail.rocketshops.eu" is fine.
  110. mydestination = mail.rocketshops.eu, localhost.rocketshops.eu, localhost
  111.  
  112. # We lookup MX records to send non-local mail, so this stays empty
  113. relayhost =
  114.  
  115. # We relay for these domains
  116. relay_domains= proxy:mysql:/etc/postfix/sql/mysql_virtual_mxdomain_maps.cf
  117.  
  118. # Relay only for these accounts
  119. relay_recipient_maps = proxy:mysql:/etc/postfix/sql/mysql_relay_recipient_maps.cf
  120.  
  121. # Trusted SMTP clients with more privileges. Trusted clients can relay mail.
  122. mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
  123.  
  124. # The maximal size of any -local- individual mailbox
  125. mailbox_size_limit = 0
  126.  
  127. # Handle Postfix-style extensions
  128. recipient_delimiter = +
  129.  
  130. # The network interface addresses that this mail system receives mail on.
  131. inet_interfaces = all
  132.  
  133. # 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.
  134. inet_protocols = all
  135.  
  136. # VRFY command is not really needed anymore
  137. disable_vrfy_command = yes
  138.  
  139. # Please say hello first...
  140. smtpd_helo_required = yes
  141.  
  142. # The SASL plug-in type that the Postfix SMTP server should use for authentication.
  143. smtpd_sasl_type=dovecot
  144.  
  145. # Where to passthrough our authentication information for the above plug-in
  146. smtpd_sasl_path=private/auth_dovecot
  147.  
  148. # Enable SASL authentication in the Postfix SMTP server.
  149. smtpd_sasl_auth_enable = yes
  150.  
  151. # Report the SASL authenticated user name in the smtpd Received message header.
  152. smtpd_sasl_authenticated_header = yes
  153.  
  154. # Have Postfix advertise AUTH support in a non-standard way.
  155. broken_sasl_auth_clients = yes
  156.  
  157. # The lookup tables that the proxymap server is allowed to access for the read-only service.
  158. proxy_read_maps = proxy:mysql:/etc/postfix/sql/mysql_virtual_sender_acl.cf, proxy:mysql:/etc/postfix/sql/mysql_tls_enforce_out_policy.cf, proxy:mysql:/etc/postfix/sql/mysql_tls_enforce_in_policy.cf, $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
  159.  
  160. ## Virtual transport configuration
  161. # A prefix that the virtual delivery agent prepends to all pathname results from $virtual_mailbox_maps
  162. virtual_mailbox_base = /var/vmail/
  163.  
  164. # THIS contains a list of domains we are the final destination for (unlike "mydestination").
  165. virtual_mailbox_domains = proxy:mysql:/etc/postfix/sql/mysql_virtual_domains_maps.cf
  166.  
  167. # Alias specific mail addresses or domains to other local or remote address.
  168. virtual_alias_maps =
  169. proxy:mysql:/etc/postfix/sql/mysql_virtual_alias_maps.cf,
  170. proxy:mysql:/etc/postfix/sql/mysql_virtual_spamalias_maps.cf,
  171. proxy:mysql:/etc/postfix/sql/mysql_virtual_alias_domain_maps.cf,
  172. proxy:mysql:/etc/postfix/sql/mysql_virtual_alias_domain_catchall_maps.cf
  173.  
  174. # Specify a left-hand side of "@rocketshops.eu" to match any user in the specified domain
  175. virtual_mailbox_maps =
  176. proxy:mysql:/etc/postfix/sql/mysql_virtual_mailbox_maps.cf,
  177. proxy:mysql:/etc/postfix/sql/mysql_virtual_alias_domain_mailbox_maps.cf
  178.  
  179. # The minimum user ID value that the virtual delivery agent accepts
  180. virtual_minimum_uid = 104
  181.  
  182. # We use "vmail" user with UID/GID 5000 to lookup tables
  183. virtual_uid_maps = static:5000
  184. virtual_gid_maps = static:5000
  185.  
  186. # The default mail delivery transport and next-hop destination for final delivery to domains listed with "virtual_mailbox_domains"
  187. virtual_transport = lmtp:unix:private/dovecot-lmtp
  188.  
  189. ## Queue configuration
  190. # Consider a message as undeliverable, when delivery fails with a temporary error, and the time in the queue has reached this limit.
  191. maximal_queue_lifetime = 1d
  192.  
  193. # Consider a bounce message as undeliverable, when delivery fails with a temporary error, and the time in the queue has reached this limit.
  194. bounce_queue_lifetime = 1d
  195.  
  196. # The time between deferred queue scans by the queue manager.
  197. queue_run_delay = 300s
  198.  
  199. # The maximal/minimal time between attempts to deliver a deferred message.
  200. maximal_backoff_time = 1800s
  201. minimal_backoff_time = 300s
  202.  
  203. # Maximum mail size
  204. message_size_limit = 26214400
  205.  
  206. # This tarpits a client after 3 erroneous commands for 10s
  207. smtpd_soft_error_limit = 3
  208. smtpd_error_sleep_time = 10s
  209. smtpd_hard_error_limit = ${stress?1}${stress:5}
  210.  
  211. # Feel free to maintain a white-/blacklist for Postscreen
  212. postscreen_access_list = permit_mynetworks,
  213. cidr:/etc/postfix/postscreen_access.cidr
  214.  
  215. # Drop connections from blacklisted servers with a 521 reply
  216. postscreen_blacklist_action = drop
  217.  
  218. # Clean Postscreen cache after 24h
  219. postscreen_cache_cleanup_interval = 24h
  220.  
  221. postscreen_dnsbl_ttl = 5m
  222. postscreen_dnsbl_threshold = 8
  223. postscreen_dnsbl_action = enforce
  224. postscreen_dnsbl_sites =
  225. b.barracudacentral.org=127.0.0.2*7
  226. dnsbl.inps.de=127.0.0.2*7
  227. bl.mailspike.net=127.0.0.2*5
  228. bl.mailspike.net=127.0.0.[10;11;12]*4
  229. dnsbl.sorbs.net=127.0.0.10*8
  230. dnsbl.sorbs.net=127.0.0.5*6
  231. dnsbl.sorbs.net=127.0.0.7*3
  232. dnsbl.sorbs.net=127.0.0.8*2
  233. dnsbl.sorbs.net=127.0.0.6*2
  234. dnsbl.sorbs.net=127.0.0.9*2
  235. zen.spamhaus.org=127.0.0.[10;11]*8
  236. zen.spamhaus.org=127.0.0.[4..7]*6
  237. zen.spamhaus.org=127.0.0.3*4
  238. zen.spamhaus.org=127.0.0.2*3
  239. hostkarma.junkemailfilter.com=127.0.0.2*3
  240. hostkarma.junkemailfilter.com=127.0.0.4*1
  241. hostkarma.junkemailfilter.com=127.0.1.2*1
  242. wl.mailspike.net=127.0.0.[18;19;20]*-2
  243. hostkarma.junkemailfilter.com=127.0.0.1*-2
  244. postscreen_greet_banner = $smtpd_banner
  245. postscreen_greet_action = enforce
  246. postscreen_greet_wait = 3s
  247. postscreen_greet_ttl = 2d
  248. postscreen_bare_newline_enable = no
  249. postscreen_non_smtp_command_enable = no
  250. postscreen_pipelining_enable = no
  251. postscreen_cache_map = proxy:btree:$data_directory/postscreen_cache
  252.  
  253. # We need milter support for OpenDKIM
  254. milter_protocol = 6
  255. milter_default_action = accept
  256.  
  257. # Hard-fail missing TLS when enabled for a user
  258. plaintext_reject_code = 550
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement