I was able to create some Bash code that runs against a file, attached is the code. This is still beta and probably inefficient and buggy. If you can devise a better way please let me know.
[File /home/e-smith/files/users/%username%/.qmail]
|bouncesaying 'The message was not delivered because it was viewed as SPAM mail.' spamfilter $SENDER $RECIPIENT
./Maildir/
#Template End#
[ FILE /var/qmail/bin/spamfilter]
!/bin/bash
#// Nathan Fowler
#// evilghost@stickit.nu
#// Code adapted from SAVIN Jerome
#// Please visit
http://forums.contribs.org/index.php?topic=19703.msg77706#msg77706 for more info.
#Location of file containing list of Spammer Addresses
#Should be in the format of one address per line
Filename=/var/spamfilter/spamlist.txt
#// Do not modify this code, doing so can break it.
if [ -z "$1" ]
then
echo "date Sender not passed!" >> /var/spamfilter/spam_filter_errors.log
exit 1
fi
SRCADDR=$(echo $1 | tr A-Z a-z)
if [ -f "$Filename" ]
then
echo "Found file!" > /dev/null
else
echo "date Cannot find spam address file! $Filename" >> /var/spamfilter/spam_filter$
exit 1
fi
cat $Filename | tr A-Z a-z > /tmp/spamlist.txt
Filename=/tmp/spamlist.txt
counter=0
line_count=wc < $Filename | awk '{ print $1 }'
until [ "$counter" == "$line_count" ]
do
let "counter+=1"
read spamaddr
if [ "$spamaddr" == "$SRCADDR" ]
then
echo -e "date Denied $SRCADDR to $2" >> /var/spamfilter/rejected_mails.log
exit 0
fi
done <"$Filename"
exit 1