#!/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 email address you wanna accept:"
read ACCEPT
echo "From: $ACCEPT yes">> $white_list
echo "add email address <$ACCEPT> to white list"
echo "重新启动 MailScanner 服务...."
/opt/MailScanner/bin/MailScanner restart
echo "操作成功完成!"
elif [ "$INPUT" == "black" ]; then
echo -n "please entery email address you wanna reject:"
read REJECT
echo "From: $REJECT yes">> $black_list
echo "add email address <$REJECT> to black list"
echo "重启动MailScanner 服务...."
/opt/MailScanner/bin/MailScanner restart
echo "命令成功完成!"
else
echo "do nothing, exit!"
fi
本文转自andylhz 51CTO博客,原文链接:http://blog.51cto.com/andylhz2009/760586,如需转载请自行联系原作者