This task is quite simple and the tools are readily available on the internet. In the spirit of Open Source, may of the tools are made free and come with source code. Binary version for may distros are available too. It's only a matter of choice and how we're going to set things up.
Antivirus
Clam antivirus is one of the best antiviri around. So far she can detect almost 97% of Windows viri and worms. Those viri are always reached our computers over network and internet. The main medium is email. I personally got in average 5 to 10 emails containing virus. That's why, antivirus is really important these days.
Trashscan
This is a script invoked by procmail to scan and send a notice to the sender if the mail contains virus. trasscan comes with clamav package.
Setting up procmailrc for scanning
#
# procmail configuration for TrashScan:
# ZapCoded by Trashware; 13.10.2002
#
# [ ... ]
# ----------------------------------------------------------------------------- #
# Virus scan section ... #
# ----------------------------------------------------------------------------- #
# 1. Run TrashScan
:0
* multipart
* !^X-Virus-Scan:
| /usr/local/sbin/trashscan
# 2. Filter tagged virus mails
:0:
* ^X-Virus-Scan: Suspicious
/dev/null
The last line will delete the mail containing virus.
Showing posts with label procmail. Show all posts
Showing posts with label procmail. Show all posts
Tuesday, July 19, 2005
Sunday, July 17, 2005
Setting up Spam Detection System for mail server
For over a month, I did a research on how to install, configure and test spam detection system on mail server which i manage. Here's the quick step :
1. Install spamassassin from spamassassin.org. I use spamc and spamd and not the perl version. Advantage: faster for bz server.
2. Make this setting in /etc/mail/spamassassin/local.conf
# SpamAssassin user preferences file.
# See 'man Mail::SpamAssassin::Conf' for
# details of what can be tweaked.
# score needed to deem an email to be spam.
# the lower the score, the more likely the email
# will be classified as spam. default is 5, but
# I have found that 4 works a little bit better
required_hits 4
# if you find an email from an address classified
# as spam that should
# *never* be classified as spam, add it to the whitelist
whitelist_from *@mp3.com
# if you receive an email from an address that will
# always be spam, add it to the blacklist (comma separated)
blacklist_from big@boss.com
# Whitelist and blacklist addresses are now
# file-glob-style patterns, so
# "friend@somewhere.com", "*@isp.com",
# or "*.domain.net" will all work.
# append the subject line with "[SPAM]"
# if you do not want the subject line altered,
# just remove this line
subject_tag [SPAM]
3. Make sure procmail is installed. use 'which procmail' to know. if not, go to www.procmail.org to download and install.
4. Test for one user first. configure .procmailrc in one user home directory like this:
## Set to yes when debugging
VERBOSE=no
## Put '#' before LOGFILE if you want
# no logging (not recommended)
LOGFILE=procmaillog
:0fw: spamassassin.lock
/usr/bin/spamc
# The following three lines move messages tagged
# as spam to a folder called "spam-folder" If you
# want mail to stay in your inbox, just
# delete the lines
:0:
* ^X-Spam-Status: Yes
spam-folder
Update : You could replace spam-folder with /dev/null if you want the spam mails to be automatically deleted as below (Not Recommended):Note : The 3 last lines is important for automatic moving of spam mails to 'spam-folder'. Spam mails are marked [SPAM] in their subject and this mark is user-definable.:0:
* ^X-Spam-Status: Yes
/dev/null
Ok. That's all there is to it. Test it for a month and hope that spam mails ever reach the spam-folder. :-) I bet they will.
Labels:
Linux,
mail server,
procmail,
spamassassin
Subscribe to:
Posts (Atom)