You should put this options on your /etc/amavis/conf.d/50-user
file:
$sa_tag_level_deflt = -999; # add spam info headers if at, or above that level
$sa_tag2_level_deflt = 6.2; # add 'spam detected' headers at that level
$sa_kill_level_deflt = 6.9; # triggers spam evasive actions (e.g. blocks mail)
$sa_spam_subject_tag = '**Spam**';
Configure the SPAM confidence level to the ones accordingly to your needs.
If you don't want to manage your score levels, you can set the quarantine directories to undefined ones. To do this add those lines in the same file:
$clean_quarantine_to = undef; # local quarantine
$virus_quarantine_to = undef; # traditional local quarantine
$banned_quarantine_to = undef; # local quarantine
$bad_header_quarantine_to = undef; # local quarantine
$spam_quarantine_to = undef; # local quarantine
If you want to check the information or take a look at additional information here's the Quarantine block on the AMaViS website: http://www.amavis.org/amavisd-new-docs.html#quarantine
I have recently upgraded the mail server to a new CentOS 7 server (from CentOS 6) that is doing nothing but email and DNS. The previous CentOS 6 server was also running several websites on Apache.
I'm not sure what I'm doing differently that is causing bayes to show up in the Mail Headers as a test that was run, but it appears I have Bayes fully configured. Here's how I'm doing it:
As before, I'm running Postfix with amavisd-new
being used as the primary Virus and Spam scanner. amavisd-new
then hands off to spamassassin.
Postfix is version 2.10.1 from the CentOS Plus repository, amavisd-new is version 2.10.1 from the EPEL repository, and spamassassin is version 3.4.0 from the base repository.
spamassassin's config file is as follows:
[root@mail ~]# cat /etc/mail/spamassassin/local.cf
required_hits 5
report_safe 0
rewrite_header Subject [SPAM]
razor_config /etc/mail/spamassassin/.razor/razor-agent.conf
use_bayes 1
bayes_path /var/spamassassin/bayes
bayes_file_mode 077
auto_learn 0
use_razor2 1
And now, my mail headers do indicate the bayes test is being run:
X-Virus-Scanned: amavisd-new at developcents.com
X-Spam-Flag: NO
X-Spam-Score: 5.129
X-Spam-Level: *****
X-Spam-Status: No, score=5.129 tagged_above=-999 required=6.2
tests=[BAYES_99=3.5, BAYES_999=0.2, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
DKIM_VALID_AU=-0.1, HTML_FONT_LOW_CONTRAST=0.001, HTML_MESSAGE=0.001,
MIME_HTML_ONLY=0.723, MIME_QP_LONG_LINE=0.001, RDNS_NONE=0.793,
SPF_PASS=-0.001, T_REMOTE_IMAGE=0.01, URIBL_BLOCKED=0.001]
autolearn=no autolearn_force=no
Unfortunately, I'm still trying to get a handle on the spam, as most of the messages are still coming in under the radar (with a score of 6.1 or lower), but I'm making a lot of progress.
For what it's worth, this is slightly off topic, but I recommend the following RBLs in Postfix main.cf as a part of the smtpd_recipient_restrictions
definition (note that you'll need to register before you can use a couple of these lists):
reject_rbl_client zen.spamhaus.org,
reject_rbl_client bl.spamcop.net,
reject_rbl_client b.barracudacentral.org,
reject_rbl_client dnsbl.sorbs.net,
reject_rbl_client cbl.abuseat.org,
reject_rbl_client dnsbl-1.uceprotect.net,
reject_rbl_client dnsbl-3.uceprotect.net,
Hope this helps someone.
Best Answer
Note, when using amavisd-new, it will drop non-default headers generated by SpamAssassin. To override that, you need to specify which headers amavisd should keep (eg. in
/etc/amavis/conf.d/50-user
) like this: