You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by David Galloway <dg...@redhat.com> on 2019/09/06 15:45:37 UTC

Score in subject differs from score in headers

Hi,

I'm running SpamAssassin 3.4.2 on Ubuntu 16.04 with Postfix and Mailman3.

Occasionally, SpamAssassin will rewrite a message's subject with a score
higher than what's in X-Spam-Status.  This is not a rounding issue.

For example, I'm looking at an e-mail now with "***** SPAM 5.4 *****" in
the subject but "X-Spam-Status: No, score=3.2 required=5.0"

AFAIK, there is no instance of SpamAssassin between the mail server and
me that
could have added the score to the subject.

Here is another one:
https://lists.ceph.io/hyperkitty/list/dev@ceph.io/thread/TI3K42RGVJ3ZB6O4NUPNCUWHGVHNDY53/

8.4 in the subject but "X-Spam-Status: No, score=4.9"

Here is my /etc/spamassassin/local.cf (~/.spamassassin config is not used):
rewrite_header Subject ***** SPAM _SCORE_ *****
report_safe             0
required_score          5.0
use_bayes               1
use_bayes_rules         1
bayes_auto_learn        1
skip_rbl_checks         0
use_razor2              0
use_dcc                 0
use_pyzor               0

-- 
David Galloway
Systems Administrator, RDU
Ceph Engineering
IRC: dgalloway

Re: Score in subject differs from score in headers

Posted by David Galloway <dg...@redhat.com>.
On 9/6/19 4:16 PM, Matus UHLAR - fantomas wrote:
>>>> On 9/6/2019 11:45 AM, David Galloway wrote:
>>>>> I'm running SpamAssassin 3.4.2 on Ubuntu 16.04 with Postfix and
>>>>> Mailman3.
>>>>>
>>>>> Occasionally, SpamAssassin will rewrite a message's subject with a
>>>>> score
>>>>> higher than what's in X-Spam-Status.  This is not a rounding issue.
>>>>>
>>>>> For example, I'm looking at an e-mail now with "***** SPAM 5.4
>>>>> *****" in
>>>>> the subject but "X-Spam-Status: No, score=3.2 required=5.0"
>>>>>
>>>>> AFAIK, there is no instance of SpamAssassin between the mail server
>>>>> and
>>>>> me that
>>>>> could have added the score to the subject.
> 
> On 06.09.19 16:11, David Galloway wrote:
>> I'm not crazy!
> 
>> https://lists.ceph.io/hyperkitty/list/dev@ceph.io/thread/GN3DLKWDIW2NUDO4T4MZG6E5FQEIB7NN/
>>
>>
>> 7.3 in the subject (that my SpamAssassin instance definitely set) and:
>> X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on lists.ceph.io
>> X-Spam-Level: *
>> X-Spam-Status: No, score=1.8 required=5.0
>> tests=FREEMAIL_REPLYTO_END_DIGIT,
>>     MAILING_LIST_MULTI,RCVD_IN_RP_RNBL,RDNS_NONE,SPF_HELO_NONE,
>>     SUBJ_OBFU_PUNCT_FEW,URIBL_BLOCKED autolearn=no autolearn_force=no
>>     version=3.4.2
> 
> are you sure you don't process mail two times, when delivering to list and
> when delivering to end-users (you)?
> 

Oof, that is exactly what was happening.  Which leads me to figuring out
why my mailman header filter regex isn't working.

Anyway, thanks for the help!

Re: Score in subject differs from score in headers

Posted by Matus UHLAR - fantomas <uh...@fantomas.sk>.
>>> On 9/6/2019 11:45 AM, David Galloway wrote:
>>>> I'm running SpamAssassin 3.4.2 on Ubuntu 16.04 with Postfix and Mailman3.
>>>>
>>>> Occasionally, SpamAssassin will rewrite a message's subject with a score
>>>> higher than what's in X-Spam-Status.  This is not a rounding issue.
>>>>
>>>> For example, I'm looking at an e-mail now with "***** SPAM 5.4 *****" in
>>>> the subject but "X-Spam-Status: No, score=3.2 required=5.0"
>>>>
>>>> AFAIK, there is no instance of SpamAssassin between the mail server and
>>>> me that
>>>> could have added the score to the subject.

On 06.09.19 16:11, David Galloway wrote:
>I'm not crazy!

>https://lists.ceph.io/hyperkitty/list/dev@ceph.io/thread/GN3DLKWDIW2NUDO4T4MZG6E5FQEIB7NN/
>
>7.3 in the subject (that my SpamAssassin instance definitely set) and:
>X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on lists.ceph.io
>X-Spam-Level: *
>X-Spam-Status: No, score=1.8 required=5.0 tests=FREEMAIL_REPLYTO_END_DIGIT,
>	MAILING_LIST_MULTI,RCVD_IN_RP_RNBL,RDNS_NONE,SPF_HELO_NONE,
>	SUBJ_OBFU_PUNCT_FEW,URIBL_BLOCKED autolearn=no autolearn_force=no
>	version=3.4.2

