• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1652
  • Last Modified:

SpamAssassin settings

Hey

I have a problem with SpamAssassin (postfix, amavis)

I cant get the SpamAssassin to add the word "***spam***" into the header in a email.
And I cant lover the point (think it is 5 now) but I am not sure.

I have change my local.cf  to this (below) but that dosen change anything.

So I went into amavis.conf and you can see my settings for spamassassin below

please help me out :)


************************************************************************

required_hits           2.0

# Whether to change the subject of suspected spam

rewrite_subject         1

# Text to prepend to subject if rewrite_subject is used

subject_tag             *****SPAM*****

# Encapsulate spam in an attachment

report_safe             0

# Use terse version of the spam report

use_terse_report        0

# Enable the Bayes system

use_bayes               1

# Enable Bayes auto-learning

auto_learn              1

# Enable or disable network checks

skip_rbl_checks         0
use_razor2              1
use_dcc                 0
use_pyzor               0

# Mail using languages used in these country codes will not be marked
# as being possibly spam in a foreign language.

ok_languages            all

# Mail using locales used in these country codes will not be marked
# as being possibly spam in a foreign language.

ok_locales              all

************************************************************************


amavis.conf

################################################################

# SpamAssassin settings

# $sa_local_tests_only is passed to Mail::SpamAssassin::new as a value
# of the option local_tests_only. See Mail::SpamAssassin man page.
# If set to 1, SA tests are restricted to local tests only, i.e. no tests
# that require internet access will be performed.
#
$sa_local_tests_only = 1;   # (default: false)
#$sa_auto_whitelist = 1;    # turn on AWL (default: false)

# Timout for SpamAssassin. This is only used if spamassassin does NOT
# override it (which it often does if sa_local_tests_only is not true)
$sa_timeout = 30;           # timeout in seconds for a call to SpamAssassin
                            # (default is 30 seconds, undef disables it)

# AWL (auto whitelisting), requires spamassassin 2.44 or better
# $sa_auto_whitelist = 1;   # defaults to undef

$sa_mail_body_size_limit = 150*1024;  # don't waste time on SA is mail is larger
                            # (less than 1% of spam is > 64k)
                            # default: undef, no limitations

# default values, can be overridden by more specific lookups, e.g. SQL
@local_domains_acl = qw(.);
$sa_tag_level_deflt  = 2.0; # add spam info headers if at, or above that level
$sa_tag2_level_deflt = 6.3; # add 'spam detected' headers at that level
$sa_kill_level_deflt = $sa_tag2_level_deflt; # triggers spam evasive actions
                           # at or above that level: bounce/reject/drop,
                           # quarantine, and adding mail address extension

$sa_dsn_cutoff_level = 10;  # spam level beyond which a DSN is not sent,
                            # effectively turning D_BOUNCE into D_DISCARD;
                            # undef disables this feature and is a default;

#
# The $sa_tag_level_deflt, $sa_tag2_level_deflt and $sa_kill_level_deflt
# may also be hashrefs to hash lookup tables, to make static per-recipient
# settings possible without having to resort to SQL or LDAP lookups.

# a quick reference:
#   tag_level  controls adding the X-Spam-Status and X-Spam-Level headers,
#   tag2_level controls adding 'X-Spam-Flag: YES', and editing Subject,
#   kill_level controls 'evasive actions' (reject, quarantine, extensions);
# it only makes sense to maintain the relationship:
# tag_level <= tag2_level <= kill_level < $sa_dsn_cutoff_level

# string to prepend to Subject header field when message exceeds tag2 level
$sa_spam_subject_tag = '***SPAM*** ';   # (defaults to undef, disabled)
                             # (only seen when spam is not to be rejected
                             # and recipient is in local_domains*)

#$sa_spam_modifies_subj = 1; # may be a ref to a lookup table, default is true
# Example: modify Subject for all local recipients except user@example.com
#$sa_spam_modifies_subj = [qw( !user@example.com . )];

################################################################

0
DennisOverskov
Asked:
DennisOverskov
  • 5
  • 3
  • 2
  • +2
2 Solutions
 
pablouruguayCommented:
first.. what do you have in

/homeuser/.procmailrc  ????
is (dot)procmailrc

in the header of the message you have a spamassassin check message?

0
 
DennisOverskovAuthor Commented:
hey......I dont have any ./procmailrc

I use debian
0
 
pablouruguayCommented:
in the home directory of user????

debian redhat fedora is the same

