将邮件地址添加到MailScanner的白名单和黑名单的脚本

[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 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

你可能感兴趣的:(将邮件地址添加到MailScanner的白名单和黑名单的脚本)