The new check-blacklist.sh script can be used to check if your mail server
appears on a DNSBL blacklist, because if such thing happens, it worth
your attention.
Can be easily integrated with monitoring systems like Zabbix.
Requires DiG to be installed.
new file: host/check-blacklist.sh
--- /dev/null
+#!/bin/sh
+if [ $# -lt 2 ]
+then
+ cat << END
+Usage $0 <hostname> <blacklist>
+Where
+ hostname - host to check on blacklist
+ blacklist - DNSBL blacklist (e.g. "zen.spamhaus.org")
+END
+ exit 255
+fi
+
+ip=$(dig a "$1" +short)
+if [ -n "$ip" ]
+then
+ bl=$(dig a "$(printf "%s." "$ip" | tac -s.)$2" +short)
+ [ -n "$bl" ] && { echo "$ip is blacklisted."; exit 1; } || echo "$ip is not blacklisted."
+fi