if you dont have one create it and add this lines

MAILDIR=/var/mail
LOGFILE=$HOME/procmail.log
VERBOSE=on
:0fw
#               | spamassassin -P
| /usr/bin/spamc -f
               :0:
               * ^X-Spam-Status: Yes
/var/spool/mail/user
0
Cloud Class® Course: CompTIA Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

 
DennisOverskovAuthor Commented:
hmmm sorry, but I'm lost here.

"mail dir" <------ I use postfix/couier/mysql and have emails in usr/local/virtual/
in the virtual dir there is dirs like postmaster@domain.com, inside that dir there is a dir called new, where the emails are.

so mail dir would be =/usr/local/virtual/ ????


where shal I add the lines?  in /etc/spamassassin/local.cf?

and where should I make the .procmailrc dir?
0
 
DennisOverskovAuthor Commented:
hmm where did u get promail from?
I dont use promail, I use postfix
0
 
pablouruguayCommented:
procmail is a ADDON of sendmail, postfix et all MTA programs.

you need to add .procmailrc in the homeuser.. NOT in the local.cf
0
 
DennisOverskovAuthor Commented:
I will try to add procmail in a little while.
But one thing, why canmt I controll the point setting og spamassassin?
Where do I lower the point that spamA works after? there must be a place where a value is set.
0
 
macker-Commented:
What version of spamassassin are you using?  Newer versions have a different syntax for subject line rewriting.

Courtesy of the SpamAssassin wiki (http://wiki.apache.org/spamassassin/SubjectRewrite)

The "rewrite_subject" and "subject_tag" configuration options were deprecated and are now removed. Instead, using "rewrite_header Subject [your desired setting]". e.g.

      rewrite_subject 1

      subject_tag ****SPAM(_SCORE_)****

      becomes

            rewrite_header Subject ****SPAM(_SCORE_)****

So in your case, if you're using SpamAssassin 3.0, modify the config file to remove rewrite_subject 1 and subject_tag directives, and add:

rewrite_header Subject *****SPAM*****

(Or use the SA example to include the _SCORE_ token)

Also, check for ~/.spamassassin/user_prefs
0
 
dananditaCommented:
adding macker comments:

after you make any changes in your local.cf file, test your spamassassin configuration with command:
spamassassin --lint (-D)

regards,

Darmawan W. Anandita
0
 
DennisOverskovAuthor Commented:
hi

it still isent working, I found this line on spamassassin.apache.org

Warning: if you are running SA through amavisd or qmail-scanner, those apps do their own message rewriting and SpamAssassin cannot perform these rewrites.

I run it through amavsid.

but even though I change some settings in amaisd.conf it still dosent change anything.

it works fine (spam is deleted) but now it is just a thing that I realy want to fix.
0
 
macker-Commented:
You'll probably need to configure a prefs file for SA and/or amavisd, though I'm not sure which or where.  You may be able to modify local.cf for the rewrite_header directive.
0
 
Cyclops3590Commented:
Here's your issue.  Amavisd-new won't put the ***SPAM*** into the subject line until the email has a score of atleast 6.3
However, you have Amavisd-new also delete any email of that score as well.

So any email over 2.0 will have the status headers, but won't change the subject line.

check out this link (one of the howtos off of postfix.org)
http://flakshack.com/anti-spam/wiki/index.php?page=Installing+and+configuring+Amavisd-new

The relevant part being
$sa_tag_level_deflt = 3.0; # controls adding the X-Spam-Status and X-Spam-Level headers,
$sa_tag2_level_deflt = 6.3; # controls adding 'X-Spam-Flag: YES', and editing Subject,
$sa_kill_level_deflt = $sa_tag2_level_deflt; # triggers spam evasive actions:
0
 
Cyclops3590Commented:
One other thing to add to clarify my answer a little more is that when the spam score hits the sa_kill_level_deflt level then what happens to the email is determined by the final_spam_destiny value.  Since you didn't specify on in your amavisd.conf file, the default is D_BOUNCE.  Since you have the sa_dsn_cutoff_level set to 10, once the score gets to 10 then the email is just discarded instead of bounced.  So really, the intended recipient would never receive any email with the ***SPAM*** in the subject line because it would either be bounced or discarded.  What you need to do is either set a seperate sa_kill_level_deflt above that of sa_tag2_level_deflt or set the final_spam_destiny to D_PASS.  But then it would defeat the purpose of the kill level.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

  • 5
  • 3
  • 2
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now