Delivery history: scope inbound and outbound by kind; record spam results #398

Merged
jcoffey-dev merged 2 commits from fix/trace-history-scope into main 2026-11-15 05:23:27 +00:00
Owner

The Inbound list showed mail users submitted over 587/465, and the Outbound list showed local deliveries. x:Trace/query now takes a kind filter (received, submitted, remote, local, any), worked out from each trace's events so older history is covered too. The two lists default to received and remote, with a Show filter for the rest.

Also adds spam.result (info level) with the verdict, score and rules hit, since spam.classify is debug level and never reached stored traces.

The console side, so the Show filter displays its default instead of "All", is inbuxa/inbuxa-admin's fix/list-filter-static-default.

Fixes #397

The Inbound list showed mail users submitted over 587/465, and the Outbound list showed local deliveries. `x:Trace/query` now takes a `kind` filter (received, submitted, remote, local, any), worked out from each trace's events so older history is covered too. The two lists default to received and remote, with a Show filter for the rest. Also adds `spam.result` (info level) with the verdict, score and rules hit, since `spam.classify` is debug level and never reached stored traces. The console side, so the Show filter displays its default instead of "All", is inbuxa/inbuxa-admin's `fix/list-filter-static-default`. Fixes #397
jcoffey-dev added 1 commit 2026-11-15 03:59:13 +00:00
Delivery history: scope inbound and outbound by kind; record spam results
ci / fork-checks (pull_request) Skipped
ci / build (pull_request) Skipped
github/ci (branch) GitHub Actions
ci / github (pull_request) Successful in 8m46s
684df1847f
The Inbound list was every SMTP session that reached MAIL FROM, so mail a
user submitted over 587/465 showed up there. The Outbound list was every
delivery attempt, and local delivery goes through the queue too, so mail
received for local mailboxes showed up there.

x:Trace/query now takes a kind filter: received, submitted, remote, local,
or any. The kind is worked out from a trace's events when it's read, so
history stored before this has one too: a session with auth.success was
submitted, and a delivery attempt is local when every route in it was.
domain-delivery-start now names its route in Type (local, mx, relay or
inbuxa-relay). Older attempts without it count as local when the message
was filed in a mailbox and no other server was connected to. The two list
views default to received and remote, with a Show filter for the other
kind or both.

The spam filter's verdict never reached stored traces: spam.classify is
debug level. A new info event, spam.result (id 662), carries the verdict,
the score and each rule the message hit with its points, so an inbound
session's trace shows why its message scored the way it did. It's in the
packaged schema with the two kind enums. Spec: MON-40 and MON-41.

Test: unit tests for each kind, including older traces and a delivery
with both local and remote routes. monitoring_tests checks the kinds of
an inbound session and its local delivery through x:Trace/query, and
that an unknown kind is refused.

Fixes #397
jcoffey-dev added 1 commit 2026-11-15 05:14:34 +00:00
spam.result lists the rules highest points first
ci / fork-checks (pull_request) Skipped
ci / build (pull_request) Skipped
github/ci (branch) GitHub Actions
ci / github (pull_request) Successful in 8m27s
d7244cfdba
The rules that moved the score now lead the trace's Details instead of
trailing a run of zero-point rules. X-Spam-Result keeps its order.

Refs #397
jcoffey-dev merged commit 5291da3347 into main 2026-11-15 05:23:27 +00:00
jcoffey-dev deleted branch fix/trace-history-scope 2026-11-15 05:23:28 +00:00
Sign in to join this conversation.