You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by postgarage Graz IT <it...@postgarage.at> on 2024/06/03 05:26:31 UTC

Lots of FN because of VALIDITY* rules

Hello!

Debian 12.5
SpamAssassin version 4.0.0
   running on Perl version 5.36.0

Server setup with iRedMail


A few days ago a lot of false negatives landed in our inboxes. As it 
turned out the reason was that the for nearly all mails the 
RCVD_IN_VALIDITY_CERTIFIED and RCVD_IN_VALIDITY_SAFE rules matched.

I now know that validity introduced a query limit which we hit, because 
I have to admit, I wasn't aware that I shouldn't use public DNS 
resolvers for blacklists and therefore we got "Excessive Number of 
Queries" answers. I also found this patch 
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=8244 which introduces 
new rules addressing the query limit.

Those *BLOCKED rules where never applied because our spamassassin 
received an updated rule-set which was saved to 
/var/lib/spamassassin/4.000000/updates_spamassassin_org/ but never 
received an update for the active.list file located in 
/usr/share/spamassassin/
After I manually added the changes from the above mentioned patch to the 
active.list file it started to work.

Now for my questions:
*) as is stated in active.list it should not be edited. What's the 
correct place to add the new rules to activate them? local.cf?
*) If I understand it correctly
/var/lib/spamassassin/4.000000/updates_spamassassin_org/ is updated by 
the SA update mechanism but it's the Linux distribution's responsibility 
to update /var/lib/spamassassin? In that case should I fill a Debian 
bug? Or should the SA updates also include the file active.list?

Thanks and best regards
Flo

Re: Lots of FN because of VALIDITY* rules

Posted by postgarage Graz IT <it...@postgarage.at>.
Thanks for your help. I tried to reproduce the problem by reverting my 
changes to investigate it further with my newly learned knowledge, but 
now it works as intended, even when I get an "Excessive Queries" response.
IDK, perhaps the problem was something else and I "fixed" it by coincidence…

Anyway, thank you all.

On 6/3/24 14:52, Bill Cole wrote:
> On 2024-06-03 at 08:35:32 UTC-0400 (Mon, 3 Jun 2024 14:35:32 +0200)
> postgarage Graz IT <it...@postgarage.at>
> is rumored to have said:
> 
>> I think that the active.list file should be updated, when there are 
>> new rules, shouldn't it?
> 
> It is updated where it is actually used, on the ASF rule maintenance 
> system. It is irrelevant to an operational deployment.
> 
> I have no idea why Debian installs that file at all.
> 

Re: Lots of FN because of VALIDITY* rules

Posted by postgarage Graz IT <it...@postgarage.at>.

On 6/5/24 13:14, Matus UHLAR - fantomas wrote:
>>>>> On 2024-06-03 at 08:35:32 UTC-0400 (Mon, 3 Jun 2024 14:35:32 +0200)
>>>>> postgarage Graz IT <it...@postgarage.at>
>>>>> is rumored to have said:
>>>>>> I think that the active.list file should be updated, when there 
>>>>>> are new rules, shouldn't it?
>>>>
>>>> On 03.06.24 08:52, Bill Cole wrote:
>>>>> It is updated where it is actually used, on the ASF rule 
>>>>> maintenance system. It is irrelevant to an operational deployment.
>>>>>
>>>>> I have no idea why Debian installs that file at all.
> 
>>> On 6/5/24 09:17, Matus UHLAR - fantomas wrote:
>>>> It does not, I guess that the OP did because of misunderstanding of 
>>>> what it does.
> 
>> On 6/5/24 11:14, postgarage Graz IT wrote:
>>> No I didn't. Please have a look at 
>>> https://packages.debian.org/bookworm/all/spamassassin/filelist where 
>>> you can clearly see, that it is included in Debian's SA package.
> 
> yes, /usr/share/spamassassin/active.list is included, but there's none 
> in /var/lib/spamassassin/

Yes, that's what I meant. Sorry for the confusion.

