?
Solved

SpamAssassin settings

Posted on 2005-04-14
15
Medium Priority
?
1,635 Views
Last Modified: 2008-01-09
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
Comment
Question by:DennisOverskov
  • 5
  • 3
  • 2
  • +2
13 Comments
 
LVL 14

Expert Comment

by:pablouruguay
ID: 13784360
first.. what do you have in

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

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

0
 

Author Comment

by:DennisOverskov
ID: 13785494
hey......I dont have any ./procmailrc

I use debian
0
 
LVL 14

Expert Comment

by:pablouruguay
ID: 13785578
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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:DennisOverskov
ID: 13788962
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
 

Author Comment

by:DennisOverskov
ID: 13788985
hmm where did u get promail from?
I dont use promail, I use postfix
0
 
LVL 14

Expert Comment

by:pablouruguay
ID: 13791844
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
 

Author Comment

by:DennisOverskov
ID: 13796952
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
 
LVL 7

Accepted Solution

by:
macker- earned 600 total points
ID: 13830367
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
 

Expert Comment

by:danandita
ID: 13841204
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
 

Author Comment

by:DennisOverskov
ID: 13864778
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
 
LVL 7

Expert Comment

by:macker-
ID: 13869679
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
 
LVL 25

Assisted Solution

by:Cyclops3590
Cyclops3590 earned 600 total points
ID: 15468989
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
 
LVL 25

Expert Comment

by:Cyclops3590
ID: 15499652
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

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses
Course of the Month16 days, 21 hours left to enroll

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question