You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by dave <da...@mahdtx.org> on 2014/10/24 18:17:10 UTC

rules and configuration not running correctly

Hello all

I am running Spamassassin 3.4 on an Ubuntu 14.04 build. The server installation is working as a spam\ email Gateway. It does not host mail at all, but simply forwards email to exchange server. It serves pretty much as a prefilter for exchange.

The problem with them having is that I cannot seem to get rules followed or directives followed properly. For instance, I want each email message that passes through to have a X-SPAM added to the header that shows exactly what score the email message obtained as it went through Spamassassin. Clam AV is inserting a X virus header correctly. In addition, I have specific rules as well as the sought rule set that I want followed. That's not happening at this point the rules are in the/var/lib/spamassassin/3.00400 folder but they are simply not being applied.

It would be really great to have these rules followed as we are getting such a tremendous amount of spam at the mail gateway I need to figure out how to block these things before they get into exchange. We are blocking some but there is an awful lot still getting through.

I am going to include the local CF and let's see where were going to go from there. I really need to get this resolved today as I'm being audited on Monday so any help would greatly be appreciated.


[LOCAL.CF]
# This is the right place to customize your installation of SpamAssassin.
#
# See 'perldoc Mail::SpamAssassin::Conf' for details of what can be
# tweaked.
#
# Only a small subset of options are listed below
#
###########################################################################

#   Add *****SPAM***** to the Subject header of spam e-mails
rewrite_header Subject *****SPAM*****

header LOCAL_CHARSET_BLOCKED Subject:raw =~/\=\?(koi8-r|windows-1251)\?/i
score LOCAL_CHARSET_BLOCKED 5
describe LOCAL_CHARSET_BLOCKED Contains charsets that are not acceptable

#   Save spam messages as a message/rfc822 MIME attachment instead of
#   modifying the original message (0: off, 2: use text/plain instead)
#
report_safe 0


#   Set which networks or hosts are considered 'trusted' by your mail
#   server (i.e. not spammers)
#
trusted_networks 10.173.0.0/23 10.173.4.0/24


#   Set file-locking method (flock is not safe over NFS, but is faster)
lock_method flock


#   Set the threshold at which a message is considered spam (default: 5.0)
#
required_score 4.0

#   Use Bayesian classifier (default: 1)
#
use_bayes 1


#   Bayesian classifier auto-learning (default: 1)
#
bayes_auto_learn 1

  use_bayes_rules 1

#   Set headers which may provide inappropriate cues to the Bayesian
#   classifier
#
bayes_ignore_header X-Bogosity
bayes_ignore_header X-Spam-Flag
bayes_ignore_header X-Spam-Status


#   Some shortcircuiting, if the plugin is enabled
#
ifplugin Mail::SpamAssassin::Plugin::Shortcircuit
#
#   default: strongly-whitelisted mails are *really* whitelisted now, if the
#   shortcircuiting plugin is active, causing early exit to save CPU load.
#   Uncomment to turn this on
#
# shortcircuit USER_IN_WHITELIST       on
# shortcircuit USER_IN_DEF_WHITELIST   on
# shortcircuit USER_IN_ALL_SPAM_TO     on
# shortcircuit SUBJECT_IN_WHITELIST    on

#   the opposite; blacklisted mails can also save CPU
#
# shortcircuit USER_IN_BLACKLIST       on
# shortcircuit USER_IN_BLACKLIST_TO    on
# shortcircuit SUBJECT_IN_BLACKLIST    on

#   if you have taken the time to correctly specify your "trusted_networks",
#   this is another good way to save CPU
#
shortcircuit ALL_TRUSTED             on

#   and a well-trained bayes DB can save running rules, too
#
# shortcircuit BAYES_99                spam
# shortcircuit BAYES_00                ham


endif # Mail::SpamAssassin::Plugin::Shortcircuit



body lcl_BODY_05 /(facelift|face lift)/i
score lcl_BODY_05 0.5

body lcl_BODY_30 /(Public Records Now Available|Hollywood celebrity|Celeb Gossip|auto warranty|Pet stores are so -overpriced|monthly AutoInsurance payments were just-reduced|Dealers have teamed up and are offering a special Clearance
|Score-Report Team|Score Report Team|Your Pre-Approved Card|weight gain|no workout needed|lose weight rapidly)/i
score lcl_BODY_30 3.0

header lcl_SUBJECT_30 Subject =~ /(Belly Bulge|Restore Vision loss|Look Years-Younger|Someone has run a background|background-check on you|background check on you)/i
score lcl_SUBJECT_30 3.0

body lcl_BODY_35 /(Ondemand Research|\bICANCiANCg==\b)/i
score lcl_BODY_35 3.5

header lcl_SUBJECT_35 Subject =~ /(slim-fast|Home Depot Replacement Windows|Cigars|Satellite Internet|High Speed Internet)/i
score lcl_SUBJECT_35 3.5

header lcl_FROM_35 From =~ /spammer/i
score lcl_FROM_35 3.5

body lcl_BODY_40 /(losing( |-)pound|Transform Your Body|melt fat|melt away fat|melting fat|need cash fast|free profit|Profit Maker|easy trick to save you|To YOUR Success|per day part-time|weird food|never eat this food|DocOz|Doc Oz|D
rOz|Dr Oz|Dr. Oz|Dr-Oz)/i
score lcl_BODY_40 7.0

header lcl_SUBJECT_40 Subject =~ /(DocOz|Doc Oz|DrOz|Dr Oz|Dr. Oz|Dr-Oz)/i
score lcl_SUBJECT_40 7.0

body lcl_BODY_45 /dirty little/i
score lcl_BODY_45 4.5

body lcl_BODY_50 /(ashleymadison|ashley madison|eHarmony|Fountain of Youth)/i
score lcl_BODY_50 5.0

header lcl_FROM_50 From =~ /(ashleymadison|ashley madison|eHarmony)/i
score lcl_FROM_50 5.0

body HARP_RULE /\HARP_v2.0\b/i
score HARP_RULE 9.0

rewrite_header subject [probable spam]
dns_available yes
required_score 4.0
blacklist_from USPS_Shipping_Services@usps.com
blacklist_from USPS_Shipping_Info@usps.com
blacklist_from reservations@myusairways.com
# user_scores_dsn
# SpamAssassin TextCat (Language Guesser Plugin)
# http://spamassassin.apache.org/full/3.3.x/doc/Mail_SpamAssassin_Plugin_TextCat.html
ok_languages en  # I can't understand anything else than  english
inactive_languages '' # Enable all languages
score UNWANTED_LANGUAGE_BODY 7 # Increase score
add_header all Languages _LANGUAGES_  # Write the detected langs in X-Spam-Languages
#dcc
use_dcc 1
dcc_path /usr/local/bin/dccproc

#pyzor
use_pyzor 1
pyzor_path /usr/bin/pyzor

#razor
use_razor2 1
razor_config /etc/razor/razor-agent.conf



thanks
dave

RE: rules and configuration not running correctly

Posted by dave <da...@mahdtx.org>.
Still no go ... I just sent this to myself--X-virus gets added X-Spam does not

Received: from mailgate.example.org (x.x.x.1) by exchangeserver.example.org
 (x.x.x.2) with Microsoft SMTP Server id 14.1.438.0; Fri, 24 Oct 2014
 11:38:31 -0500
Received: from localhost (mailgate.example.org [127.0.0.1])	by
 mailgate.example.org (Postfix) with ESMTP id 13CEC5D4167	for
 <me...@example.org>; Fri, 24 Oct 2014 11:39:35 -0500 (CDT)
X-Virus-Scanned: Debian amavisd-new at mailgate.example.org
Received: from mailgate.example.org ([127.0.0.1])	by localhost

-----Original Message-----
From: Axb [mailto:axb.lists@gmail.com] 
Sent: Friday, October 24, 2014 11:27 AM
To: users@spamassassin.apache.org
Subject: Re: rules and configuration not running correctly

On 10/24/2014 06:17 PM, dave wrote:
> Hello all
>
> I am running Spamassassin 3.4 on an Ubuntu 14.04 build. The server installation is working as a spam\ email Gateway. It does not host mail at all, but simply forwards email to exchange server. It serves pretty much as a prefilter for exchange.
>
> The problem with them having is that I cannot seem to get rules followed or directives followed properly. For instance, I want each email message that passes through to have a X-SPAM added to the header that shows exactly what score the email message obtained as it went through Spamassassin. Clam AV is inserting a X virus header correctly. In addition, I have specific rules as well as the sought rule set that I want followed. That's not happening at this point the rules are in the/var/lib/spamassassin/3.00400 folder but they are simply not being applied.
>
> It would be really great to have these rules followed as we are getting such a tremendous amount of spam at the mail gateway I need to figure out how to block these things before they get into exchange. We are blocking some but there is an awful lot still getting through.
>
> I am going to include the local CF and let's see where were going to go from there. I really need to get this resolved today as I'm being audited on Monday so any help would greatly be appreciated.
>
>
> [LOCAL.CF]