> 
> As was already mentioned, it's not used by default.
> there was apparently come confusion what's in /var/lib/spamassassin/ on 
> Debian
> 
> 
>>>> I can only guess that the rules were not fresh enough or OP 
>>>> installed obsolete/invalid rules there.
>>>
>>> The first thing I did was to check if the updates worked (they did) 
>>> neither did I install any rules myself.
> 
> On 05.06.24 12:38, postgarage Graz IT wrote:
>> OK, after having a second look, I take that claim back. It might be 
>> that I ran sa-update by manually myself (which works) but maybe does 
>> not run automatically.
> 
> you should run this as user debian-spamd, or let cron handle that. 
> Otherwise, you will create files cron will be unable to overwrite, which 
> may also cause problems (and may have caused yours)
> 
> drwxr-xr-x 5 debian-spamd debian-spamd 4096 Nov 27  2023 
> /var/lib/spamassassin/
> drwxr-xr-x 3 debian-spamd debian-spamd 4096 Jun  4 02:32 
> /var/lib/spamassassin/4.000000//
> drwxr-xr-x 2 debian-spamd debian-spamd 4096 Jun  4 02:32 
> /var/lib/spamassassin/4.000000/updates_spamassassin_org/
> 
> 
> you can also run "chown -R debian-spamd: /var/lib/spamassassin/" to fix it.

Ah, thanks a lot, I'm an idot. That's quite obvious.

> 
> 
> 

Re: Lots of FN because of VALIDITY* rules

Posted by Matus UHLAR - fantomas <uh...@fantomas.sk>.
>>>>On 2024-06-03 at 08:35:32 UTC-0400 (Mon, 3 Jun 2024 14:35:32 +0200)
>>>>postgarage Graz IT <it...@postgarage.at>
>>>>is rumored to have said:
>>>>>I think that the active.list file should be updated, when 
>>>>>there are new rules, shouldn't it?
>>>
>>>On 03.06.24 08:52, Bill Cole wrote:
>>>>It is updated where it is actually used, on the ASF rule 
>>>>maintenance system. It is irrelevant to an operational 
>>>>deployment.
>>>>
>>>>I have no idea why Debian installs that file at all.

>>On 6/5/24 09:17, Matus UHLAR - fantomas wrote:
>>>It does not, I guess that the OP did because of misunderstanding 
>>>of what it does.

>On 6/5/24 11:14, postgarage Graz IT wrote:
>>No I didn't. Please have a look at 
>>https://packages.debian.org/bookworm/all/spamassassin/filelist where 
>>you can clearly see, that it is included in Debian's SA package.

yes, /usr/share/spamassassin/active.list is included, but there's none in 
/var/lib/spamassassin/

As was already mentioned, it's not used by default.
there was apparently come confusion what's in /var/lib/spamassassin/ on 
Debian


>>>I can only guess that the rules were not fresh enough or OP 
>>>installed obsolete/invalid rules there.
>>
>>The first thing I did was to check if the updates worked (they did) 
>>neither did I install any rules myself.

On 05.06.24 12:38, postgarage Graz IT wrote:
>OK, after having a second look, I take that claim back. It might be 
>that I ran sa-update by manually myself (which works) but maybe does 
>not run automatically.

you should run this as user debian-spamd, or let cron handle that. 
Otherwise, you will create files cron will be unable to overwrite, which may 
also cause problems (and may have caused yours)

drwxr-xr-x 5 debian-spamd debian-spamd 4096 Nov 27  2023 /var/lib/spamassassin/
drwxr-xr-x 3 debian-spamd debian-spamd 4096 Jun  4 02:32 /var/lib/spamassassin/4.000000//
drwxr-xr-x 2 debian-spamd debian-spamd 4096 Jun  4 02:32 /var/lib/spamassassin/4.000000/updates_spamassassin_org/


you can also run "chown -R debian-spamd: /var/lib/spamassassin/" to fix it.



-- 
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.
Linux IS user friendly, it's just selective who its friends are...

Re: Lots of FN because of VALIDITY* rules

Posted by postgarage Graz IT <it...@postgarage.at>.

On 6/5/24 11:14, postgarage Graz IT wrote:
> 
> 
> On 6/5/24 09:17, Matus UHLAR - fantomas wrote:
>>> On 2024-06-03 at 08:35:32 UTC-0400 (Mon, 3 Jun 2024 14:35:32 +0200)
>>> postgarage Graz IT <it...@postgarage.at>
>>> is rumored to have said:
>>>> I think that the active.list file should be updated, when there are 
>>>> new rules, shouldn't it?
>>
>> On 03.06.24 08:52, Bill Cole wrote:
>>> It is updated where it is actually used, on the ASF rule maintenance 
>>> system. It is irrelevant to an operational deployment.
>>>
>>> I have no idea why Debian installs that file at all.
>>
>> It does not, I guess that the OP did because of misunderstanding of 
>> what it does.
> 
> No I didn't. Please have a look at 
> https://packages.debian.org/bookworm/all/spamassassin/filelist where you 
> can clearly see, that it is included in Debian's SA package.
> 
>>
>> I can only guess that the rules were not fresh enough or OP installed 
>> obsolete/invalid rules there.
> 
> The first thing I did was to check if the updates worked (they did) 
> neither did I install any rules myself.

OK, after having a second look, I take that claim back. It might be that 
I ran sa-update by manually myself (which works) but maybe does not run 
automatically.

> 
>>

Re: Lots of FN because of VALIDITY* rules

Posted by postgarage Graz IT <it...@postgarage.at>.

On 6/5/24 09:17, Matus UHLAR - fantomas wrote:
>> On 2024-06-03 at 08:35:32 UTC-0400 (Mon, 3 Jun 2024 14:35:32 +0200)
>> postgarage Graz IT <it...@postgarage.at>
>> is rumored to have said:
>>> I think that the active.list file should be updated, when there are 
>>> new rules, shouldn't it?
> 
> On 03.06.24 08:52, Bill Cole wrote:
>> It is updated where it is actually used, on the ASF rule maintenance 
>> system. It is irrelevant to an operational deployment.
>>
>> I have no idea why Debian installs that file at all.
> 
> It does not, I guess that the OP did because of misunderstanding of what 
> it does.

No I didn't. Please have a look at 
https://packages.debian.org/bookworm/all/spamassassin/filelist where you 
can clearly see, that it is included in Debian's SA package.

> 
> I can only guess that the rules were not fresh enough or OP installed 
> obsolete/invalid rules there.

The first thing I did was to check if the updates worked (they did) 
neither did I install any rules myself.

> 

Re: Lots of FN because of VALIDITY* rules

Posted by Matus UHLAR - fantomas <uh...@fantomas.sk>.
>On 2024-06-03 at 08:35:32 UTC-0400 (Mon, 3 Jun 2024 14:35:32 +0200)
>postgarage Graz IT <it...@postgarage.at>
>is rumored to have said:
>>I think that the active.list file should be updated, when there are 
>>new rules, shouldn't it?

On 03.06.24 08:52, Bill Cole wrote:
>It is updated where it is actually used, on the ASF rule maintenance 
>system. It is irrelevant to an operational deployment.
>
>I have no idea why Debian installs that file at all.

It does not, I guess that the OP did because of misunderstanding of what it 
does.

I can only guess that the rules were not fresh enough or OP installed 
obsolete/invalid rules there.

-- 
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.
The only substitute for good manners is fast reflexes.

Re: Lots of FN because of VALIDITY* rules

Posted by Bill Cole <sa...@billmail.scconsult.com>.
On 2024-06-03 at 08:35:32 UTC-0400 (Mon, 3 Jun 2024 14:35:32 +0200)
postgarage Graz IT <it...@postgarage.at>
is rumored to have said:

> I think that the active.list file should be updated, when there are 
> new rules, shouldn't it?

It is updated where it is actually used, on the ASF rule maintenance 
system. It is irrelevant to an operational deployment.

I have no idea why Debian installs that file at all.

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

Re: Lots of FN because of VALIDITY* rules

Posted by postgarage Graz IT <it...@postgarage.at>.

On 6/3/24 12:02, Matus UHLAR - fantomas wrote:
 > On 03.06.24 07:26, postgarage Graz IT wrote:
 >> A few days ago a lot of false negatives landed in our inboxes. As it
 >> turned out the reason was that the for nearly all mails the
 >> RCVD_IN_VALIDITY_CERTIFIED and RCVD_IN_VALIDITY_SAFE rules matched.
 >>
 >> I now know that validity introduced a query limit which we hit,
 >> because I have to admit, I wasn't aware that I shouldn't use public
 >> DNS resolvers for blacklists
 >
 > I'd say you should not use public DNS resolvers with mailserver.

Thanks. I know that by now and already set up a local DNS resolver. But 
that's not been the problem.

 >> and therefore we got "Excessive Number of Queries" answers. I also
 >> found this patch
 >> https://bz.apache.org/SpamAssassin/show_bug.cgi?id=8244 which
 >> introduces new rules addressing the query limit.
 >
 > my current rules show that all RCVD_IN_VALIDITY_* rules check for 
blocked.

The rules were here. The issue was, that they weren't active, as the 
were missing from the active.list file. There's no active.list under 
/var/lib/spamassassin/4.000000/updates_spamassassin_org/. There's  only 
one in /usr/share/spamassassin/, which is provided by the debian 
package. But within that file the new *BLOCKED rules aren't activated.

So the situation was:
*) The updated *VALIDITY* rules were active
*) the new *VALIDITY*BLOCKED rules weren't active

Which lead to almost every mail passing the spamfilter, as for every 
"Excessive Number of Queries" answer from validity 
RCVD_IN_VALIDITY_CERTIFIED and RCVD_IN_VALIDITY_SAFE counted with -5 to 
the score.

AFTER I manually added the *BLOCKED rules to 
/usr/share/spamassassin/active.list I get the correct results
RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, 
RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001,

I think that the active.list file should be updated, when there are new 
rules, shouldn't it?


 >> Those *BLOCKED rules where never applied because our spamassassin
 >> received an updated rule-set which was saved to
 >> /var/lib/spamassassin/4.000000/updates_spamassassin_org/ but never
 >> received an update for the active.list file located in
 >> /usr/share/spamassassin/
 >
 >> After I manually added the changes from the above mentioned patch to
 >> the active.list file it started to work.
 >>
 >> Now for my questions:
 >> *) as is stated in active.list it should not be edited. What's the
 >> correct place to add the new rules to activate them? local.cf?
 >
 > you can use dns_query_restriction to restrict which DNS lists to query.
 >
 > further, you can tune uridnsbl_skip_domain to avoid lookups for domains
 > in URI* lists.
 >
 >> *) If I understand it correctly
 >> /var/lib/spamassassin/4.000000/updates_spamassassin_org/ is updated by
 >> the SA update mechanism but it's the Linux distribution's
 >> responsibility to update /var/lib/spamassassin? In that case should I

Sorry, that's a mistake by my side, should have been 
/usr/share/spamassassin/

 >> fill a Debian bug? Or should the SA updates also include the file
 >> active.list?
 >
 > reload spamd or amavis, the rules in /var/lib/spamassassin/ are used by
 > default.
 >
 > Maybe you need to enable cron job by setting CRON=1 in
 > /etc/default/spamassassin and it will happen automatically.
 >
 > ...I have no idea how active.list works.
 >
 >

Re: Lots of FN because of VALIDITY* rules

Posted by "Anne P. Mitchell, Esq." <am...@isipp.com>.

> On Jun 3, 2024, at 4:09 AM, Matus UHLAR - fantomas <uh...@fantomas.sk> wrote:
> 
> I forgot to add that I have "lowered" (increased to small negative number) scores for RCVD_IN_VALIDITY_*, RCVD_IN_DNSWL_* and RCVD_IN_IADB_*
> because I has similar bad experience with them.

Matus, if you EVER have a bad experience with RCVD_IN_IADB_ (or any other IADB test), *please* let me personally know asap. We take our responsibility to the receiving industry *very* seriously (always have, for more than 20 years now) - that's *why* we invented the data response code concept, and developed it specifically so that SA could take advantage of it (and didn't patent it so that others could use the concept to, again, assist receivers).  So, *please*, again, let me know personally, directly, if you ever find an issue with a certified sender (that is who would trigger the IADB tests) not doing the right thing!

Thank you,

Anne

--- 
Anne P. Mitchell, Esq.
Internet Law & Policy Attorney
CEO Institute for Social Internet Public Policy (ISIPP)
Author: Section 6 of the CAN-SPAM Act of 2003 (the Federal email marketing law)
Creator of the term 'deliverability' and founder of the deliverability industry
Author: The Email Deliverability Handbook
Board of Directors, Denver Internet Exchange
Dean Emeritus, Cyberlaw & Cybersecurity, Lincoln Law School
Prof. Emeritus, Lincoln Law School
Chair Emeritus, Asilomar Microcomputer Workshop
Counsel Emeritus, eMail Abuse Prevention System (MAPS)


Re: Lots of FN because of VALIDITY* rules

Posted by Matus UHLAR - fantomas <uh...@fantomas.sk>.
On 03.06.24 12:02, Matus UHLAR - fantomas wrote:
>On 03.06.24 07:26, postgarage Graz IT wrote:
>>A few days ago a lot of false negatives landed in our inboxes. As it 
>>turned out the reason was that the for nearly all mails the 
>>RCVD_IN_VALIDITY_CERTIFIED and RCVD_IN_VALIDITY_SAFE rules matched.

I forgot to add that I have "lowered" (increased to small negative number) 
scores for RCVD_IN_VALIDITY_*, RCVD_IN_DNSWL_* and RCVD_IN_IADB_*
because I has similar bad experience with them.

>>I now know that validity introduced a query limit which we hit, 
>>because I have to admit, I wasn't aware that I shouldn't use public 
>>DNS resolvers for blacklists
>
>I'd say you should not use public DNS resolvers with mailserver.
>
>>and therefore we got "Excessive Number of Queries" answers. I also 
>>found this patch 
>>https://bz.apache.org/SpamAssassin/show_bug.cgi?id=8244 which 
>>introduces new rules addressing the query limit.
>
>my current rules show that all RCVD_IN_VALIDITY_* rules check for blocked.
>
>>Those *BLOCKED rules where never applied because our spamassassin 
>>received an updated rule-set which was saved to 
>>/var/lib/spamassassin/4.000000/updates_spamassassin_org/ but never 
>>received an update for the active.list file located in 
>>/usr/share/spamassassin/
>
>>After I manually added the changes from the above mentioned patch to 
>>the active.list file it started to work.
>>
>>Now for my questions:
>>*) as is stated in active.list it should not be edited. What's the 
>>correct place to add the new rules to activate them? local.cf?
>
>you can use dns_query_restriction to restrict which DNS lists to query.
>
>further, you can tune uridnsbl_skip_domain to avoid lookups for 
>domains in URI* lists.
>
>>*) If I understand it correctly
>>/var/lib/spamassassin/4.000000/updates_spamassassin_org/ is updated 
>>by the SA update mechanism but it's the Linux distribution's 
>>responsibility to update /var/lib/spamassassin? In that case should 
>>I fill a Debian bug? Or should the SA updates also include the file 
>>active.list?
>
>reload spamd or amavis, the rules in /var/lib/spamassassin/ are used 
>by default.
>
>Maybe you need to enable cron job by setting CRON=1 in 
>/etc/default/spamassassin and it will happen automatically.
>
>...I have no idea how active.list works.

