# # vim: set filetype=procmail : # # $Id: dnsbl_test,v 1.3 2002/12/21 18:28:08 adicvs Exp $ # # This file is called by dnsbl. It will test the untrusted ip by looking # up the ip address in the DNSBL_NS nameserver. It will add a header line # if the untrusted ip is an open relay. # # Check against DNSBL_NS # Use sed to properly display multiline output from nslookup by # indenting all ines with tab except for the first line DNSBL_CHECK="xx" DNSBL_CHECK=`${NSLOOKUP} ${IP_REV}.${DNSBL_NS} | ${SED} '2,$s/^/ /'` # Process the nslookup output for debugging purposes :0 * DNSBL_DEBUG ?? yes { # Log :0 * DNSBL_LOG ?? yes { LOG=" debug: ${DNSBL_CHECK}.${NL}" } # Insert header :0 fhw | formail -A "X-Spam-Debug: ${DNSBL_CHECK}" } # Is this ip a known spammer or open relay? :0 * DNSBL_CHECK ?? 127\.0\.0\.[1-9] { # Log :0 * DNSBL_LOG ?? yes { LOG=" match: ${DNSBL_NS} lists ${IP_STR}.${NL}" } # Insert header :0 fhw | formail -A "X-Spamcheck: ${DNSBL_NS} lists ${IP_STR} - see ${DNSBL_URI}" } # end