<huge-snip>

___________

you have two "rewrite_header" directives... only one will be applied..

Not quite sure if it's what you want, but try adding, in local.cf

add_header all Report _REPORT_

and restart spamd or whatever glue you're using to interface to SA




RE: rules and configuration not running correctly

Posted by David B Funk <db...@engineering.uiowa.edu>.
Two things, are you using
1) "amavis" (OLD original)
2) "amavis-new"
3) "amavis-ng"

If "amavis-new" are you managing -its- config files, NOT 'spamd's config files?
Please look at the docs for "amavis-new", it instanciates its own SA instance
within its perl damon, it does not use 'spamd'.

If you do have a spamd instance running on that box, "amavis-new" will ignore 
it.

This sounds much more like a "amavis-new" issue, check their docs & maillist.

Dave

On Sat, 25 Oct 2014, dave wrote:

> Anyone have any ideas??
>
> -----Original Message-----
> From: dave
> Sent: Friday, October 24, 2014 11:51 AM
> To: users@spamassassin.apache.org >> SA Mailing list
> Subject: RE: rules and configuration not running correctly
>
> (Sorry about the list thing realized after sending) It is launched from amavis
>
> -----Original Message-----
> From: Axb [mailto:axb.lists@gmail.com]
> Sent: Friday, October 24, 2014 11:42 AM
> To: users@spamassassin.apache.org >> SA Mailing list
> Subject: Re: rules and configuration not running correctly
>
> On 10/24/2014 06:34 PM, dave wrote:
>> Thanks... I am looking to have x-spam status and associated scores
>> added to the headers of all messages ... also my custom  and sought
>> rules do not seem to fire
>
>
> Please keep list mail on the list.
>
>
> - How are you using SA?
> (pls specify: amavis, MIMEDefang, a milter, Mailscanner, procmail, Fuglu, etc, etc)
>
>
>
>> -----Original Message----- From: Axb [mailto:axb.lists@gmail.com]
>> Sent: Friday, October 24, 2014 11:27 AM To:
>> users@spamassassin.apache.org Subject: Re: rules and configuration not
>> running correctly
>>
>> On 10/24/2014 06:17 PM, dave wrote:
>>> Hello all
>>>
>>> I am running Spamassassin 3.4 on an Ubuntu 14.04 build. The server
>>> installation is working as a spam\ email Gateway. It does not host
>>> mail at all, but simply forwards email to exchange server. It serves
>>> pretty much as a prefilter for exchange.
>>>
>>> The problem with them having is that I cannot seem to get rules
>>> followed or directives followed properly. For instance, I want each
>>> email message that passes through to have a X-SPAM added to the
>>> header that shows exactly what score the email message obtained as it
>>> went through Spamassassin. Clam AV is inserting a X virus header
>>> correctly. In addition, I have specific rules as well as the sought
>>> rule set that I want followed. That's not happening at this point the
>>> rules are in the/var/lib/spamassassin/3.00400 folder but they are
>>> simply not being applied.
>>>
>>> It would be really great to have these rules followed as we are
>>> getting such a tremendous amount of spam at the mail gateway I need
>>> to figure out how to block these things before they get into
>>> exchange. We are blocking some but there is an awful lot still
>>> getting through.
>>>
>>> I am going to include the local CF and let's see where were going to
>>> go from there. I really need to get this resolved today as I'm being
>>> audited on Monday so any help would greatly be appreciated.
>>>
>>>
>>> [LOCAL.CF]
>>
>> <huge-snip>
>>
>> ___________
>>
>> you have two "rewrite_header" directives... only one will be applied..
>>
>> Not quite sure if it's what you want, but try adding, in local.cf
>>
>> add_header all Report _REPORT_
>>
>> and restart spamd or whatever glue you're using to interface to SA
>>
>>
>>
>
>

