Script to add mail address to Mailscanner whitelist and blacklist

Source: Internet
Author: User
Tags echo command mail

[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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.