Reject spam scoring above a certain threshold #4
Labels
No labels
bug
enhancement
suggestion
support
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: glts/spamassassin-milter#4
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Users familiar with the alternative milter
spamass-milter may
be missing the
-r nn
option, which allows rejecting spam that scoresabove a threshold. In our project we have
-r
, but no threshold. Thisfeature has been left out for reasons to do with scope.
First, the notion of ‘strong spam’ is foreign to SpamAssassin. In
SpamAssassin, the spam/ham distinction is a binary property. Either
something is ham and passes, or it is spam and gets a special treatment.
A threshold would break this apart into three categories, strong spam,
weak spam, and ham. This would weaken the uniformity of the milter and
the SpamAssassin components and complicate their relationship (and the
implementation).
Second, SpamAssassin Milter was designed as a thin glue application,
which does not itself have much logic at all. A threshold would require
introducing parsing and interpretation of SpamAssassin headers,
something which we do not currently do (except
X-Spam-Flag: YES
).I would first ask: is it possible to cover the threshold use case
differently, within the existing SpamAssassin framework? Such as relying
on the
required_score
setting in SpamAssassin to reject spam, and letdownstream components (eg Sieve) instead examine the
X-Spam-Level
header and add additional logic on their end?
It is possible to add this feature. I push back against it a little,
because SpamAssassin Milter is also an attempt to break free from
spamass-milter, it is not a clone.
valuable input from pgnd here: #3
now that i've had some time to watch this in production ...
atm, for my use case -- split front & back end postfix servers, with spamassassint-milter running on the front-end -- way too much spam is being sent to the back end.
the intended purpose for SA on the front end is to REJECT above a certain score, and only forward BELOW that score, either tagged as (possible) spam for review, or ham.
for the time being, I've had to switch back to spamass-milter -- for this feature alone.
which is not an ideal solution imo.
I will look into implementing this.
I’m still interested in how you file spam into users’ spam folders. In my setup, I can already implement the reject-with-threshold use case:
required_score
of 10.0 in SpamAssassin-r
option in the milterX-Spam-Level
contains*****
in a global Sieve script and file into junkThe result is that spam above 10 gets rejected, spam above 5 goes into the spam folder, and the rest is delivered as ham.
Now that you mention that, I'm juggling my Bayes learning & sieve processing around ... I think that'll 'fix' my issue, so I do not need the reject limits from spamassassin-milter.
If this works -- it should -- it'll be cleaner!
question: why is it the case that
"error: The argument '--preserve-body' cannot be used with '--reject-spam'"
?
if i'm simply milter-rejecting spam with replycode+rejectcode+msg, why is there any modification of msg body?
i'm going to rescind this request.
your current reject + code/reply/msg @ >= SA 'required_score', is a simpler/better approach.
on my end, i'm cleaning up / simplifying :
-- rm'ing all afterQ & subsequent delivery A/S processing
-- rm'ing per-user Sieve; using global only
-- implementing quarantine of 'possible' spam -- < SA 'required score', but > 'suspected score', for message sizes > some_threshhold ... before final imap delivery.
with that^, spamassassin-milter should do its job quite nicely.
now, i watch logs for awhile ...
Good to hear. I would like to keep this issue open for a while, probs will think about it a little longer …
This combination of options is disallowed simply because it doesn’t make sense: if
--reject-spam
is set, then all spam is rejected, and will never proceed to the stage where the body would be replaced. In other words, the--preserve-body
option is never even looked at when--reject-spam
is set.But perhaps forbidding this is confusing … in any case no functional impact whatsoever, just a bit of option validation.
+1
it was a bit. as is the need for "--reject-spam" if
are set.
I'd prefer the option to have
set/defined in the .service file, but 'quickly' toggle spam rejection OFF by either
(1) removing the --reject-spam flag
or
(2) setting a boolean
is it necessary? no. more convenient? imo, yes.
i am also wondering if a sa-milter config file,
makes sense. as it stands, you have to change/reload the service unit file.
an option is to document/use an ENV file, containing OPTS, in the service file.
changed title from Reject spam above a certain threshold to Reject spam {+scoring +}above a certain threshold
I’m closing this feature request.
The desired use case can already be implemented using existing options
of SpamAssassin and our milter’s
-r
option.First, the header
X-Spam-Flag: YES
added by SpamAssassin determines ifSpamAssassin Milter will treat a message as spam. So the easiest
solution is to adjust SpamAssassin’s
required_score
threshold. Forexample, with
required_score 10.0
, messages scoring 10 or above willbe rejected as spam. Messages with a score below 10 are accepted.
Then, if you need to make a further decision about the message coming
through, check the number of stars in the
X-Spam-Level
header. Forexample, you could treat messages where
X-Spam-Level
contains thestring
*****
as spam: such messages have a score >= 5. WhereX-Spam-Level
does not contain that string, the score is below 5.More complex requirements can be implemented via a plugin. An example is
shown below.
Given that ‘reject-with-score’ can be implemented with the facilities
available an additional option in SpamAssassin Milter is not needed.
/etc/spamassassin/local.cf:
/etc/spamassassin/SpammyFlag.pm: