Re: howto set evolution to work with spamassassin and clamav

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 2004-11-08 at 09:09, windtim@xxxxxxxx wrote:
> Hi
>  i've Fedora Core 2 and i use evolution 1.4. I want to set it to work with
> spamassassin and clamav ( to delete virus and spam from my mailbox). How can i do? 
> Help in advance for the help

There are two basic ways to setup spamassassin.  If you have control of
the MTA where the email is arriving it is best to configure spamassassin
as a filter used by the MTA process.  I have done this for sendmail
using procmail.  There are also milters that let you configure
spamassassin as part of your MTA.  This is dependent on the particular
MTA you are using.  Mimedefang is also a good way to implement this. 
There are a lot of good how to's on the web on how to configure your
particular MTA to work with spamassassin so I won't go into that here.

If you are using evolution only and pulling your email via pop3 or imap
then you can configure a filter in evolution that calls spamassassin on
each message as it arrives.  I have also done this before and it works
very well.

To setup a filter in evolution do the following:

Install spamassassin on your system
in evolution configure a filter that has under execute actions if all
criteria are met

pipe message to a shell command

	specify the command as   /usr/bin/spamassassin -e -P

	specify the last option as   returns greater than  0

Under the then section of the filter I have the following:

set status    read
move to folder   "possible junk mail" in "local folders"
stop processing


This will cause all messages identified as spam to be marked as read,
moved to a holding folder, and the filter will stop processing.  If you
don't put the stop processing option in the next filter in the list will
do its thing to the message.


You also need to configure spamassassin.  You need to create under your
users account a .spamassassin directory.  (this may get created
automatically if you run spamassassin manually once.  I don't remember
if it did that or not.)

In that directory you will want to create a user_prefs file.  You should
be able to find examples in the package or on the web.  I have included
important bits from mine below.

The other files in the .spamassassin directory that should get created
automatically I think are:

bayes_journal, bayes_seen, and bayes_toks.

These files are what is used by the baysian filter system.  That is what
keeps track of what you declare to be spam or not spam.  Spamassassin
also uses additional rule sets in addition to bayes to identify spam. 
Also note: bayes will not start working until you have processed 200
spam and 200 ham messages using sa-learn.  sa-learn is the program that
is used to manually teach the bayes database what you consider ham and
spam.  Read up on the man page for how to use it.  (I think the first
time you run sa-learn it will read your user_prefs file and create the
bayes files listed above.)

You can also pull additional rule sets for the SARE web site. 
http://www.rulesemporium.com/

By selectively adding some of the SARE rulesets you can greatly increase
the hit rate and accuracy of spamassassin.  The latest version of
spamassassin implements SURBLs which according to reports work very
well.  You may or may not want/need to implement SURBLs.  Also you may
want to disable network checks as these can take a lot of time to
complete.

Another tip, is if you are receiving a lot of mail list traffic such as
fedora mailing list, you should put a filter in ahead of the
spamassassin check that moves those mailing list messages to their own
folders and stops processing.  I have found that very little spam hits
mailing lists.  If you don't do this your system will take a long time
to download email since it will kick off a spamassassin process for each
message.  Save spamassassin for non-mailing list messages.

Once you have it in place you should create another folder for missed
spam.  Any messages that end up in your inbox that you identify as spam
move them to this missed spam folder.  Then periodically run sa-learn on
that folder to teach bayes what spam is.  You may also want to setup a
folder for false positives (ham wrongly identified as spam).  Go through
the spam folder and move any false positives to the false positive
folder then run sa-learn on that folder telling it that it is ham.  

You will want to run sa-learn on your regular inbox identifying all
messages as ham as well.  After doing this for a few days or couple of
weeks (depends on the volume of email you get) things should hit a point
where virtually all spam is identified and you have no false positives. 
Once you hit that point you can reduce the frequency you run sa-learn on
those folders and your inbox.

Also in the user_prefs file you can whitelist certain addresses.  You
may want to do this for friends and business contacts or you can do this
as needed as a quick way to resolve any false positives you may get.


# How many hits before a mail is considered spam.
required_hits           5.0

# Whether to change the subject of suspected spam
rewrite_subject         0

# Text to prepend to subject if rewrite_subject is used
subject_tag             *****SPAM*****

# Encapsulate spam in an attachment
report_safe             1

# Use terse version of the spam report
use_terse_report        0

# Enable the Bayes system
bayes_path /home/scot/.spamassassin/bayes
auto_whitelist_path /home/scot/.spamassassin/auto-whitelist
bayes_file_mode 777
auto_whitelist_file_mode 777
use_bayes               1
bayes_ignore_header ReSent-Date
bayes_ignore_header ReSent-From
bayes_ignore_header ReSent-Message-ID
bayes_ignore_header ReSent-Subject
bayes_ignore_header ReSent-To
bayes_ignore_header Resent-Date
bayes_ignore_header Resent-From
bayes_ignore_header Resent-Message-ID
bayes_ignore_header Resent-Subject
bayes_ignore_header Resent-To

# Enable Bayes auto-learning
auto_learn              1


Good luck and happy spam hunting!


-- 
Scot L. Harris
webid@xxxxxxxxxx

This is a test of the emergency broadcast system.  Had there been an
actual emergency, then you would no longer be here. 


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux