Fix the antispam test: pin the rules it scores against, stop live Pyzor #24

Merged
jcoffey-dev merged 2 commits from fix/antispam-test into main 2026-09-23 04:12:41 +00:00
Owner

It failed everywhere but upstream's machines, for two reasons:

  • The spam rules, which carry every score, came from a path on an
    upstream developer's own disk. Without SPAM_RULES_URL none loaded, every
    score was 0.00 and the combined case came out ham instead of spam at
    13.70. The published rules of spam-filter v3.0.2 are now pinned beside
    the test cases (Apache-2.0 or MIT, taken as MIT; in THIRD-PARTY.md).
    SPAM_RULES_URL still overrides.
  • The first combined case expects a Pyzor hit, and its digest (that of an
    empty body) wasn't among the three the test mode answers, so it went to
    a public Pyzor server: it failed offline and would drift with that
    server's counts. Test mode now answers every digest from a fixed table,
    with the empty body's added, and never reaches the network.

The test passes online and offline, alone and with the rest of the SMTP
tests. queue_retry, unrelated, still fails when it runs after the others
in one process, though it passes alone every time.

Summary

Related issues

Upstream files

Clean room

Testing

It failed everywhere but upstream's machines, for two reasons: - The spam rules, which carry every score, came from a path on an upstream developer's own disk. Without SPAM_RULES_URL none loaded, every score was 0.00 and the combined case came out ham instead of spam at 13.70. The published rules of spam-filter v3.0.2 are now pinned beside the test cases (Apache-2.0 or MIT, taken as MIT; in THIRD-PARTY.md). SPAM_RULES_URL still overrides. - The first combined case expects a Pyzor hit, and its digest (that of an empty body) wasn't among the three the test mode answers, so it went to a public Pyzor server: it failed offline and would drift with that server's counts. Test mode now answers every digest from a fixed table, with the empty body's added, and never reaches the network. The test passes online and offline, alone and with the rest of the SMTP tests. queue_retry, unrelated, still fails when it runs after the others in one process, though it passes alone every time. <!-- Thanks for contributing to INBUXA. CONTRIBUTING.md has the full guide; this is the short version. Delete any section that does not apply. --> ## Summary <!-- What changes, and why. The why is the part that is hard to recover later. --> ## Related issues <!-- e.g. Closes #123. Leave blank if there are none. --> ## Upstream files <!-- Does this touch files that came from Stalwart? If so: is the change as small as it can be, and is it marked with an `inbuxa:` comment saying which requirement it serves? Every edit to an upstream file is a conflict waiting at the next import, so it should be worth one. --> ## Clean room <!-- Only for changes to the rebuilt features in `crates/features`, or to the hooks that serve them. Confirm one: - [ ] I have not read Stalwart's Enterprise-licensed source, and worked from the specification in `docs/spec/features/`. - [ ] I have read it. (Say so -- the change will be reviewed with that in mind, or declined for the parts it touches. The project's claim of independent creation is a record, and the record has to be true.) --> ## Testing <!-- What you ran. `cargo test -p tests` covers what needs nothing but a store; say so if you ran any of the `#[ignore]`d suites from docs/spec/container-tests.md, and which. -->
jcoffey-dev added 1 commit 2026-09-23 03:41:56 +00:00
Fix the antispam test: pin the rules it scores against, stop live Pyzor
ci / name-check (pull_request) Successful in 17s
ci / build (pull_request) Successful in 7m12s
f32992ca36
It failed everywhere but upstream's machines, for two reasons:

- The spam rules, which carry every score, came from a path on an
  upstream developer's own disk. Without SPAM_RULES_URL none loaded, every
  score was 0.00 and the combined case came out ham instead of spam at
  13.70. The published rules of spam-filter v3.0.2 are now pinned beside
  the test cases (Apache-2.0 or MIT, taken as MIT; in THIRD-PARTY.md).
  SPAM_RULES_URL still overrides.
- The first combined case expects a Pyzor hit, and its digest (that of an
  empty body) wasn't among the three the test mode answers, so it went to
  a public Pyzor server: it failed offline and would drift with that
  server's counts. Test mode now answers every digest from a fixed table,
  with the empty body's added, and never reaches the network.

The test passes online and offline, alone and with the rest of the SMTP
tests. queue_retry, unrelated, still fails when it runs after the others
in one process, though it passes alone every time.
jcoffey-dev added 1 commit 2026-09-23 04:03:59 +00:00
antispam test: run it serially, like the tests sharing its port
ci / name-check (pull_request) Successful in 17s
ci / build (pull_request) Successful in 7m11s
5be578ba3c
It listens on HTTP 19048, as the dkim2 DSN and report tests do. Those are
marked serial, this wasn't, so when the SMTP tests ran together (as
upstream's CI runs them) it could start beside them and requests reached
whichever server had the port: missing JMAP creates here, and 'You must
authenticate first' in dkim2_dsn_is_signed.
jcoffey-dev merged commit 64385007c1 into main 2026-09-23 04:12:41 +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#24