-- 
Dave Funk                                  University of Iowa
<dbfunk (at) engineering.uiowa.edu>        College of Engineering
319/335-5751   FAX: 319/384-0549           1256 Seamans Center
Sys_admin/Postmaster/cell_admin            Iowa City, IA 52242-1527
#include <std_disclaimer.h>
Better is not better, 'standard' is better. B{

RE: rules and configuration not running correctly

Posted by dave <da...@mahdtx.org>.
Anyone have any ideas??

-----Original Message-----
From: dave 
Sent: Friday, October 24, 2014 11:51 AM
To: users@spamassassin.apache.org >> SA Mailing list
Subject: RE: rules and configuration not running correctly

(Sorry about the list thing realized after sending) It is launched from amavis

-----Original Message-----
From: Axb [mailto:axb.lists@gmail.com]
Sent: Friday, October 24, 2014 11:42 AM
To: users@spamassassin.apache.org >> SA Mailing list
Subject: Re: rules and configuration not running correctly

On 10/24/2014 06:34 PM, dave wrote:
> Thanks... I am looking to have x-spam status and associated scores 
> added to the headers of all messages ... also my custom  and sought 
> rules do not seem to fire


Please keep list mail on the list.


- How are you using SA?
(pls specify: amavis, MIMEDefang, a milter, Mailscanner, procmail, Fuglu, etc, etc)



> -----Original Message----- From: Axb [mailto:axb.lists@gmail.com]
> Sent: Friday, October 24, 2014 11:27 AM To:
> users@spamassassin.apache.org Subject: Re: rules and configuration not 
> running correctly
>
> On 10/24/2014 06:17 PM, dave wrote:
>> Hello all
>>
>> I am running Spamassassin 3.4 on an Ubuntu 14.04 build. The server 
>> installation is working as a spam\ email Gateway. It does not host 
>> mail at all, but simply forwards email to exchange server. It serves 
>> pretty much as a prefilter for exchange.
>>
>> The problem with them having is that I cannot seem to get rules 
>> followed or directives followed properly. For instance, I want each 
>> email message that passes through to have a X-SPAM added to the 
>> header that shows exactly what score the email message obtained as it 
>> went through Spamassassin. Clam AV is inserting a X virus header 
>> correctly. In addition, I have specific rules as well as the sought 
>> rule set that I want followed. That's not happening at this point the 
>> rules are in the/var/lib/spamassassin/3.00400 folder but they are 
>> simply not being applied.
>>
>> It would be really great to have these rules followed as we are 
>> getting such a tremendous amount of spam at the mail gateway I need 
>> to figure out how to block these things before they get into 
>> exchange. We are blocking some but there is an awful lot still 
>> getting through.
>>
>> I am going to include the local CF and let's see where were going to 
>> go from there. I really need to get this resolved today as I'm being 
>> audited on Monday so any help would greatly be appreciated.
>>
>>
>> [LOCAL.CF]
>
> <huge-snip>
>
> ___________
>
> you have two "rewrite_header" directives... only one will be applied..
>
> Not quite sure if it's what you want, but try adding, in local.cf
>
> add_header all Report _REPORT_
>
> and restart spamd or whatever glue you're using to interface to SA
>
>
>


RE: rules and configuration not running correctly

Posted by dave <da...@mahdtx.org>.
(Sorry about the list thing realized after sending) 
It is launched from amavis

-----Original Message-----
From: Axb [mailto:axb.lists@gmail.com] 
Sent: Friday, October 24, 2014 11:42 AM
To: users@spamassassin.apache.org >> SA Mailing list
Subject: Re: rules and configuration not running correctly

On 10/24/2014 06:34 PM, dave wrote:
> Thanks... I am looking to have x-spam status and associated scores 
> added to the headers of all messages ... also my custom  and sought 
> rules do not seem to fire


Please keep list mail on the list.


- How are you using SA?
(pls specify: amavis, MIMEDefang, a milter, Mailscanner, procmail, Fuglu, etc, etc)



> -----Original Message----- From: Axb [mailto:axb.lists@gmail.com]
> Sent: Friday, October 24, 2014 11:27 AM To:
> users@spamassassin.apache.org Subject: Re: rules and configuration
> not running correctly
>
> On 10/24/2014 06:17 PM, dave wrote:
>> Hello all
>>
>> I am running Spamassassin 3.4 on an Ubuntu 14.04 build. The server
>> installation is working as a spam\ email Gateway. It does not host
>> mail at all, but simply forwards email to exchange server. It
>> serves pretty much as a prefilter for exchange.
>>
>> The problem with them having is that I cannot seem to get rules
>> followed or directives followed properly. For instance, I want each
>> email message that passes through to have a X-SPAM added to the
>> header that shows exactly what score the email message obtained as
>> it went through Spamassassin. Clam AV is inserting a X virus header
>> correctly. In addition, I have specific rules as well as the sought
>> rule set that I want followed. That's not happening at this point
>> the rules are in the/var/lib/spamassassin/3.00400 folder but they
>> are simply not being applied.
>>
>> It would be really great to have these rules followed as we are
>> getting such a tremendous amount of spam at the mail gateway I need
>> to figure out how to block these things before they get into
>> exchange. We are blocking some but there is an awful lot still
>> getting through.
>>
>> I am going to include the local CF and let's see where were going
>> to go from there. I really need to get this resolved today as I'm
>> being audited on Monday so any help would greatly be appreciated.
>>
>>
>> [LOCAL.CF]
>
> <huge-snip>
>
> ___________
>
> you have two "rewrite_header" directives... only one will be
> applied..
>
> Not quite sure if it's what you want, but try adding, in local.cf
>
> add_header all Report _REPORT_
>
> and restart spamd or whatever glue you're using to interface to SA
>
>
>


Re: rules and configuration not running correctly

Posted by Axb <ax...@gmail.com>.
On 10/24/2014 06:34 PM, dave wrote:
> Thanks... I am looking to have x-spam status and associated scores
> added to the headers of all messages ... also my custom  and sought
> rules do not seem to fire


Please keep list mail on the list.


- How are you using SA?
(pls specify: amavis, MIMEDefang, a milter, Mailscanner, procmail, 
Fuglu, etc, etc)



> -----Original Message----- From: Axb [mailto:axb.lists@gmail.com]
> Sent: Friday, October 24, 2014 11:27 AM To:
> users@spamassassin.apache.org Subject: Re: rules and configuration
> not running correctly
>
> On 10/24/2014 06:17 PM, dave wrote:
>> Hello all
>>
>> I am running Spamassassin 3.4 on an Ubuntu 14.04 build. The server
>> installation is working as a spam\ email Gateway. It does not host
>> mail at all, but simply forwards email to exchange server. It
>> serves pretty much as a prefilter for exchange.
>>
>> The problem with them having is that I cannot seem to get rules
>> followed or directives followed properly. For instance, I want each
>> email message that passes through to have a X-SPAM added to the
>> header that shows exactly what score the email message obtained as
>> it went through Spamassassin. Clam AV is inserting a X virus header
>> correctly. In addition, I have specific rules as well as the sought
>> rule set that I want followed. That's not happening at this point
>> the rules are in the/var/lib/spamassassin/3.00400 folder but they
>> are simply not being applied.
>>
>> It would be really great to have these rules followed as we are
>> getting such a tremendous amount of spam at the mail gateway I need
>> to figure out how to block these things before they get into
>> exchange. We are blocking some but there is an awful lot still
>> getting through.
>>
>> I am going to include the local CF and let's see where were going
>> to go from there. I really need to get this resolved today as I'm
>> being audited on Monday so any help would greatly be appreciated.
>>
>>
>> [LOCAL.CF]
>
> <huge-snip>
>
> ___________
>
> you have two "rewrite_header" directives... only one will be
> applied..
>
> Not quite sure if it's what you want, but try adding, in local.cf
>
> add_header all Report _REPORT_
>
> and restart spamd or whatever glue you're using to interface to SA
>
>
>


Re: rules and configuration not running correctly

Posted by Axb <ax...@gmail.com>.
On 10/24/2014 06:17 PM, dave wrote:
> Hello all
>
> I am running Spamassassin 3.4 on an Ubuntu 14.04 build. The server installation is working as a spam\ email Gateway. It does not host mail at all, but simply forwards email to exchange server. It serves pretty much as a prefilter for exchange.
>
> The problem with them having is that I cannot seem to get rules followed or directives followed properly. For instance, I want each email message that passes through to have a X-SPAM added to the header that shows exactly what score the email message obtained as it went through Spamassassin. Clam AV is inserting a X virus header correctly. In addition, I have specific rules as well as the sought rule set that I want followed. That's not happening at this point the rules are in the/var/lib/spamassassin/3.00400 folder but they are simply not being applied.
>
> It would be really great to have these rules followed as we are getting such a tremendous amount of spam at the mail gateway I need to figure out how to block these things before they get into exchange. We are blocking some but there is an awful lot still getting through.
>
> I am going to include the local CF and let's see where were going to go from there. I really need to get this resolved today as I'm being audited on Monday so any help would greatly be appreciated.
>
>
> [LOCAL.CF]

<huge-snip>

___________

you have two "rewrite_header" directives... only one will be applied..

Not quite sure if it's what you want, but try adding, in local.cf

add_header all Report _REPORT_

and restart spamd or whatever glue you're using to interface to SA