Surblhost is a small command-line program that looks up hostnames in the Spam URI Realtime Blocklists (SURBL).
Hosts that are blacklisted means that global spam email have been reported to contain links to these hosts.
Many spam filtering programs use the SURBL to aid in the filtering process, but this program can serve many other needs. In fact, it was written to provide safe URL redirection at memurl.com.
Surblhost is written in C and distributed freely under the GNU General Public License v2.
Surblhost is useful because:
If you want to checkout the source from svn, do this:
$ svn co https://svn.sourceforge.net/svnroot/surblhost $ autoreconf -v -i # probably requires autoconf 2.60 $ ./configure $ make check
$ surblhost -v bigredskhoediet.com clowndiket.com checking against multi.surbl.org bigredskhoediet.com.multi.surbl.org is blacklisted by [jp][ab][ob][sc][ws] clowndiket.com.multi.surbl.org is blacklisted by [jp][ob][sc][ws] see http://www.surbl.org/lists.html for more information on the blacklists
$ surblhost -vv --test test.sc.surbl.org.sc.surbl.org 127.0.0.2 is blacklisted by spamcop test.sc.surbl.org.sc.surbl.org txt record: sc.surbl.org permanent test point
$ surblhost -vv -s www.google.com checking against multi.surbl.org google.com is in whitelist
$ surblhost -vv -s www.somewhere.co.uk checking against multi.surbl.org somewhere.co.uk.multi.surbl.org is not blacklisted
# NO HIT $ surblhost -v 156.tissuqeweightloss.com checking against multi.surbl.org warning: hostname contains subdomains: 156.tissuqeweightloss.com (try option -r) 156.tissuqeweightloss.com.multi.surbl.org is not blacklisted # OPTION -r GIVES HIT $ surblhost -v -r 156.tissuqeweightloss.com checking against multi.surbl.org recursively 156.tissuqeweightloss.com.multi.surbl.org is not blacklisted tissuqeweightloss.com.multi.surbl.org is blacklisted by [jp][ob][sc][ws] see http://www.surbl.org/lists.html for more information on the blacklists
#!/bin/bash # Copyright (C) 2006 Christian Stigen Larsen <csl@sublevel3.org> # This script is in the public domain. if test "$#" == "0" ; then echo "usage: lookup [ hostname(s) ]" echo "looks up if hosts are blocked by surbl.org" exit 1 fi while test ! -z "${1}" ; do echo -n "checking ${1} ... " surblhost -q -r 2>/dev/null ${1} if test "$?" == "2"; then echo "blocked" else echo "not blocked" fi shift done echo "" echo "for more information, see http://www.surbl.org/lists.html" exit 0This script can now be run as:
$ chmod +x lookup.sh $ ./lookup.sh 156.tissuqeweightloss.com google.com www.somewhere.co.uk checking 156.tissuqeweightloss.com ... blocked checking google.com ... not blocked checking www.somewhere.co.uk ... not blocked for more information, see http://www.surbl.org/lists.html
cd /usr/ports/mail/surblhost/ && make install cleanTo add the package:
pkg_add -r surblhost