summaryrefslogtreecommitdiff
path: root/postfix/postfix.sh
blob: a328986ed9fe9a31aceb3e06a87a523148bb9ef9 (plain)
  1. #!/bin/sh
  2. #
  3. # /etc/local-COMMON/postfix/postfix.sh
  4. # Copyright 2002-2007 Jonas Smedegaard <dr@jones.dk>
  5. #
  6. # $Id: postfix.sh,v 1.76 2008-05-25 19:00:16 jonas Exp $
  7. #
  8. # Auto-tweak plain installed postfix Debian package
  9. #
  10. # TODO:
  11. # * Implement stuff from here: http://www.wsrcc.com/spam/
  12. # * Implement stuff from here: http://www.muine.org/~hoang/postfix.html
  13. # * Implement stuff from here: http://jimsun.linxnet.com/misc/postfix-anti-UCE.txt
  14. # * Figure out a way to use chroot jail for TLS stuff.
  15. # * Use https://www.dnswl.org/
  16. set -e
  17. # Let's standardize sort
  18. export LC_ALL=C
  19. warn() {
  20. echo >&2 "Warning: $1"
  21. }
  22. exit1() {
  23. echo >&2 "Error: $1"
  24. echo >&2 "Exiting..."
  25. exit 1
  26. }
  27. # Favor specific CA for our own server and client certificates
  28. # (comment out to trust any CA)
  29. #cacert_smtpd="/etc/ssl/certs/cacert.org.pem"
  30. cacert_smtp=
  31. cacert_lmtp=
  32. # File containing all trusted CA certificates
  33. # (comment out if no chroot or it contains all individual files)
  34. cacert_default="/etc/ssl/certs/ca-certificates.crt"
  35. realmsdir='/etc/local-REDPILL'
  36. configdirs='/etc/local /etc/local-ORG /etc/local-REDPILL /etc/local-COMMON'
  37. confdir='/etc/postfix'
  38. postconf=/usr/sbin/postconf
  39. sp='[[:space:]]'
  40. if ! [ -d "$realmsdir" ]; then
  41. warn "Realms directory \"$realmsdir\" does not exist."
  42. fi
  43. #postgrey=
  44. #if [ -x /usr/sbin/postgrey ]; then
  45. # # FIXME: Use this somehow, and only warn below
  46. # postgrey=1
  47. #else
  48. # exit1 "ERROR: Greylisting support (Debian package postgrey) missing."
  49. #fi
  50. cyrus=
  51. if [ -x /usr/sbin/saslauthd ]; then
  52. if saslauthd -v 2>&1 | grep -q '^saslauthd 2.1'; then
  53. cyrus=1
  54. else
  55. warn "Cyrus SASL too old - requires >= 2.1.1)."
  56. fi
  57. else
  58. warn "Cyrus SASL missing - (Debian package sasl2-bin)."
  59. fi
  60. dovecot=
  61. dovecot_deliver=
  62. if [ -x /usr/sbin/dovecot ]; then
  63. dovecot=1
  64. if [ -x /usr/lib/dovecot/deliver ]; then
  65. dovecot_deliver=1
  66. else
  67. warn "Dovecot deliver missing."
  68. fi
  69. else
  70. warn "Dovecot missing - (Debian package dovecot-core or dovecot)."
  71. fi
  72. sslcert=
  73. if [ -f /etc/ssl/certs/postfix.pem ]; then
  74. sslcert=1
  75. else
  76. warn "No TLS encryption - requires SSL certificate at /etc/ssl/certs/postfix.pem."
  77. fi
  78. sasl_main_type=
  79. sasl_dovecot=
  80. sasl_cyrus=
  81. if [ -n "$sslcert" ]; then
  82. # FIXME: We really want to check for at least 2.1.1 but that's tricky...
  83. if [ -n "$cyrus" ]; then
  84. sasl_cyrus=1
  85. sasl_main_type=cyrus
  86. fi
  87. if [ -n "$dovecot" ]; then
  88. sasl_dovecot=1
  89. sasl_main_type=dovecot
  90. fi
  91. if [ -z "$sasl_main_type" ]; then
  92. warn "No SASL authentication - requires Cyrus SASL or Dovecot."
  93. fi
  94. else
  95. warn "No SASL authentication - requires TLS encryption."
  96. fi
  97. amavis=
  98. default_amavis_maxproc=2
  99. if [ -x /usr/sbin/amavisd ] || [ -x /usr/sbin/amavisd-new ]; then
  100. amavis=1
  101. else
  102. warn "AMaViS missing (Debian package amavisd-new)."
  103. fi
  104. dkimproxy=
  105. #dkimproxy_maxproc_in=5
  106. # FIXME: update actual outgoing maxproc from /etc/default/dkimproxy (and /etc/dkimproxy/dkimproxy_out.conf too?)
  107. dkimproxy_maxproc_out=5
  108. if [ -x /usr/sbin/dkimproxy.in ]; then
  109. if [ "1" = "$amavis" ]; then
  110. dkimproxy=1
  111. else
  112. warn "No DKIM/Domainkey - requires DKIMproxy and AMaViS."
  113. fi
  114. else
  115. warn "DKIMproxy missing (Debian package dkimproxy)."
  116. fi
  117. catfilefromownrealm() {
  118. set -e
  119. file="$1"
  120. [ -d "$realmsdir" ] || exit 0
  121. thisrealm="$(cat /etc/local-ORG/realm || dnsdomainname | tr '[a-z]' '[A-Z]')"
  122. cat "$realmsdir/$thisrealm/$file"
  123. }
  124. catallfilesfromotherrealms() {
  125. set -e
  126. file="$1"
  127. [ -d "$realmsdir" ] || exit 0
  128. [ -f "$realmsdir/realms" ] || exit 0
  129. realms="$(cat "$realmsdir/realms" | sed 's/#.*//')"
  130. thisrealm="$(cat /etc/local-ORG/realm || dnsdomainname | tr '[a-z]' '[A-Z]')"
  131. for realm in $realms; do
  132. if [ "$thisrealm" != "$realm" ]; then
  133. cat "$realmsdir/$realm/$file"
  134. fi
  135. done
  136. }
  137. catfirstfile() {
  138. set -e
  139. file="$1"
  140. context="${2:-postfix}"
  141. configdir=''
  142. for dir in $configdirs; do
  143. if [ -d "$dir/$context" ] && [ -f "$dir/$context/$file" ]; then
  144. configdir="$dir/$context"
  145. break
  146. fi
  147. done
  148. if [ -z "$configdir" ]; then
  149. exit1 "ERROR: file \"$file\" not found."
  150. fi
  151. cat "$configdir/$file"
  152. }
  153. # TODO: support quoted string, and trailing comment.
  154. getperlvarfromfile() {
  155. set -e
  156. export var="$1"
  157. export default="$2"
  158. file="$3"
  159. context="${4:-postfix}"
  160. catfirstfile "$file" "$context" \
  161. | perl -nE'/^\$$ENV{"var"}\h*=\h*(\d+)/ and $s=$1; END {print length($s) ? $s : $ENV{'default'}}'
  162. }
  163. getlinesfromfile() {
  164. set -e
  165. param="$1"
  166. shift
  167. replacements=
  168. for subparam in $@; do
  169. case "$subparam" in
  170. *=)
  171. oldparam="`echo $subparam | awk -F= '{print $1}'`"
  172. replacements="$replacements;s/,*[^,]*$oldparam[^,]*,*/,/"
  173. continue
  174. ;;
  175. *=*=*)
  176. oldparam="`echo $subparam | awk -F= '{print $1}'`"
  177. newparam="`echo $subparam | awk -F= '{print $2}'`"
  178. newparamfile="`echo $subparam | awk -F= '{print $3}'`"
  179. ;;
  180. *)
  181. oldparam=$subparam
  182. newparam=$subparam
  183. newparamfile=$subparam
  184. ;;
  185. esac
  186. newparamvalues="`getlinesfromfile $newparamfile | sed -e 's/.*=[ ]*//' -e 's/,/ /g'`"
  187. newstring=
  188. for newparamvalue in $newparamvalues; do
  189. newstring="${newstring}$newparam $newparamvalue,"
  190. done
  191. replacements="$replacements;s/$oldparam/$newstring/"
  192. done
  193. echo -n "$param = "
  194. catfirstfile "$param" | sed 's/#.*//' | tr '\n' ',' | sed -e 's/^[, ]*//;s/[, ]\+/,/g' -e 's/\^/ /g' -e "s/,\$//$replacements"
  195. }
  196. addoroverwritewithindents() {
  197. set -e
  198. file="$1"
  199. export token="$2"
  200. # provide replacement as STDIN
  201. perl -0777 -pi \
  202. -E 'BEGIN{ $s=<STDIN>; chomp $s }'\
  203. -E 's/$ENV{"token"}.*(?:\n\h.*)+\n/$s/m and $seen=1;'\
  204. -E 'END{ unless ($seen) { print $s } }'\
  205. "$file"
  206. }
  207. postmapfiles=
  208. tempdir="$(mktemp -td postfix.XXXXXX)"
  209. cp -a -t "$tempdir" "$confdir"/*
  210. # Inspired by D. J. Bernstein: http://cr.yp.to/smtp/greeting.html
  211. $postconf -c "$tempdir" -e 'smtpd_banner = $myhostname NO UCE ESMTP $mail_name (Debian/GNU)'
  212. # Some badly configured setup use hostname instead of FQDN
  213. # Disable completely: Effective, but hurts executive type guys using windows servers... :-(
  214. #if $postconf -c "$tempdir" myhostname | grep -q '\.'; then
  215. # $postconf -c "$tempdir" -e 'smtpd_helo_required = yes'
  216. #fi
  217. $postconf -c "$tempdir" -e 'smtpd_helo_required = no'
  218. $postconf -c "$tempdir" -e "`getlinesfromfile permit_mx_backup_networks`"
  219. $postconf -c "$tempdir" -e "maps_rbl_domains ="
  220. $postconf -c "$tempdir" -e "`getlinesfromfile smtpd_client_restrictions reject_rhsbl_client`"
  221. $postconf -c "$tempdir" -e "`getlinesfromfile smtpd_helo_restrictions`"
  222. $postconf -c "$tempdir" -e "`getlinesfromfile smtpd_sender_restrictions reject_rhsbl_sender ${dkimproxy:-sender_access_regex=}`"
  223. $postconf -c "$tempdir" -e "`getlinesfromfile smtpd_recipient_restrictions reject_maps_rbl=reject_rbl_client=maps_rbl_domains`"
  224. $postconf -c "$tempdir" -e "`getlinesfromfile smtpd_data_restrictions`"
  225. # FIXME: clear only specific line (not whole file) when dkimproxy unused
  226. if [ -f "$tempdir/sender_access_regex" ]; then
  227. if [ -n "$dkimproxy" ]; then
  228. grep -q -F '/^/ FILTER dkimsign:[127.0.0.1]:10026' "$tempdir/sender_access_regex" \
  229. || echo '/^/ FILTER dkimsign:[127.0.0.1]:10026' >> "$tempdir/sender_access_regex"
  230. else
  231. if grep -q -F '/^/ FILTER dkimsign:[127.0.0.1]:10026' "$tempdir/sender_access_regex"; then
  232. echo "echo '' > \"$confdir/sender_access_regex\"" >> "$tempdir/COMMANDS"
  233. rm "$tempdir/sender_access_regex"
  234. fi
  235. fi
  236. postmapfiles="$postmapfiles sender_access_regex"
  237. fi
  238. # Support exceptions to default response
  239. # (Day Old Bread (dob) lists need to reject only temporarily)
  240. $postconf -c "$tempdir" -e "rbl_reply_maps = hash:$confdir/rbl_reply_map"
  241. cat /etc/local-COMMON/postfix/rbl_reply_map \
  242. | sed 's/#.*//' \
  243. > "$tempdir/rbl_reply_map"
  244. postmapfiles="$postmapfiles rbl_reply_map"
  245. # Verify senders of common suspicious and known verifiable domains
  246. # (exclude verification of postmaster@ to not verify verification probes)
  247. # (add own domains before peers for (rare) cases of duplicates)
  248. # FIXME: somehow do this step only if enabled in smtpd_sender_restrictions
  249. # TODO: Properly implement exception exclusion like yahoo (which does not want to be checked any longer!)
  250. cat /etc/local-COMMON/postfix/maildomains | grep -v yahoo | sort | sed 's/$/ reject_unverified_sender/' > "$tempdir/sender_access"
  251. ( catfilefromownrealm maildomains | sort; catallfilesfromotherrealms maildomains | sort ) \
  252. | sed 's/\(.*\)$/postmaster@\1 permit\n\1 reject_unverified_sender/' >> "$tempdir/sender_access"
  253. [ ! -f "$tempdir/sender_access.addon" ] || cat "$tempdir/sender_access.addon" >> "$tempdir/sender_access"
  254. postmapfiles="$postmapfiles sender_access"
  255. $postconf -c "$tempdir" -e "unverified_sender_reject_code = 550"
  256. # Trust recipient verification too
  257. $postconf -c "$tempdir" -e "unverified_recipient_reject_code = 550"
  258. if [ -n "$dovecot_deliver" ]; then
  259. $postconf -c "$tempdir" -e mailbox_command=/usr/lib/dovecot/deliver
  260. fi
  261. if [ -n "$sasl_cyrus" ]; then
  262. saslsubdir="sasl"
  263. mkdir -p "$tempdir/$saslsubdir"
  264. echo 'mech_list: plain login' > "$tempdir/$saslsubdir/smtpd.conf"
  265. echo 'minimum_layer: 0' >> "$tempdir/$saslsubdir/smtpd.conf"
  266. echo 'sasl_pwcheck_method: saslauthd' >> "$tempdir/$saslsubdir/smtpd.conf"
  267. echo 'auto_transition: false' >> "$tempdir/$saslsubdir/smtpd.conf"
  268. groups postfix | grep -q sasl || echo "adduser postfix sasl" >> "$tempdir/COMMANDS"
  269. # Release TLS-related daemons from chroot jail (bringing SASL into the jail is just too messy)
  270. sed --in-place \
  271. -e "s/^\(smtp$sp\+inet\($sp\+[n-]\)\{2\}$sp\+\)[n-]\(\($sp\+-\)\{2\}$sp\+smtpd\).*/\1n\3 -o smtpd_sasl_auth_enable=yes/" \
  272. -e "s/^#\?\(\(smtps\|587\)$sp\+inet\($sp\+[n-]\)\{2\}$sp\+\)[n-]/\1n/" \
  273. -e "s/^#\(tlsmgr$sp\)/\1/" \
  274. "$tempdir/master.cf"
  275. addoroverwritewithindents $tempdir/master.cf '^tlsmgr\h' << EOF
  276. tlsmgr unix - - - 300 1 tlsmgr
  277. EOF
  278. fi
  279. case "$sasl_main_type" in
  280. '') ;;
  281. dovecot)
  282. $postconf -c "$tempdir" -e smtpd_sasl_type=dovecot
  283. $postconf -c "$tempdir" -e smtpd_sasl_path=private/auth
  284. ;;
  285. cyrus)
  286. $postconf -c "$tempdir" -e smtpd_sasl_type=cyrus
  287. $postconf -c "$tempdir" -e smtpd_sasl_path=smtpd
  288. ;;
  289. *) exit1 "ERROR: Wrong SASL type \"$sasl_main_type\"!";;
  290. esac
  291. # Avoid smtpd_tls_CApath or smtpd_tls_CAfile to trick outlook.com
  292. # See <http://postfix.1071664.n5.nabble.com/Problems-with-incoming-mails-from-outlook-com-td78356.html>
  293. if [ -n "$sslcert" ]; then
  294. $postconf -c "$tempdir" -e 'smtpd_tls_cert_file = /etc/ssl/certs/postfix.pem'
  295. $postconf -c "$tempdir" -e 'smtpd_tls_loglevel = 1'
  296. $postconf -c "$tempdir" -e 'smtpd_use_tls = yes'
  297. $postconf -c "$tempdir" -e 'smtp_tls_CApath = /etc/ssl/certs'
  298. $postconf -c "$tempdir" -e 'smtpd_tls_CApath = '
  299. $postconf -c "$tempdir" -e 'lmtp_tls_CApath = /etc/ssl/certs'
  300. $postconf -c "$tempdir" -e 'smtpd_tls_CAfile = '
  301. $postconf -c "$tempdir" -e smtp_tls_CAfile="${cacert_smtp:-$cacert_default}"
  302. $postconf -c "$tempdir" -e lmtp_tls_CAfile="${cacert_lmtp:-$cacert_default}"
  303. $postconf -c "$tempdir" -e 'smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache'
  304. $postconf -c "$tempdir" -e 'smtpd_tls_session_cache_timeout = 3600s'
  305. $postconf -c "$tempdir" -e 'tls_random_exchange_name = ${data_directory}/prng_exch'
  306. $postconf -c "$tempdir" -e 'smtpd_tls_auth_only = yes'
  307. $postconf -c "$tempdir" -e 'smtpd_sasl_auth_enable = no' # SASL is enabled explicitly with TLS transport
  308. $postconf -c "$tempdir" -e 'smtpd_sasl_security_options = noanonymous'
  309. $postconf -c "$tempdir" -e 'smtpd_sasl_local_domain = '
  310. $postconf -c "$tempdir" -e 'smtpd_tls_received_header = yes'
  311. $postconf -c "$tempdir" -e 'broken_sasl_auth_clients = yes'
  312. $postconf -c "$tempdir" -e 'tls_random_source = dev:/dev/urandom'
  313. # Accepting client certificates breaks SMTP AUTH on OutLook Express on Mac (Classic)
  314. $postconf -c "$tempdir" -e 'smtpd_tls_ask_ccert = no'
  315. if [ -e /etc/ssl/private/postfix.pem ]; then
  316. $postconf -c "$tempdir" -e 'smtpd_tls_key_file = /etc/ssl/private/postfix.pem'
  317. # Enable client side TLS only when private certificate is present
  318. $postconf -c "$tempdir" -e 'smtp_tls_cert_file = /etc/ssl/certs/postfix.pem'
  319. $postconf -c "$tempdir" -e 'smtp_tls_key_file = /etc/ssl/private/postfix.pem'
  320. $postconf -c "$tempdir" -e 'smtp_tls_loglevel = 1'
  321. $postconf -c "$tempdir" -e 'smtp_use_tls = yes'
  322. $postconf -c "$tempdir" -e 'smtp_tls_note_starttls_offer = no' # Enable to collect info for smtp_tls_per_site option
  323. $postconf -c "$tempdir" -e 'smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache'
  324. # Force using TLS for peers
  325. catallfilesfromotherrealms mailhost | sort | sed 's/^/[/;s/$/]:submission secure/' > "$tempdir/tls_policy"
  326. [ ! -f "$tempdir/tls_policy.addon" ] || cat "$tempdir/tls_policy.addon" >> "$tempdir/tls_policy"
  327. postmapfiles="$postmapfiles tls_policy"
  328. $postconf -c "$tempdir" -e "smtp_tls_policy_maps = hash:$confdir/tls_policy"
  329. else
  330. $postconf -c "$tempdir" -e 'smtp_use_tls = no'
  331. warn "No client-side TLS - requires private SSL certificate at /etc/ssl/private/postfix.pem."
  332. fi
  333. fi
  334. if [ -n "$amavis" ]; then
  335. $postconf -c "$tempdir" -e 'max_use = 10' # Avoid too much reuse
  336. amavis_maxproc=$(getperlvarfromfile max_servers "$default_amavis_maxproc" amavisd.conf.addon amavis)
  337. addoroverwritewithindents $tempdir/master.cf '^smtp-amavis\h' << EOF
  338. smtp-amavis unix - - n - $amavis_maxproc smtp
  339. -o smtp_data_done_timeout=1200s
  340. -o smtp_never_send_ehlo=yes
  341. -o smtp_send_xforward_command=yes
  342. -o disable_dns_lookups=yes
  343. -o max_use=20
  344. EOF
  345. addoroverwritewithindents $tempdir/master.cf '^127.0.0.1:10025\h' << EOF
  346. 127.0.0.1:10025 inet n - n - - smtpd
  347. -o content_filter=
  348. -o local_recipient_maps=
  349. -o relay_recipient_maps=
  350. -o smtpd_restriction_classes=
  351. -o smtpd_delay_reject=no
  352. -o smtpd_client_restrictions=permit_mynetworks,reject
  353. -o smtpd_helo_restrictions=
  354. -o smtpd_sender_restrictions=
  355. -o smtpd_recipient_restrictions=permit_mynetworks,reject
  356. -o smtpd_data_restrictions=reject_unauth_pipelining
  357. -o smtpd_end_of_data_restrictions=
  358. -o mynetworks=127.0.0.0/8
  359. -o smtpd_error_sleep_time=0
  360. -o smtpd_soft_error_limit=1001
  361. -o smtpd_hard_error_limit=1000
  362. -o smtpd_client_connection_count_limit=0
  363. -o smtpd_client_connection_rate_limit=0
  364. -o receive_override_options=no_header_body_checks,no_unknown_recipient_checks
  365. EOF
  366. if [ -n "$dkimproxy" ]; then
  367. $postconf -c "$tempdir" -e 'content_filter = smtp-amavis:[127.0.0.1]:10028'
  368. addoroverwritewithindents $tempdir/master.cf '^submission\h' << EOF
  369. submission inet n - n - - smtpd
  370. -o syslog_name=postfix/submission
  371. -o smtpd_tls_security_level=encrypt
  372. -o smtpd_sasl_auth_enable=yes
  373. -o smtpd_client_restrictions=permit_sasl_authenticated,reject
  374. -o content_filter=dkimsign:[127.0.0.1]:10028
  375. EOF
  376. addoroverwritewithindents $tempdir/master.cf '^pickup\h' << EOF
  377. pickup fifo n - - 60 1 pickup
  378. -o content_filter=dkimsign:127.0.0.1:10028
  379. EOF
  380. addoroverwritewithindents $tempdir/master.cf '^dkimsign\h' << EOF
  381. dkimsign unix - - n - $dkimproxy_maxproc_out smtp
  382. -o smtp_send_xforward_command=yes
  383. -o smtp_discard_ehlo_keywords=8bitmime,starttls
  384. EOF
  385. addoroverwritewithindents $tempdir/master.cf '^127\.0\.0\.1:10029\h' << EOF
  386. 127.0.0.1:10029 inet n - n - - smtpd
  387. -o content_filter=
  388. -o receive_override_options=no_unknown_recipient_checks,no_header_body_checks
  389. -o smtpd_helo_restrictions=
  390. -o smtpd_client_restrictions=
  391. -o smtpd_sender_restrictions=
  392. -o smtpd_recipient_restrictions=permit_mynetworks,reject
  393. -o mynetworks=127.0.0.0/8
  394. -o smtpd_authorized_xforward_hosts=127.0.0.0/8
  395. EOF
  396. else
  397. $postconf -c "$tempdir" -e 'content_filter = smtp-amavis:[127.0.0.1]:10024'
  398. addoroverwritewithindents $tempdir/master.cf '^submission\h' << EOF
  399. submission inet n - n - - smtpd
  400. -o syslog_name=postfix/submission
  401. -o smtpd_tls_security_level=encrypt
  402. -o smtpd_sasl_auth_enable=yes
  403. -o smtpd_sasl_local_domain=\$mydomain
  404. EOF
  405. addoroverwritewithindents $tempdir/master.cf '^pickup\h' << EOF
  406. pickup fifo n - - 60 1 pickup
  407. EOF
  408. fi
  409. fi
  410. diff -ruN "$confdir" "$tempdir" || if [ $? -gt 1 ]; then exit $?; else needs_reload="1"; fi
  411. if [ "$force" = "1" ]; then
  412. do_update="y"
  413. elif [ "1" = "$needs_reload" ]; then
  414. echo -n "Above is the intended changes. OK to update (y/N)? "
  415. read do_update
  416. fi
  417. case $do_update in
  418. y|Y)
  419. if [ -f "$tempdir/COMMANDS" ]; then
  420. cat "$tempdir/COMMANDS" | sh -s
  421. fi
  422. rm -f "$tempdir/COMMANDS"
  423. diff -q "$confdir/master.cf" "$tempdir/master.cf" || if [ $? -gt 1 ]; then exit $?; else needs_restart="1"; fi
  424. cp -a -f -t "$confdir" "$tempdir"/*
  425. rm -rf "$tempdir"
  426. for file in $postmapfiles; do
  427. postmap "$confdir/$file"
  428. done
  429. if [ "1" = "$needs_restart" ]; then
  430. invoke-rc.d postfix restart
  431. else
  432. invoke-rc.d postfix force-reload
  433. fi
  434. if [ "1" = "$needs_reload" ]; then
  435. echo >&2 "Changes applied!"
  436. fi
  437. ;;
  438. *)
  439. if [ "1" = "$needs_reload" ]; then
  440. exit1 "Aborted!"
  441. fi
  442. ;;
  443. esac
  444. if [ "1" != "$needs_reload" ]; then
  445. echo >&2 "No changes needed!"
  446. fi
  447. # Based on this: http://jimsun.linxnet.com/misc/postfix-anti-UCE.txt
  448. # Support for trusted MX backup networks added
  449. # PCRE stuff avoided, as PCRE is only optional on newest Debian packages
  450. # RBLs replaced with those recommended by http://www.antispews.org/
  451. # AMaViS tweaks as documented in amavisd-new package
  452. # AUTH-SMTP based on these:
  453. # http://lists.q-linux.com/pipermail/plug/2003-July/029503.html
  454. # http://www.porcupine.org/postfix-mirror/newdoc/SASL_README.html
  455. # Here's a convenient overview of different blackholes:
  456. # http://rbls.org/