summaryrefslogtreecommitdiff
path: root/postfix/anti-uce.sh
blob: 6eaca24f3bac3d04fda09956762e4bd806092483 (plain)
  1. #!/bin/bash
  2. set -e
  3. paramdir="/etc/local-COMMON/postfix"
  4. function getlinefromfile() {
  5. param="$1"
  6. echo -n "$param = "
  7. cat $paramdir/$param | grep -v '^#' | sed 's/#.*//' | tr "\n" "," | sed -e 's/[, ]\+/,/g' -e 's/,$//'
  8. }
  9. postconf -e "smtpd_helo_required = yes"
  10. postconf -e "permit_mx_backup_networks = /etc/local-COMMON/postfix/mx_networks"
  11. postconf -e "`getlinefromfile maps_rbl_domains`"
  12. postconf -e "`getlinefromfile smtpd_recipient_restrictions`"
  13. /etc/init.d/postfix reload
  14. # Based on this: http://jimsun.linxnet.com/misc/postfix-anti-UCE.txt
  15. # Support fortrusted MX backup networks added
  16. # PCRE stuff avoided,as PCRE is only optional on newest Debian packages
  17. # RBLs replaced with those recommended by http://www.antispews.org/
  18. # Here's a convenient overview of different blackholes:
  19. # http://rbls.org/