Bug 4165 - Add ability to turn off all network tests (ie local_tests_only) via config
Summary: Add ability to turn off all network tests (ie local_tests_only) via config
Status: RESOLVED WONTFIX
Alias: None
Product: Spamassassin
Classification: Unclassified
Component: spamassassin (show other bugs)
Version: 3.0.2
Hardware: PC Linux
: P5 enhancement
Target Milestone: Future
Assignee: SpamAssassin Developer Mailing List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-03-01 21:10 UTC by Nathan J. Olson
Modified: 2019-10-02 10:51 UTC (History)
1 user (show)



Attachment Type Modified Status Actions Submitter/CLA Status
File produced by the mentioned spamassassin command text/plain None Nathan J. Olson [NoCLA]
The init.pre file text/plain None Nathan J. Olson [NoCLA]
The local.cf file text/plain None Nathan J. Olson [NoCLA]

Note You need to log in before you can comment on or make changes to this bug.
Description Nathan J. Olson 2005-03-01 21:10:34 UTC
Site rules contain:
use_dcc 0
use_razor2 0
use_pyzor 0
skip_rbl_checks 0
dns_available no
use_bayes 0

/etc/local/spamassassin/init.pre has:
all plugins commented out

a 'spamassassin -x -D --siteconfigpath=/etc/local/spamassassin' (I don't have a 
user preferences file) still reports that rule set 1 is chosen.  I believe rule 
set 0 should be chosen under these circumstances.  All default rules 
(/usr/share/spamassassin/*) have not been modified.

Attached is the init.pre, local.cf and the output of the above command.
Comment 1 Nathan J. Olson 2005-03-01 21:23:02 UTC
Created attachment 2672 [details]
File produced by the mentioned spamassassin command
Comment 2 Nathan J. Olson 2005-03-01 21:23:50 UTC
Created attachment 2673 [details]
The init.pre file
Comment 3 Nathan J. Olson 2005-03-01 21:24:20 UTC
Created attachment 2674 [details]
The local.cf file
Comment 4 Nathan J. Olson 2005-03-01 21:25:15 UTC
I forgot to mention the --lint option to the above spamassassin command.
--lint is present on that command line.
Comment 5 Michael Parker 2005-03-01 21:32:09 UTC
To get scoreset 0, you MUST explicitly instantiate the SA object with
local_tests_only (ie -L for spamassassin or spamd)

If you're using the API directly, you should pass in local_tests_only => 1 when
creating the SA object.
Comment 6 Theo Van Dinter 2005-03-01 22:02:38 UTC
Subject: Re:  Add ability to turn off all network tests (ie local_tests_only) via config

On Tue, Mar 01, 2005 at 09:37:09PM -0800, bugzilla-daemon@bugzilla.spamassassin.org wrote:
>             Summary|spamassassin chooses an     |Add ability to turn off all
>                    |incorrect score set when all|network tests (ie
>                    |network tests, bayes tests, |local_tests_only) via config
>                    |and plugins are disabled    |

I'm pretty close to -1 on this for a config POV.

It may not be such a bad idea for scoreset to change based on rule
hits though.  ie: BAYES_50 hits, shift from scoreset 2/3 to 0/1.  If no
"tflag net" rules hit, shift to scoreset 0/2, etc.

But that's another discussion. ;)

Comment 7 Michael Parker 2005-03-02 05:52:42 UTC
Subject: Re:  Add ability to turn off all network tests (ie local_tests_only) via config

I'm -0.

The issue arose from an IRC conversation.  Someone using SA with
MailScanner, which doesn't provide a way to pass local_tests_only at
object creation time.  They tried turning off every network test they
could find, but things still ran at set 1.

In his case, without hacking the MailScanner code, it was impossible
to run in set 0.
Comment 8 Theo Van Dinter 2005-03-02 06:57:18 UTC
Subject: Re:  Add ability to turn off all network tests (ie local_tests_only) via config

On Tue, Mar 01, 2005 at 10:02:38PM -0800, bugzilla-daemon@bugzilla.spamassassin.org wrote:
> It may not be such a bad idea for scoreset to change based on rule
> hits though.  ie: BAYES_50 hits, shift from scoreset 2/3 to 0/1.  If no
> "tflag net" rules hit, shift to scoreset 0/2, etc.

Actually, in thinking about this more, it breaks pretty completely in terms of
short circuiting, etc.

Comment 9 Theo Van Dinter 2005-03-02 06:58:10 UTC
Subject: Re:  Add ability to turn off all network tests (ie local_tests_only) via config

On Wed, Mar 02, 2005 at 05:52:43AM -0800, bugzilla-daemon@bugzilla.spamassassin.org wrote:
> In his case, without hacking the MailScanner code, it was impossible
> to run in set 0.

Ok, so this is a MailScanner issue.  We provide a way to disable net tests, if
people use the API and don't use that flag, that's the other code's problem.
IMO.

Comment 10 Nathan J. Olson 2005-03-02 07:14:54 UTC
I don't consider this a MailScanner issue.  It makes absolutely no sense why
turning off every possible network test results in the use of score set 1.  I'm
saying SpamAssassin should recognize that it can't possibly perform a network
test and pick the appropriate score set.  The current behavior is completely
counter-intuitive.
Comment 11 Fred T 2005-03-02 07:20:56 UTC
This issue may also affect MIMEDefang, I have noticed score differences for a
long time.
Comment 12 Theo Van Dinter 2005-03-02 07:33:47 UTC
Subject: Re:  Add ability to turn off all network tests (ie local_tests_only) via config

On Wed, Mar 02, 2005 at 07:14:54AM -0800, bugzilla-daemon@bugzilla.spamassassin.org wrote:
> I don't consider this a MailScanner issue.  It makes absolutely no sense why
> turning off every possible network test results in the use of score set 1.  I'm
> saying SpamAssassin should recognize that it can't possibly perform a network

Except the documented and supported way to say "turn off all network tests" is
setting the local_tests_only option.

I don't think the overhead is worth the benefit -- MailScanner really should
just support the standard way of disabling network tests, and no one would try
disabling all the network checks manually when using the standard tools.

But...  Patches accepted.  :)

Comment 13 Bob Menschel 2005-04-30 22:59:57 UTC
Triage: I agree that if all local tests are intentionally turned off, or network
tests cannot be run, then the no-network score sets should be used. Setting
target to "future" so this doesn't get dropped.  As Theo said, patches accepted. 
Comment 14 Henrik Krohns 2019-10-02 10:51:09 UTC
There's no way for SA to know at runtime if "all local tests are intentionally turned off, or network tests cannot be run", use -L or API, closing.