notespam - Add a header to e-mail relayed through a spam server
Jon Lasser <jon@cluestickconsulting.com>
notespam --help
notespam --man
notespam --version
notespam [--verbose] [--spam-header header-text]
notespam takes the text of an e-mail on STDIN and returns the text of the e-mail message (body and headers both) on STDOUT. If the message has not passed through a server marked on one of the DNS blacklists, then the message is unchanged. If the server as been marked on a blacklist, the message is unchanged except for the addition of a header (either X-RBL-Check or the value of the --spam-header option) identifying the message as spam.
The text of the X-RBL-Check or equivalent header will indicate the first relaying host identified as a spam haven and the name of the blacklist service that has so identified said host. The text of the message is included in the source code, and cannot be altered at runtime.
Multiple blacklists may be checked. By default, the files /etc/notespam.blacklist and $HOME/.notespam.blacklist are both checked. No blacklist will be used more than once, no matter how many times it is listed across all blacklist files.
Whitelists contain lists of mail relays that should not be checked against any of the blackhole lists. At this time, only numeric IP addresses may be used: hostnames are not resolved. Whitelists checked by the system reside in /etc/notespam.whitelist and $HOME/.notespam.whitelist.
The following non-standard Perl modules are required, and may be installed via CPAN:
Several lines of code were borrowed from the public domain script rbl-check.pl, written by Bjarni R. Einarsson <bre@klaki.net>, available at http://bre.klaki.net/programs/spam/rbl-check.pl.txt.