are you sure you don't process mail two times, when delivering to list and
when delivering to end-users (you)?

-- 
Matus UHLAR - fantomas, uhlar@fantomas.sk ; http://www.fantomas.sk/
Warning: I wish NOT to receive e-mail advertising to this address.
Varovanie: na tuto adresu chcem NEDOSTAVAT akukolvek reklamnu postu.
I wonder how much deeper the ocean would be without sponges.

Re: Score in subject differs from score in headers

Posted by David Galloway <dg...@redhat.com>.
On 9/6/19 12:06 PM, David Galloway wrote:
> 
> On 9/6/19 12:01 PM, Bowie Bailey wrote:
>> On 9/6/2019 11:45 AM, David Galloway wrote:
>>> Hi,
>>>
>>> I'm running SpamAssassin 3.4.2 on Ubuntu 16.04 with Postfix and Mailman3.
>>>
>>> Occasionally, SpamAssassin will rewrite a message's subject with a score
>>> higher than what's in X-Spam-Status.  This is not a rounding issue.
>>>
>>> For example, I'm looking at an e-mail now with "***** SPAM 5.4 *****" in
>>> the subject but "X-Spam-Status: No, score=3.2 required=5.0"
>>>
>>> AFAIK, there is no instance of SpamAssassin between the mail server and
>>> me that
>>> could have added the score to the subject.
>>
>> The instance of SpamAssassin that changed the subject would have been before it got
>> to your server.  Since your server does not mark the email as spam, it doesn't change
>> the subject, and so the previous markup is left there.  If your server had marked the
>> email as spam, then it would have either changed the number to be correct, or added a
>> second spam tag to the subject (depending on how smart SA's subject rewriting routine
>> is).
>>
> 
> I didn't start seeing the subjects being changed until after I enabled
> SpamAssassin on my mail server though.  I don't /think/ I'm crazy but as
> a litmus test, I just added my server's hostname to the rewrite_header
> Subject parameter and will wait for spam to come in.
> 

I'm not crazy!

https://lists.ceph.io/hyperkitty/list/dev@ceph.io/thread/GN3DLKWDIW2NUDO4T4MZG6E5FQEIB7NN/

7.3 in the subject (that my SpamAssassin instance definitely set) and:
X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on lists.ceph.io
X-Spam-Level: *
X-Spam-Status: No, score=1.8 required=5.0 tests=FREEMAIL_REPLYTO_END_DIGIT,
	MAILING_LIST_MULTI,RCVD_IN_RP_RNBL,RDNS_NONE,SPF_HELO_NONE,
	SUBJ_OBFU_PUNCT_FEW,URIBL_BLOCKED autolearn=no autolearn_force=no
	version=3.4.2

Re: Score in subject differs from score in headers

Posted by David Galloway <dg...@redhat.com>.
On 9/6/19 12:01 PM, Bowie Bailey wrote:
> On 9/6/2019 11:45 AM, David Galloway wrote:
>> Hi,
>>
>> I'm running SpamAssassin 3.4.2 on Ubuntu 16.04 with Postfix and Mailman3.
>>
>> Occasionally, SpamAssassin will rewrite a message's subject with a score
>> higher than what's in X-Spam-Status.  This is not a rounding issue.
>>
>> For example, I'm looking at an e-mail now with "***** SPAM 5.4 *****" in
>> the subject but "X-Spam-Status: No, score=3.2 required=5.0"
>>
>> AFAIK, there is no instance of SpamAssassin between the mail server and
>> me that
>> could have added the score to the subject.
> 
> The instance of SpamAssassin that changed the subject would have been before it got
> to your server.  Since your server does not mark the email as spam, it doesn't change
> the subject, and so the previous markup is left there.  If your server had marked the
> email as spam, then it would have either changed the number to be correct, or added a
> second spam tag to the subject (depending on how smart SA's subject rewriting routine
> is).
> 

I didn't start seeing the subjects being changed until after I enabled
SpamAssassin on my mail server though.  I don't /think/ I'm crazy but as
a litmus test, I just added my server's hostname to the rewrite_header
Subject parameter and will wait for spam to come in.

Re: Score in subject differs from score in headers

Posted by Bowie Bailey <Bo...@BUC.com>.
On 9/6/2019 11:45 AM, David Galloway wrote:
> Hi,
>
> I'm running SpamAssassin 3.4.2 on Ubuntu 16.04 with Postfix and Mailman3.
>
> Occasionally, SpamAssassin will rewrite a message's subject with a score
> higher than what's in X-Spam-Status.  This is not a rounding issue.
>
> For example, I'm looking at an e-mail now with "***** SPAM 5.4 *****" in
> the subject but "X-Spam-Status: No, score=3.2 required=5.0"
>
> AFAIK, there is no instance of SpamAssassin between the mail server and
> me that
> could have added the score to the subject.

The instance of SpamAssassin that changed the subject would have been before it got
to your server.  Since your server does not mark the email as spam, it doesn't change
the subject, and so the previous markup is left there.  If your server had marked the
email as spam, then it would have either changed the number to be correct, or added a
second spam tag to the subject (depending on how smart SA's subject rewriting routine
is).

-- 
Bowie

Re: Score in subject differs from score in headers

Posted by "@lbutlr" <kr...@kreme.com>.
On 6 Sep 2019, at 10:35, Riccardo Alfieri <ri...@spamteq.com> wrote:
> On 06/09/19 17:45, David Galloway wrote:
> 
>> For example, I'm looking at an e-mail now with "***** SPAM 5.4 *****" in
>> the subject but "X-Spam-Status: No, score=3.2 required=5.0"
> 
> since when does SpamAssassin also writes the scores in the subject? It's a cool feature that I probably missed completely 😃

Since forever? Nearly forever?

I used to use (Spam? _SCORE_) when I tagged subjects. I no longer do that. I do not recommend that anyone do that, it causes more trouble than it’s worth.

(I am pretty sure that is the syntax, it’s been a number of years).

As for your issue, I suspect you are double processing mail (been there, done that, have the t-shirt) and that one process is applying the higher score to the subject.



-- 
You've never heard of the Millennium Falcon?


Re: Score in subject differs from score in headers

Posted by Riccardo Alfieri <ri...@spamteq.com>.
On 06/09/19 19:36, Bill Cole wrote:

>
> Since pretty much forever, IF it is told to do so...
>
> See the documentation of 'rewrite_header' in 'perldoc 
> Mail::SpamAssassin::Conf'
>
>
Thanks for pointing that out, I never realized template tags could be 
used on the subject rewriting too.

I guess my fault was/is using SA with amavisd, that redefines subject 
rewriting in it's own way (maybe it could add scores in subject too out 
of the box? Don't know, better RTFM ;) )

-- 
Best regards,
Riccardo Alfieri

Spamhaus Technology
https://www.spamhaustech.com/


Re: Score in subject differs from score in headers

Posted by Bill Cole <sa...@billmail.scconsult.com>.
On 6 Sep 2019, at 12:35, Riccardo Alfieri wrote:

> On 06/09/19 17:45, David Galloway wrote:
>
>> For example, I'm looking at an e-mail now with "***** SPAM 5.4 *****" 
>> in
>> the subject but "X-Spam-Status: No, score=3.2 required=5.0"
>
> Hi,
>
> since when does SpamAssassin also writes the scores in the subject?

Since pretty much forever, IF it is told to do so...

See the documentation of 'rewrite_header' in 'perldoc 
Mail::SpamAssassin::Conf'

The entire 'rewrite_header' feature is generally a bad idea but people 
like it so it has survived.

> It's a cool feature that I probably missed completely :)

It's really not a cool feature. Breaking signatures is obnoxious.

-- 
Bill Cole
bill@scconsult.com or billcole@apache.org
(AKA @grumpybozo and many *@billmail.scconsult.com addresses)
Not Currently Available For Hire

Re: Score in subject differs from score in headers

Posted by Riccardo Alfieri <ri...@spamteq.com>.
On 06/09/19 17:45, David Galloway wrote:

> For example, I'm looking at an e-mail now with "***** SPAM 5.4 *****" in
> the subject but "X-Spam-Status: No, score=3.2 required=5.0"

Hi,

since when does SpamAssassin also writes the scores in the subject? It's 
a cool feature that I probably missed completely :)

-- 
Best regards,
Riccardo Alfieri

Spamhaus Technology
https://www.spamhaustech.com/


Re: Score in subject differs from score in headers

Posted by Matus UHLAR - fantomas <uh...@fantomas.sk>.
On 06.09.19 11:45, David Galloway wrote:
>I'm running SpamAssassin 3.4.2 on Ubuntu 16.04 with Postfix and Mailman3.
>
>Occasionally, SpamAssassin will rewrite a message's subject with a score
>higher than what's in X-Spam-Status.  This is not a rounding issue.
>
>For example, I'm looking at an e-mail now with "***** SPAM 5.4 *****" in
>the subject but "X-Spam-Status: No, score=3.2 required=5.0"

it's always possible that subject was there before your SA kicked in.
btw. I recommend not changing subject in SA.

>AFAIK, there is no instance of SpamAssassin between the mail server and
>me that
>could have added the score to the subject.

-- 
Matus UHLAR - fantomas, uhlar@fantomas.sk ; http://www.fantomas.sk/
Warning: I wish NOT to receive e-mail advertising to this address.
Varovanie: na tuto adresu chcem NEDOSTAVAT akukolvek reklamnu postu.
Due to unexpected conditions Windows 2000 will be released
in first quarter of year 1901