summaryrefslogtreecommitdiff
path: root/postfix/anti-uce.sh
blob: 6458e25e38027f9f5fa4cb7e33f927b706e41854 (plain)
  1. #!/bin/sh
  2. mapsfile="/etc/local-COMMON/postfix/rbl_lookup_hosts"
  3. maps=`cat $mapsfile | grep -v '^#' | sed 's/#.*//' | tr "\n" "," | sed -e 's/[, ]\+/,/g' -e 's/,$//'`
  4. postconf -e "smtpd_helo_required = yes"
  5. postconf -e "permit_mx_backup_networks = /etc/local-COMMON/postfix/mx_networks"
  6. postconf -e "maps_rbl_domains = $maps"
  7. postconf -e "smtpd_recipient_restrictions = reject_invalid_hostname,reject_non_fqdn_hostname,reject_non_fqdn_sender,reject_non_fqdn_recipient,reject_unknown_sender_domain,reject_unknown_recipient_domain,reject_unauth_pipelining,permit_mynetworks,permit_mx_backup,reject_unauth_destination,reject_maps_rbl,reject"
  8. /etc/init.d/postfix reload
  9. # Based on this: http://jimsun.linxnet.com/misc/postfix-anti-UCE.txt
  10. # Support fortrusted MX backup networks added
  11. # PCRE stuff avoided,as PCRE is only optional on newest Debian packages
  12. # RBLs replaced with those recommended by http://www.antispews.org/
  13. # Here's a convenient overview of different blackholes:
  14. # http://rbls.org/