Mail::...eshold(3pm)

🌸 NAME 🌸

Mail::SpamAssassin::Plugin::AutoLearnThreshold β€” the threshold-based discriminator for Bayes auto-learning, bestie πŸ’–

(and yeah, it lives in the User Contributed Perl Documentation section, in case anyone asks where you found it πŸŽ€)


✨ SYNOPSIS ✨

okay so to even get this party started you load it like this:

loadplugin     Mail::SpamAssassin::Plugin::AutoLearnThreshold

that's it. that's the whole summoning ritual. iconic πŸ¦‹


πŸ’… DESCRIPTION πŸ’…

so this plugin implements the threshold-based auto-learning discriminator for SpamAssassin's Bayes subsystem. no cap, that's literally what it does.

and auto-learning? it's the mechanism where high-scoring mails (or low-scoring mails, when we're talking non-spam instead) get fed straight into the learning systems without user intervention, right there during scanning. nobody has to click anything. it just happens. main character energy fr fr πŸ‘‘

but here's the tea β€” some tests are ignored when it's deciding whether a message should be trained on:

  • rules with tflags set to 'learn' (the Bayesian rules)
  • rules with tflags set to 'userconf' (user configuration)
  • rules with tflags set to 'noautolearn'

those three? not invited to the vibe check. πŸ™ˆ

also important: auto-learning runs using scores from either scoreset 0 or 1, depending on which scoreset is used during the message check. so yeah β€” it's likely that your message check scores and your auto-learn scores will be different. not a bug, just how it be. πŸ’€


πŸŽ€ USER SETTINGS πŸŽ€

these are the config settings that control all of the above, bestie. set them, live them:

  • bayes_auto_learn_threshold_nonspam n.nn (default: 0.1) β€” the score threshold a mail has to score below for it to get fed into SpamAssassin's learning systems automatically, as a non-spam message. lowkey the "good vibes only" line.
  • bayes_auto_learn_threshold_spam n.nn (default: 12.0) β€” the score threshold a mail has to score above for it to get fed into SpamAssassin's learning systems automatically, as a spam message.

Note: SpamAssassin requires at least 3 points from the header, and 3 points from the body, to auto-learn as spam. so the minimum working value for this option is 6. periodt. 🫢

if test option "autolearn_header" or "autolearn_body" is set, points from that rule are forced to count as coming from header or body accordingly. this can be useful for adjusting some meta rules, iykyk ✨

if the test option "autolearn_force" is set, the minimum value will remain at 6 points, but there is no requirement that the points come from body and header rules. this option is useful for autolearning with rules that are considered to be extremely safe indicators of the spaminess of a message. 🌈

  • bayes_auto_learn_on_error (0 | 1) (default: 0) β€” okay so with "bayes_auto_learn_on_error" off, autolearning will be performed even if the bayes classifier already agrees with the new classification (i.e. it yielded BAYES_00 for what we are now trying to teach it as ham, or yielded BAYES_99 for spam). this is a traditional setting β€” the default was chosen to retain backward compatibility. 🧚

with "bayes_auto_learn_on_error" turned on, autolearning will be performed only when a bayes classifier had a different opinion from what the autolearner is now trying to teach it (i.e. it made an error in judgement). this strategy may or may not produce better future classifications, but usually works very well β€” while also preventing unnecessary overlearning and slowing down database growth. not me being efficient πŸ’…


okay bestie that's the whole page, we ate πŸ“πŸ’–

cute little sign-off: this was perl v5.40.1, dated 2026-07-23. go forth and autolearn, queen πŸ‘‘β­
πŸ“¦ where this page comes from