-- 
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.
Enter any 12-digit prime number to continue.

Re: Lots of FN because of VALIDITY* rules

Posted by Matus UHLAR - fantomas <uh...@fantomas.sk>.
On 03.06.24 07:26, postgarage Graz IT wrote:
>A few days ago a lot of false negatives landed in our inboxes. As it 
>turned out the reason was that the for nearly all mails the 
>RCVD_IN_VALIDITY_CERTIFIED and RCVD_IN_VALIDITY_SAFE rules matched.
>
>I now know that validity introduced a query limit which we hit, 
>because I have to admit, I wasn't aware that I shouldn't use public 
>DNS resolvers for blacklists

I'd say you should not use public DNS resolvers with mailserver.

>and therefore we got "Excessive Number of 
>Queries" answers. I also found this patch 
>https://bz.apache.org/SpamAssassin/show_bug.cgi?id=8244 which 
>introduces new rules addressing the query limit.

my current rules show that all RCVD_IN_VALIDITY_* rules check for blocked.

>Those *BLOCKED rules where never applied because our spamassassin 
>received an updated rule-set which was saved to 
>/var/lib/spamassassin/4.000000/updates_spamassassin_org/ but never 
>received an update for the active.list file located in 
>/usr/share/spamassassin/

>After I manually added the changes from the above mentioned patch to 
>the active.list file it started to work.
>
>Now for my questions:
>*) as is stated in active.list it should not be edited. What's the 
>correct place to add the new rules to activate them? local.cf?

you can use dns_query_restriction to restrict which DNS lists to query.

further, you can tune uridnsbl_skip_domain to avoid lookups for domains in 
URI* lists.

>*) If I understand it correctly
>/var/lib/spamassassin/4.000000/updates_spamassassin_org/ is updated by 
>the SA update mechanism but it's the Linux distribution's 
>responsibility to update /var/lib/spamassassin? In that case should I 
>fill a Debian bug? Or should the SA updates also include the file 
>active.list?

reload spamd or amavis, the rules in /var/lib/spamassassin/ are used by 
default.

Maybe you need to enable cron job by setting CRON=1 in 
/etc/default/spamassassin and it will happen automatically.

...I have no idea how active.list works.


-- 
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.
They that can give up essential liberty to obtain a little temporary
safety deserve neither liberty nor safety. -- Benjamin Franklin, 1759

Re: Lots of FN because of VALIDITY* rules

Posted by Bill Cole <sa...@billmail.scconsult.com>.
On 2024-06-03 at 01:26:31 UTC-0400 (Mon, 3 Jun 2024 07:26:31 +0200)
postgarage Graz IT <it...@postgarage.at>
is rumored to have said:

> Now for my questions:
> *) as is stated in active.list it should not be edited. What's the 
> correct place to add the new rules to activate them? local.cf?

Yes. In your local version of local.cf, typically in 
/etc/mail/spamassassin. This is as documented. Run "perldoc 
Mail::SpamAssassin::Conf" for the core configuration documentation.

Note that active.list is part of the rule management toolkit and IS NOT 
part of normal operations. It is part of the ruleset-building system 
that we use to create the daily update packages. In theory anyone could 
use that system to maintain rules and scores locally based on local 
data, as we do to produce daily updates, but I do not believe that 
anyone (literally *anyone*) other than the ASF does that.

> *) If I understand it correctly
> /var/lib/spamassassin/4.000000/updates_spamassassin_org/ is updated by 
> the SA update mechanism but it's the Linux distribution's 
> responsibility to update /var/lib/spamassassin?

I'm not 100% clear on what that question means, perhaps because Debian 
does something different in /var/lib/spamassassin. The standard 
sa-update program will create versioned subdirectories under 
/var/lib/spamassassin/ as needed and channel subdirectories inside of 
them.


> In that case should I fill a Debian bug? Or should the SA updates also 
> include the file active.list?

SA updates include the active rules list in the form of the 72.active.cf 
file. The active.list file is not part of normal operations.


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