Bundle the spam filter rules with the server, and link the Local AI page #28

Merged
jcoffey-dev merged 2 commits from fork/bundled-spam-rules into main 2026-09-23 05:39:50 +00:00
Owner

Summary

  • The spam filter rules (spam-filter v3.0.2, MIT) ship inside the server and are used whenever no other source is configured. An empty setting and upstream's old default both mean the bundled rules, so existing installs switch with no settings change; the URL stays an operator override.
  • Rules load on first boot and again whenever the bundled version changes, adding only what's missing. This brings the AI classifier's LLM_* scores to production, which has none today.
  • upstream-watch also opens an issue when spam-filter publishes a newer release.
  • Settings > Spam Filter gains a Local AI link (CustomComponent/LocalAi), drawn by inbuxa-admin #13. Deploy after that admin release.

Upstream files

Small, inbuxa:-marked edits to spamfilter.rs (the rules URL), defaults.rs (when rules load), spam_classifier.rs (bundled source, applied version) and structs_impl.rs (no default URL), plus the served schema. The strip's rename pass makes the same default and schema changes on every import, so they don't conflict.

Clean room

Not applicable: nothing in crates/features or its hooks.

Testing

Build clean; common 108 unit tests (2 new); antispam passes offline on the bundled rules; the serial SMTP group passes 75/75.

## Summary - The spam filter rules (spam-filter v3.0.2, MIT) ship inside the server and are used whenever no other source is configured. An empty setting and upstream's old default both mean the bundled rules, so existing installs switch with no settings change; the URL stays an operator override. - Rules load on first boot and again whenever the bundled version changes, adding only what's missing. This brings the AI classifier's LLM_* scores to production, which has none today. - upstream-watch also opens an issue when spam-filter publishes a newer release. - Settings > Spam Filter gains a Local AI link (CustomComponent/LocalAi), drawn by inbuxa-admin #13. Deploy after that admin release. ## Upstream files Small, `inbuxa:`-marked edits to spamfilter.rs (the rules URL), defaults.rs (when rules load), spam_classifier.rs (bundled source, applied version) and structs_impl.rs (no default URL), plus the served schema. The strip's rename pass makes the same default and schema changes on every import, so they don't conflict. ## Clean room Not applicable: nothing in crates/features or its hooks. ## Testing Build clean; common 108 unit tests (2 new); antispam passes offline on the bundled rules; the serial SMTP group passes 75/75.
jcoffey-dev added 2 commits 2026-09-23 05:20:47 +00:00
The server fetched upstream's latest published rules from GitHub at run
time: a version nobody here tested, code-like expressions from an account
we don't control, and the upstream name as a default in the admin form.

The published rules of spam-filter v3.0.2 are now embedded
(resources/spam-filter/, MIT, in THIRD-PARTY.md) and used whenever no other
source is configured. An empty setting and upstream's old default both mean
the bundled rules, so existing installs switch without a settings change;
the URL stays an operator override (https:// or file://). The schema default
is dropped and its description says what empty means, and the strip's
rename pass does the same to each import.

Rules load on first boot as before, and again whenever the bundled version
differs from the last one loaded, which only adds missing rules and tags.
That brings the AI classifier's LLM_* scores to installs that predate them:
production has none today.

upstream-watch now also opens an issue when spam-filter publishes a newer
release; resources/spam-filter/README.md says how to take it.

The antispam test now runs on the bundled rules, the path production
takes; SPAM_RULES_URL tests another set. Unit tests cover the URL handling
and that the bundled rules parse and score the AI tags as the AI spec says.
Settings › Spam Filter gains Local AI, the AI spam filtering setup page
ci / fork-checks (pull_request) Successful in 14s
ci / build (pull_request) Successful in 4m23s
eba4c7a32e
Adds a link to CustomComponent/LocalAi in the packaged schema's Settings ›
Spam Filter, above LLM Classifier, and updates the schema hash so admins
fetch the new layout rather than a cached one.

INBUXA Admin draws the page (feature/local-ai-setup); this makes it
reachable. An admin from before that page would show "Unknown component"
here, so this lands after the admin release that carries it.
jcoffey-dev merged commit c09eff2214 into main 2026-09-23 05:39:50 +00:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: inbuxa/inbuxa-server#28