将邮件地址添加到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



     本文转自andylhz 51CTO博客,原文链接:http://blog.51cto.com/andylhz2009/760586,如需转载请自行联系原作者


上一篇:【直播预告】阿里技术专家煮茶:redis主从复制基本原理


下一篇:【直播预告】阿里技术专家巧工:GDB 接入方式以及使用建议