Show and log what the spam and virus scan decided #86

Merged
calvin merged 1 commit from scan-deploy into master 2026-11-13 04:24:28 +00:00
Owner

Found while putting rspamd and ClamAV in front of a live instance.

  • A received message's page has a "Scan" panel: score, rspamd's action and symbols, the virus result, or why a scanner did not answer (before: only the raw X-Spam-* fields and the API).
  • A message the scan refuses (550 spam, 554 virus, 451 scanner down) is stored nowhere, and nothing was logged. Karta now logs one line with the client address, envelope sender and what the scanners said (never a recipient), and a warning when a message is accepted unscanned on open routes.
  • Guides: X-Spam-Symbols is cut at 900 bytes (not 20 symbols); KARTA_RSPAMD_PASSWORD is not the controller password (Karta only calls the scanning worker); advise KARTA_SCAN_TIMEOUT of 10-15 s, since a measured scan took 2.9 to 6.9 s when one DNS name did not answer; note that symbols with score 0 (GTUBE) are left out.

Tests: test/karta/scan_test.exs, test/karta/smtp/policy/inbound_scan_test.exs, test/karta_web/live/message_live_show_test.exs (43 pass); mix compile --warnings-as-errors clean.

The live deployment does not need this first: scanning works without it.

🤖 Generated with Claude Code

Found while putting rspamd and ClamAV in front of a live instance. - A received message's page has a "Scan" panel: score, rspamd's action and symbols, the virus result, or why a scanner did not answer (before: only the raw `X-Spam-*` fields and the API). - A message the scan refuses (550 spam, 554 virus, 451 scanner down) is stored nowhere, and nothing was logged. Karta now logs one line with the client address, envelope sender and what the scanners said (never a recipient), and a warning when a message is accepted unscanned on open routes. - Guides: `X-Spam-Symbols` is cut at 900 bytes (not 20 symbols); `KARTA_RSPAMD_PASSWORD` is not the controller password (Karta only calls the scanning worker); advise `KARTA_SCAN_TIMEOUT` of 10-15 s, since a measured scan took 2.9 to 6.9 s when one DNS name did not answer; note that symbols with score 0 (GTUBE) are left out. Tests: `test/karta/scan_test.exs`, `test/karta/smtp/policy/inbound_scan_test.exs`, `test/karta_web/live/message_live_show_test.exs` (43 pass); `mix compile --warnings-as-errors` clean. The live deployment does not need this first: scanning works without it. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
A refused message is stored nowhere, so nothing said which sender was
refused or why. The line carries the sender address, the envelope sender and
what the scanners answered, never a recipient.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The score, rspamd's action and symbols, the virus result, or why a scanner
did not answer were only in the raw header fields and the API.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Correct the scanning guides and advise a longer scan budget
All checks were successful
ci/woodpecker/pr/woodpecker Pipeline was successful
1231406537
The symbols field is cut at 900 bytes, not 20 symbols; the rspamd password
is not the controller's; DNS checks can take several seconds.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Merge branch 'master' into scan-deploy
All checks were successful
ci/woodpecker/pr/woodpecker Pipeline was successful
46201ef08b
calvin merged commit 0e1f947cfb into master 2026-11-13 04:24:28 +00:00
calvin deleted branch scan-deploy 2026-11-13 04:24:28 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
external/karta!86
No description provided.