Relayed inbound mail follows the settings in force now (#366) #367

Merged
jcoffey-dev merged 1 commits from fix/366-relay-link-fresh-settings into main 2026-11-11 01:34:29 +00:00
1 Commits
Author SHA1 Message Date
jcoffey-dev b242398f41 Relayed inbound mail follows the settings in force now (#366)
ci / fork-checks (pull_request) Skipped
ci / build (pull_request) Skipped
github/ci (branch) GitHub Actions
ci / github (pull_request) Successful in 10m26s
The relay link service built its Server once per connection, and a
Server holds a snapshot of the core. Every relayed message was judged
through that snapshot, so a reload after a registry write (a domain's
directory and its mailbox filter, RCPT/DATA stage rules, the spam
filter, sender authentication) didn't reach mail arriving through a relay
until the link reconnected, usually at a restart. Mail on port 25 used
the new settings at once, so the two paths disagreed.

Each relayed message is now judged with a Server built from the shared
core when it's taken, and the link loop refreshes its Server on every
pass, so sync, events and outbound statuses see current settings too.

Test: relay_link_tests lowers maxReceivedHeaders to 3 with the link up,
and the next relayed message with five Received headers is refused with
450 4.4.6; set back to 50, the same message is delivered. Without the
fix the first one was accepted (250).

Fixes #366
2026-11-10 18:18:35 -07:00