[Root@mail ~]# more scripts/spam.sh
#!/bin/bash
#Purpose: Add spam email address into mailscanner conf file
#Author: Andylhz
#Date: 2010-07-20
White_list=/opt/mailscanner/etc/rules/spam.whitelist.rules
Black_list=/opt/mailscanner/etc/rules/spam.blacklist.rules
echo "Please choose spam list [White/black]"
Echo-n "->"
Read INPUT
If ["$INPUT" = = "white"]; Then
Echo-n "Please entery e-mail address for you wanna accept:"
Read ACCEPT
echo "From: $ACCEPT yes" >> $white _list
echo "Add email address < $ACCEPT > to White List"
echo "Restart the Mailscanner service ..."
/opt/mailscanner/bin/mailscanner restart
Echo "Operation completed successfully! "
elif ["$INPUT" = "BLACK"]; Then
Echo-n "Please entery e-mail address for you wanna reject:"
Read REJECT
echo "From: $REJECT yes" >> $black _list
echo "Add email address < $REJECT > to Black List"
echo "Restart the Mailscanner service ..."
/opt/mailscanner/bin/mailscanner restart
echo Command completed successfully! "
Else
echo "Do nothing, exit!"
Fi
Back to the column page: http://www.bianceng.cnhttp://www.bianceng.cn/Servers/Mail/
This article is from the "Shadow Knight" blog, please be sure to keep this source http://andylhz2009.blog.51cto.com/728703/760586