On 25 Feb 2018, at 11:13 (-0500), Peter Thomassen wrote:
Reminder: My question was not "how to run DNS efficiently" or "how
does
SpamAssassin run DNS queries", my question was "how can I influence
the
order of tests".
The canonical answer is: by adjusting rule priority values and using the
short-circuit feature.
Unfortunately, that's not applicable to DNS tests because SA's code is
optimized for total scan time. This means that DNS checks, which have
built-in latency, are started asynchronously before everything else. So
if you want to change that to postpone DNS checks with the possibility
of short-circuiting them, you will need to re-architect that part of SA.
If you choose that route, I expect that patches to make that alternative
design a configurable option would be welcome upstream but I doubt that
creating such a mechanism would be made a project priority in any way
because the current optimization for overall performance is much more
useful for most users than economizing on DNS queries.
For what it's worth, a few years ago I had to do an analysis of URIBL
data value with hard numbers and I found that for that particular
operation, URIBLs were decisive in a large majority of spams accurately
classified as spam by SA. It is important to note that for this site (as
for all sites I have done significant work with in this millennium) the
vast majority of mail never was seen by SA because it was rejected (or
much less often was exempted from SA by whitelisting) ahead of the DATA
phase. This also meant that in that particular case, there was no risk
of hitting the point of URIBL_BLOCKED. If all messages had been run
through SA, they would have needed to pay for data feeds to have a
useful spam control function.
Obviously, no 2 mail systems see exactly the same distribution of ham
and spam, so your circumstances might make buying feeds uneconomic.
OTOH, unless you're an extremely adept programmer or your time is not
very valuable, redesigning the way SA runs tests is very likely to be
the most uneconomic choice available to addressing your root problem.
--
Bill Cole
b...@scconsult.com or billc...@apache.org
(AKA @grumpybozo and many *@billmail.scconsult.com addresses)
Currently Seeking Steady Work: https://linkedin.com/in/billcole