2016-04-15 19:02:41 +00:00
|
|
|
# See /usr/share/postfix/main.cf.dist for a commented, more complete version
|
|
|
|
|
2017-12-31 11:33:48 +00:00
|
|
|
smtpd_banner = $myhostname ESMTP $mail_name (Debian)
|
2016-04-15 19:02:41 +00:00
|
|
|
biff = no
|
|
|
|
append_dot_mydomain = no
|
|
|
|
readme_directory = no
|
|
|
|
|
|
|
|
# Basic configuration
|
2017-01-25 13:10:40 +00:00
|
|
|
# myhostname =
|
2018-04-23 18:35:33 +00:00
|
|
|
alias_maps = hash:/etc/aliases
|
|
|
|
alias_database = hash:/etc/aliases
|
|
|
|
mydestination = $myhostname, localhost.$mydomain, localhost
|
2017-01-25 13:10:40 +00:00
|
|
|
relayhost =
|
2016-08-21 20:10:13 +00:00
|
|
|
mynetworks = 127.0.0.0/8 [::1]/128 [fe80::]/64
|
2016-04-15 19:02:41 +00:00
|
|
|
mailbox_size_limit = 0
|
|
|
|
recipient_delimiter = +
|
|
|
|
inet_interfaces = all
|
|
|
|
inet_protocols = all
|
|
|
|
|
|
|
|
# TLS parameters
|
|
|
|
smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
|
|
|
|
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
|
|
|
|
#smtpd_tls_CAfile=
|
|
|
|
#smtp_tls_CAfile=
|
|
|
|
smtpd_tls_security_level = may
|
|
|
|
smtpd_use_tls=yes
|
2017-12-31 11:33:48 +00:00
|
|
|
smtpd_tls_loglevel = 1
|
2016-04-15 19:02:41 +00:00
|
|
|
smtp_tls_security_level = may
|
|
|
|
smtp_tls_loglevel = 1
|
|
|
|
tls_ssl_options = NO_COMPRESSION
|
2018-03-26 18:50:28 +00:00
|
|
|
tls_high_cipherlist = ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256
|
2017-12-31 11:33:48 +00:00
|
|
|
tls_preempt_cipherlist = yes
|
2018-03-26 18:50:28 +00:00
|
|
|
smtpd_tls_protocols = !SSLv2,!SSLv3,!TLSv1,!TLSv1.1
|
|
|
|
smtp_tls_protocols = !SSLv2,!SSLv3,!TLSv1,!TLSv1.1
|
2016-04-15 19:02:41 +00:00
|
|
|
smtpd_tls_mandatory_ciphers = high
|
2018-02-22 07:36:12 +00:00
|
|
|
smtpd_tls_mandatory_protocols = !SSLv2,!SSLv3,!TLSv1,!TLSv1.1
|
2016-04-15 19:02:41 +00:00
|
|
|
smtpd_tls_exclude_ciphers = aNULL, LOW, EXP, MEDIUM, ADH, AECDH, MD5, DSS, ECDSA, CAMELLIA128, 3DES, CAMELLIA256, RSA+AES, eNULL
|
2017-01-25 13:10:40 +00:00
|
|
|
smtpd_tls_dh1024_param_file = /etc/postfix/dhparams.pem
|
2016-07-25 20:50:36 +00:00
|
|
|
smtpd_tls_CApath = /etc/ssl/certs
|
|
|
|
smtp_tls_CApath = /etc/ssl/certs
|
2016-04-15 19:02:41 +00:00
|
|
|
|
2016-04-26 17:33:25 +00:00
|
|
|
# Settings to prevent SPAM early
|
|
|
|
smtpd_helo_required = yes
|
|
|
|
smtpd_delay_reject = yes
|
2016-04-27 07:44:21 +00:00
|
|
|
smtpd_helo_restrictions = permit_mynetworks, reject_invalid_helo_hostname, permit
|
2016-04-26 17:33:25 +00:00
|
|
|
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
|
2018-02-18 12:29:43 +00:00
|
|
|
smtpd_recipient_restrictions = permit_sasl_authenticated, permit_mynetworks, reject_unauth_destination, check_policy_service unix:private/policyd-spf, reject_unauth_pipelining, reject_invalid_helo_hostname, reject_non_fqdn_helo_hostname, reject_unknown_recipient_domain, reject_rbl_client zen.spamhaus.org, reject_rbl_client bl.spamcop.net
|
2016-04-26 17:33:25 +00:00
|
|
|
smtpd_client_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination, reject_unauth_pipelining
|
2018-03-07 18:33:43 +00:00
|
|
|
smtpd_sender_restrictions = permit_sasl_authenticated, permit_mynetworks, reject_unknown_sender_domain
|
2018-01-25 07:32:00 +00:00
|
|
|
disable_vrfy_command = yes
|
2016-04-26 17:33:25 +00:00
|
|
|
|
Introducing Postscreen (#799)
* Introduced Postscreen
cheaper, earlier and simpler blocking of zombies/spambots.
From http://postfix.cs.utah.edu/POSTSCREEN_README.html :
As a first layer, postscreen(8) blocks connections from zombies and other spambots that are responsible for about 90% of all spam. It is implemented as a single process to make this defense as cheap as possible.
Things we need to consider:
- Do we need a whitelist/backlist file? (http://postfix.cs.utah.edu/postconf.5.html#postscreen_access_list)
- Via introducing an optional config/postfix-access.cidr
- The only permanent whitelisting I could imagine are monitoring services(which might (still?) behave weird/hastely) or blacklisting backup servers(since no traffic should be coming from them anyway)
- Do we need deep inspections? They are desireable, but these tests are expensive: a good client must disconnect after it passes the test, before it can talk to a real Postfix SMTP server. Considered tests are:
- postscreen_bare_newline_enable (http://postfix.cs.utah.edu/postconf.5.html#postscreen_bare_newline_action)
- postscreen_non_smtp_command_enable (http://postfix.cs.utah.edu/postconf.5.html#postscreen_non_smtp_command_action)
- postscreen_pipelining_enable (http://postfix.cs.utah.edu/postconf.5.html#postscreen_pipelining_action)
- Do we need to make the blacklisting via dnsblocking configurable? It's currently set and weighted as follows, where a score of 3 results in blocking, a score of -1 results in whitelisting:
(*: adds the specified weight to the SMTP client's DNSBL score. Specify a negative number for whitelisting.)
(http://postfix.cs.utah.edu/postconf.5.html#postscreen_dnsbl_sites)
- zen.spamhaus.org*3
- bl.mailspike.net
- b.barracudacentral.org*2
- bl.spameatingmonkey.net
- bl.spamcop.net
- dnsbl.sorbs.net
- psbl.surriel.com
- list.dnswl.org=127.0.[0..255].0*-2
- list.dnswl.org=127.0.[0..255].1*-3
- list.dnswl.org=127.0.[0..255].[2..3]*-4
- What to do when blacklisting? I currently set it to drop. We could
- ignore: Ignore the failure of this test. Allow other tests to complete. Repeat this test the next time the client connects. This option is useful for testing and collecting statistics without blocking mail.
- enforce: Allow other tests to complete. Reject attempts to deliver mail with a 550 SMTP reply, and log the helo/sender/recipient information. Repeat this test the next time the client connects.
- drop: Drop the connection immediately with a 521 SMTP reply. Repeat this test the next time the client connects.
In the end I think we could drop postgrey support. Postscreen replaces postgrey in its entirety, while being more selective and not delaying mail. Especially if we consider using the deep inspection options of postscreen.
Hope that wasn't too much to read! ;)
* main.cf got misformatted..
Don't know how, should be ok now.
* fixed malformatted main.cf & repaired master.cf
* reenabled rbl stuff.. It's cached, therefore doesn't hurt
* fixed tests
* added tests, repaired tests, added info, introduced new Variable POSTSCREEN_ACTION, fixes
2018-02-04 20:31:08 +00:00
|
|
|
# Postscreen settings to drop zombies/open relays/spam early
|
|
|
|
postscreen_dnsbl_action = enforce
|
2018-02-18 12:29:43 +00:00
|
|
|
postscreen_dnsbl_sites = zen.spamhaus.org*3
|
|
|
|
bl.mailspike.net
|
|
|
|
b.barracudacentral.org*2
|
|
|
|
bl.spameatingmonkey.net
|
|
|
|
bl.spamcop.net
|
|
|
|
dnsbl.sorbs.net
|
|
|
|
psbl.surriel.com
|
|
|
|
list.dnswl.org=127.0.[0..255].0*-2
|
|
|
|
list.dnswl.org=127.0.[0..255].1*-3
|
|
|
|
list.dnswl.org=127.0.[0..255].[2..3]*-4
|
|
|
|
postscreen_dnsbl_threshold = 3
|
|
|
|
postscreen_dnsbl_whitelist_threshold = -1
|
Introducing Postscreen (#799)
* Introduced Postscreen
cheaper, earlier and simpler blocking of zombies/spambots.
From http://postfix.cs.utah.edu/POSTSCREEN_README.html :
As a first layer, postscreen(8) blocks connections from zombies and other spambots that are responsible for about 90% of all spam. It is implemented as a single process to make this defense as cheap as possible.
Things we need to consider:
- Do we need a whitelist/backlist file? (http://postfix.cs.utah.edu/postconf.5.html#postscreen_access_list)
- Via introducing an optional config/postfix-access.cidr
- The only permanent whitelisting I could imagine are monitoring services(which might (still?) behave weird/hastely) or blacklisting backup servers(since no traffic should be coming from them anyway)
- Do we need deep inspections? They are desireable, but these tests are expensive: a good client must disconnect after it passes the test, before it can talk to a real Postfix SMTP server. Considered tests are:
- postscreen_bare_newline_enable (http://postfix.cs.utah.edu/postconf.5.html#postscreen_bare_newline_action)
- postscreen_non_smtp_command_enable (http://postfix.cs.utah.edu/postconf.5.html#postscreen_non_smtp_command_action)
- postscreen_pipelining_enable (http://postfix.cs.utah.edu/postconf.5.html#postscreen_pipelining_action)
- Do we need to make the blacklisting via dnsblocking configurable? It's currently set and weighted as follows, where a score of 3 results in blocking, a score of -1 results in whitelisting:
(*: adds the specified weight to the SMTP client's DNSBL score. Specify a negative number for whitelisting.)
(http://postfix.cs.utah.edu/postconf.5.html#postscreen_dnsbl_sites)
- zen.spamhaus.org*3
- bl.mailspike.net
- b.barracudacentral.org*2
- bl.spameatingmonkey.net
- bl.spamcop.net
- dnsbl.sorbs.net
- psbl.surriel.com
- list.dnswl.org=127.0.[0..255].0*-2
- list.dnswl.org=127.0.[0..255].1*-3
- list.dnswl.org=127.0.[0..255].[2..3]*-4
- What to do when blacklisting? I currently set it to drop. We could
- ignore: Ignore the failure of this test. Allow other tests to complete. Repeat this test the next time the client connects. This option is useful for testing and collecting statistics without blocking mail.
- enforce: Allow other tests to complete. Reject attempts to deliver mail with a 550 SMTP reply, and log the helo/sender/recipient information. Repeat this test the next time the client connects.
- drop: Drop the connection immediately with a 521 SMTP reply. Repeat this test the next time the client connects.
In the end I think we could drop postgrey support. Postscreen replaces postgrey in its entirety, while being more selective and not delaying mail. Especially if we consider using the deep inspection options of postscreen.
Hope that wasn't too much to read! ;)
* main.cf got misformatted..
Don't know how, should be ok now.
* fixed malformatted main.cf & repaired master.cf
* reenabled rbl stuff.. It's cached, therefore doesn't hurt
* fixed tests
* added tests, repaired tests, added info, introduced new Variable POSTSCREEN_ACTION, fixes
2018-02-04 20:31:08 +00:00
|
|
|
postscreen_greet_action = enforce
|
|
|
|
postscreen_bare_newline_action = enforce
|
|
|
|
|
2016-04-15 19:02:41 +00:00
|
|
|
# SASL
|
|
|
|
smtpd_sasl_auth_enable = yes
|
|
|
|
smtpd_sasl_path = /var/spool/postfix/private/auth
|
|
|
|
smtpd_sasl_type = dovecot
|
|
|
|
|
|
|
|
smtpd_sasl_security_options = noanonymous
|
|
|
|
smtpd_sasl_local_domain = $myhostname
|
|
|
|
broken_sasl_auth_clients = yes
|
|
|
|
|
|
|
|
# Mail directory
|
2016-10-24 13:03:08 +00:00
|
|
|
virtual_transport = lmtp:unix:/var/run/dovecot/lmtp
|
2016-04-15 19:02:41 +00:00
|
|
|
virtual_mailbox_domains = /etc/postfix/vhost
|
2016-11-15 19:48:09 +00:00
|
|
|
virtual_mailbox_maps = texthash:/etc/postfix/vmailbox
|
|
|
|
virtual_alias_maps = texthash:/etc/postfix/virtual
|
2016-04-15 19:02:41 +00:00
|
|
|
|
|
|
|
# Additional option for filtering
|
|
|
|
content_filter = smtp-amavis:[127.0.0.1]:10024
|
|
|
|
|
|
|
|
# Milters used by DKIM
|
2016-10-25 06:57:08 +00:00
|
|
|
milter_protocol = 6
|
2016-04-15 19:02:41 +00:00
|
|
|
milter_default_action = accept
|
2016-10-25 06:57:08 +00:00
|
|
|
dkim_milter = inet:localhost:8891
|
|
|
|
dmarc_milter = inet:localhost:8893
|
|
|
|
smtpd_milters = $dkim_milter,$dmarc_milter
|
|
|
|
non_smtpd_milters = $dkim_milter
|
2017-03-14 16:21:17 +00:00
|
|
|
|
|
|
|
# SPF policy settings
|
|
|
|
policyd-spf_time_limit = 3600
|
2017-08-09 21:19:00 +00:00
|
|
|
|
|
|
|
# Remove unwanted headers that reveail our privacy
|
|
|
|
smtp_header_checks = pcre:/etc/postfix/maps/sender_header_filter.pcre
|