I'm not much of a coder but I needed something for a client so they didn't have to call me to add addresses to the whitelist or blacklist, I'm sure other here can improve on this but thought maybe someone else needs this also.

---code---
#!/bin/bash
if [ ! $# == 2 ]; then
 echo "Usage:%0 (black|white) [address pattern]"
 echo "You can filter several different ways:"
 echo "multiple host in domain method       *.domain.com"
 echo "domain method                            [EMAIL PROTECTED]"
 echo "single email user method           [EMAIL PROTECTED]"
 exit
fi

mode="$1"
addr="$2"

if [ $mode = "black" ] ; then
       echo "Black Listing $2"
       echo "blacklist_from $2" >> /etc/mail/spamassassin/blacklist.cf
       cat /etc/mail/spamassassin/blacklist.cf
else
       echo "White Listing $2"
       echo "whitelist_from $2" >> /etc/mail/spamassassin/whitelist.cf
       cat /etc/mail/spamassassin/whitelist.cf
fi
--- end of code ---

Reply via email to