set up & config spamassassin

Hello,

make sure that the "spamd" program is running.

The spamassasin configfile is in /etc/mail/spamassassin/local.cf

John
 
Hello,

I want to set the options for spam for every domain because i have some customers they want to remove the spam and another customers they only want to mark the spam mail with {spam?}. How do i set the spam filter for each domain?
 
Hello,

That has not been implemented, but I believe can be accomplished by changing a few things in the /etc/exim.conf.

Make the spamcheck transport look like this:
Code:
spamcheck:
  driver = pipe
  batch_max = 100
  command = /usr/sbin/exim -oMr spam-scanned -bS
  current_directory = "/tmp"
  group = mail
  home_directory = "/tmp"
  log_output
  message_prefix =
  message_suffix =
  return_fail_output
  no_return_path_add
  transport_filter = /usr/bin/spamc [b]-u ${lookup{$domain}lsearch*{/etc/virtual/domainowners}{$value}}[/b]
  use_bsmtp
  user = mail
Note that the above code is untested but in theory should work. It will allow you to setup the ~/.spamassassin file (/home/username/.spamassassin) to filter whatever you want.

That allows control over the spam filtering (to determine if it's spam).. but if you want to have the ability to drop emails on a perdomain basis, you'd need to edit /etc/virtual/domain.com/filter.

Add the following:
Code:
if
    $h_X-Spam-Status: contains "Yes"
        or
    "${if def:h_X-Spam-Flag {def}{undef}}" is "def" 
then
    logwrite "    => junk : SPAM"
    save $home/spam/
    finish
endif
The save path will probably need twekaing as the directories won't exist, but you might need to actually specify a file beacause of the mbox format. (Note that any changes to their filter through DA will overwrite the file, so you might want to set the owner to root/755 so that it can't be touched)

Again, I havn't tested any of this, and is just a general guide to help you get started on the right path. (I just googled this howto in 5 minutes)

John
 
how can i configure Spamassassin to only edit the subject of the email with "[spam]" and not to send it in an attach mode?
 
global option

Hi, is the file /etc/mail/spamassassin/local.cf still the global config? I.e. i want to make a change that every domain uses and these changes are about 2 pages long with xtra filters etc. Adding them to this file or even to the user_pref file doesnt seem to take effect?

Barry
 
Re: How to test Spamassassin Effectiveness

Reyner said:

2. Does it have learning capabilities?

Why doesn't it have learning capabilities, couldn't we come up with a sa-learn script integrated in the DA interface that learns from the mail that the DA user put in the spam filter dir by hand, or maybe an email address to send spam mail to so that it automatically gets filtered in the corect .spamassassin db?

Let's hope for some SA gurus,

Tristan
 
In Headers only:

"Received: from mail by aaa.domain.net with spam-scanned (Exim 4.53)

spamd is running

How can I see the score?
 
I added the following to "optional modifications" under ACL check_recipient in exim.conf:

Code:
   deny message = Message scored $spam_score spam points.
        spam = nobody:true
        condition = ${if >{$spam_score_int}{120}{1}{0}}

It should automatically delete email on the whole server automatically, if it spamassassin has given it a higher score than 12. I haven't verified that it works, and I'm not seeing anything in the logs, which is scary, but I'm not receiving emails with more than 12 points from SA. So it looks as if it is working.

Later edit: Don't think this is actually working, as Exim is using transport to Spamd, so it isn't marked as spam at this stage.

Anyone know how to filter out on a system wide basis? I.e. set up the filter file for all accounts?
 
Last edited:
torp said:
Anyone know how to filter out on a system wide basis? I.e. set up the filter file for all accounts?

I just added John's filtering to /etc/system_filter.exim and set SA to report spam when > 10. This should get rid of a lot of spam, I think.
 
Back
Top