Skip to content

Mail: spam false positives when Rspamd starts without Internet access #8389

Todo

Description

@DavidePrincipi

When the mail server starts while it cannot reach the Internet, its spam filter (Rspamd) stops resolving DNS names, and it keeps failing even after the Internet connection comes back. Incoming legitimate messages then get DNS failure scores and are marked as spam. Nothing raises an alert, no service is in a failed state, and the problem lasts until Rspamd is restarted.

This happened in production after a power outage: the NethServer 8 node booted about 15 minutes before the firewall that gives it Internet access.

Steps to reproduce

  • Install Mail 1.9.3 and verify that mail filtering works normally
  • Block the node's outgoing Internet traffic (for example, keep the gateway/firewall turned off)
  • Restart Rspamd, or reboot the node: runagent -m mail1 systemctl --user restart rspamd
  • Restore Internet access
  • Wait some minutes, then check DNS resolution through Rspamd's local resolver: runagent -m mail1 podman exec rspamd nslookup -port=11336 example.org 127.0.0.1
  • Deliver a legitimate message from an external domain and look at its Rspamd symbols

Expected behavior

Once the Internet connection is back, Rspamd resolves DNS names again and messages are scored normally.

Actual behavior

DNS lookups keep returning SERVFAIL after the connection is restored (still failing after several minutes). Almost every incoming message gets symbols like DMARC_DNSFAIL, R_SPF_DNSFAIL, R_DKIM_TEMPFAIL, ASN_FAIL{... server fail}, MX_MISSING (+3.5) and HFILTER_*_NORES, which push legitimate messages above the spam threshold.

At start-up, Rspamd's internal DNS resolver (Unbound) tries to refresh the DNSSEC root trust anchor (the key used to validate DNS answers). Without Internet access the refresh fails, but the failure is ignored and the container starts anyway. Container log:

fail: the anchor is NOT ok and could not be fixed

Unbound then falls back to the trust anchor shipped in the image. In the 1.9.3 image that file dates from 2022 and contains only the old root key (KSK 20326), not the current one (KSK-2024, id 38696). Unbound cannot validate the root zone (failed to prime trust anchor -- DNSKEY rrset is not secure) and answers SERVFAIL to nearly every query. It never recovers by itself: the anchor refresh runs only when the container starts. The messages are logged at info level only.

When the node is online, a restart of Rspamd makes everything work again: runagent -m mail1 systemctl --user restart rspamd

Components

  • Mail 1.9.3 (affected: lasting DNS failure)
  • Mail 2.0.0-beta.6 (same silent refresh failure; DNS recovers thanks to the newer anchor shipped in the image)

See also


Thanks to Lucad for finding and analyzing the problem.

Activity

  1. moved this from Backlog to ToDo in NethServeron Nov 27, 2026
  2. self-assigned this
    on Nov 30, 2026
  3. moved this from ToDo to In Progress in NethServeron Nov 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

  • Status
    In Progress

Relationships

None yet

Development

No branches or pull requests

Issue actions