Part 4b of relay outbound: RL-30's "small shared crate". This moves the server's outbound DANE and MTA-STS code into crates/outbound-tls (inbuxa-outbound-tls), so the relay can deliver with the same logic instead of a second copy. Delivery itself is 4c. This PR doesn't depend on #258.
What moved
From common: the Tlsa, TlsaEntry, TlsaMatching, Policy, Mode and MxPattern types, and their Display/FromStr impls. common::config::smtp::resolver re-exports them, so paths elsewhere are unchanged. Policy::try_parse, which reads this server's own settings, stays in common as mta_sts_policy().
From smtp:
the DANE certificate check, now dane::verify, which returns a match or failure;
MTA-STS policy parsing and matching, now inherent methods on Policy. The old ParsePolicy/VerifyPolicy traits are gone and a few imports changed;
the DNSSEC lookups for MX, TLSA, A and AAAA, including the bogus-answer recheck. They're plain functions over the validating and plain resolvers, and each answer comes back with how long it can be cached.
The CacheItemWeight impls for Tlsa and Policy move to utils::cache (orphan rule).
What stayed in smtp
The TlsaLookup wrappers on Server: its caches, the dnssec_available fallback, and the test_mode mocks.
TlsaVerify on Tlsa, which raises the same dane.* trace events in the same order and returns the same queue errors.
The MTA-STS policy fetch (reqwest) and its cache.
The crate depends on mail-auth without its report and key-generation features, so the relay will avoid pulling those in. Against the relay's current dependency tree, it adds about 60 crates, mostly hickory and IDNA. The size cost will be measured in 4c, when the relay links it.
Tests
The crate's own tests pass: 11, including the moved tlsa_base_status, secure_alias, apex_status and IDN policy tests; the 2 live-DNS tests stay ignored.
smtp unit tests pass with test_mode.
The full smtp:: suite in the tests crate passes: 78, with the usual 3 network-only tests ignored. That covers all of DANE (including bogus-DNSSEC deferral and the TA/EE chain cases), MTA-STS, and delivery.
fmt, clippy, and the notice, name, context and privacy checks are clean.
Part 4b of relay outbound: RL-30's "small shared crate". This moves the server's outbound DANE and MTA-STS code into `crates/outbound-tls` (`inbuxa-outbound-tls`), so the relay can deliver with the same logic instead of a second copy. Delivery itself is 4c. This PR doesn't depend on #258.
**What moved**
- From `common`: the `Tlsa`, `TlsaEntry`, `TlsaMatching`, `Policy`, `Mode` and `MxPattern` types, and their `Display`/`FromStr` impls. `common::config::smtp::resolver` re-exports them, so paths elsewhere are unchanged. `Policy::try_parse`, which reads this server's own settings, stays in `common` as `mta_sts_policy()`.
- From `smtp`:
- the DANE certificate check, now `dane::verify`, which returns a match or failure;
- MTA-STS policy parsing and matching, now inherent methods on `Policy`. The old `ParsePolicy`/`VerifyPolicy` traits are gone and a few imports changed;
- the DNSSEC lookups for MX, TLSA, A and AAAA, including the bogus-answer recheck. They're plain functions over the validating and plain resolvers, and each answer comes back with how long it can be cached.
- The `CacheItemWeight` impls for `Tlsa` and `Policy` move to `utils::cache` (orphan rule).
**What stayed in `smtp`**
- The `TlsaLookup` wrappers on `Server`: its caches, the `dnssec_available` fallback, and the `test_mode` mocks.
- `TlsaVerify` on `Tlsa`, which raises the same `dane.*` trace events in the same order and returns the same queue errors.
- The MTA-STS policy fetch (reqwest) and its cache.
The crate depends on mail-auth without its report and key-generation features, so the relay will avoid pulling those in. Against the relay's current dependency tree, it adds about 60 crates, mostly hickory and IDNA. The size cost will be measured in 4c, when the relay links it.
**Tests**
- The crate's own tests pass: 11, including the moved `tlsa_base_status`, `secure_alias`, `apex_status` and IDN policy tests; the 2 live-DNS tests stay ignored.
- smtp unit tests pass with `test_mode`.
- The full `smtp::` suite in the tests crate passes: 78, with the usual 3 network-only tests ignored. That covers all of DANE (including bogus-DNSSEC deferral and the TA/EE chain cases), MTA-STS, and delivery.
- fmt, clippy, and the notice, name, context and privacy checks are clean.
The TLSA and MTA-STS types, the DANE certificate check, MTA-STS policy
parsing and matching, and the DNSSEC lookups with the bogus-answer
recheck move out of crates/smtp and crates/common into
crates/outbound-tls (RL-30), so inbuxa-relay can deliver with the same
code. The server keeps its caches, trace events, policy fetch and test
mocks around them; its behavior is unchanged.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Part 4b of relay outbound: RL-30's "small shared crate". This moves the server's outbound DANE and MTA-STS code into
crates/outbound-tls(inbuxa-outbound-tls), so the relay can deliver with the same logic instead of a second copy. Delivery itself is 4c. This PR doesn't depend on #258.What moved
common: theTlsa,TlsaEntry,TlsaMatching,Policy,ModeandMxPatterntypes, and theirDisplay/FromStrimpls.common::config::smtp::resolverre-exports them, so paths elsewhere are unchanged.Policy::try_parse, which reads this server's own settings, stays incommonasmta_sts_policy().smtp:dane::verify, which returns a match or failure;Policy. The oldParsePolicy/VerifyPolicytraits are gone and a few imports changed;CacheItemWeightimpls forTlsaandPolicymove toutils::cache(orphan rule).What stayed in
smtpTlsaLookupwrappers onServer: its caches, thednssec_availablefallback, and thetest_modemocks.TlsaVerifyonTlsa, which raises the samedane.*trace events in the same order and returns the same queue errors.The crate depends on mail-auth without its report and key-generation features, so the relay will avoid pulling those in. Against the relay's current dependency tree, it adds about 60 crates, mostly hickory and IDNA. The size cost will be measured in 4c, when the relay links it.
Tests
tlsa_base_status,secure_alias,apex_statusand IDN policy tests; the 2 live-DNS tests stay ignored.test_mode.smtp::suite in the tests crate passes: 78, with the usual 3 network-only tests ignored. That covers all of DANE (including bogus-DNSSEC deferral and the TA/EE chain cases), MTA-STS, and delivery.