Commit Graph
2521 Commits
Author SHA1 Message Date
Wez Furlong da2ddb2ccc switch smtp client from webpki-roots to rustls-platform-verifier
We had some feedback that it would be nice to be able to influence
the set of ca-certs allowed by the client, which isn't possible
when using the hard-coded list in webpki-roots.

This commit is a fairly dumb application of the example shown
in the readme for rustls-platform-verifier.
2024-10-21 07:57:43 -07:00
Wez Furlong 65b51b2ec5 simple_policy: adjust for networking changes 2024-10-21 07:57:32 -07:00
Dirkjan Ochtman 7c9622b529 mta-sts: migrate to dns-resolver Resolver trait 2024-10-17 09:46:59 -07:00
Dirkjan Ochtman 197b73330b dkim: migrate to dns-resolver Resolver trait 2024-10-17 09:46:59 -07:00
Dirkjan Ochtman c82a8da64a dns-resolver: rename TestResolver::with_spf() to with_txt() 2024-10-17 09:46:59 -07:00
Dirkjan Ochtman a96802fcc0 spf: migrate to dns-resolver Resolver trait 2024-10-17 09:46:59 -07:00
Dirkjan Ochtman 967e20ba24 Move ptr_host() and IpDisplay into dns-resolver 2024-10-17 09:46:59 -07:00
Dirkjan Ochtman 3ba1ce03be dns-resolver: use specific error for resolution failures 2024-10-17 09:46:59 -07:00
Dirkjan Ochtman cac03dc91e Use workspace dependency for thiserror 2024-10-17 09:46:59 -07:00
Wez Furlong 6359820d3d startup: partially restore waiting for spool startup
We had a user report that launching kumod
post-7fbec8758720dad465d711458f6bf7923b778773 produced a panic about the
spool not being configured.

My supposition is that they were bringing the system up under load
(incoming traffic) and that a new message was being injected before we
had started the spool.

So what we do here is restore the spool_started check, but have it
be satisfied once the startup has been triggered, rather than
on completion of enumeration.

The result is that there is still a small window where we might turn
away a message during startup, but it should be very very small.
2024-10-16 16:35:13 -07:00
Mike Hillyer 46a1462371 Fix indentation on troubleshooting page. 2024-10-16 12:20:30 -04:00
Wez Furlong b0a37c709b mailparsing: fix replace_text_body / msg:append_text_XXX
We weren't stripping out an existing Content-Transfer-Encoding,
which could lead to duplicate and ambiguous results.
2024-10-15 20:08:25 -07:00
Wez Furlong 9cae055af9 fix a mime rfc2047 qp encoding issue for unstructured fields
This is a bit of a weird one, but the gist of it is that a sequence
of qp encoded words separated by spaces is, per the spec, re-assembled
and the spaces between the encoded words is ignored.

That means that any pair of adjacent encoded words should really
collapsed into a single encoded word that internally includes the
space in order for it to round trip.

To make things a little more complicated, the underlying quoted
printable crate that we're using implements the base qp space rather
than the modified version used by rfc2047 and it will strip trailing
whitespace from the words that are being encoded.

What we do here in this commit is an improvement, but may still
be subject to nuance in the future:

When rebuilding a header value, instead of splitting by space and
emitting a series of encoded words, we will now produce a single
encoded word for the entire header. That word may be split and
wrapped as needed to ensure that the maximum line length is
respected.
2024-10-15 17:48:19 -07:00
Wez Furlong 34096a3b11 http inject: make it an error to pass unrecognized fields
This makes it easier to spot when the api is being used incorrectly.
2024-10-15 13:24:53 -07:00
Wez Furlong 3e4b6c133e ci: tell the github build about the prebuilt rocksdb 2024-10-15 09:49:30 -07:00
Wez Furlong 09da95f586 ci: bump sccache size, simplify rocks/snappy logic
we don't build shared at all, so we can remove the additional
complexity of looking for .so files
2024-10-15 09:49:30 -07:00
Wez Furlong b528455995 ci: split out builder image pulling into a separate step
This makes it easier to see how much time is spent pulling vs
immediately being able to use the image
2024-10-15 09:49:30 -07:00
Wez Furlong b4660b57f8 try sccache again
Might be worth it now we have pre-built rocksdb
2024-10-15 09:49:30 -07:00
Wez Furlong 85bbd1813b make fmt 2024-10-15 09:49:30 -07:00
Dirkjan Ochtman a28721f5ee dns-resolver: replace Resolver enum with a trait 2024-10-15 08:54:24 -07:00
Dirkjan Ochtman 2298a1791c dns-resolver: require Name argument for Resolver::resolve() 2024-10-15 08:54:24 -07:00
Dirkjan Ochtman d4ec9cf50e dns-resolver: use concrete type for Resolver::resolve_txt() 2024-10-15 08:54:24 -07:00
Dirkjan Ochtman bc7bf2ffa8 dns-resolver: create HickoryResolver wrapper 2024-10-15 08:54:24 -07:00
Dirkjan Ochtman 4553cafeca dns-resolver: externalize unwrapping on UnboundResolver initialization 2024-10-15 08:54:24 -07:00
Dirkjan Ochtman a9132e201d dns-resolver: create new UnboundResolver type 2024-10-15 08:54:24 -07:00
Dirkjan Ochtman e309c8d69a dns-resolver: avoid exposing internal structure 2024-10-15 08:54:24 -07:00
Wez Furlong 04427e4f9e ci: rocksdb: build in PORTABLE mode
rocksdb has its own internal option that overrides the cpu
target, so we need to be sure to tell it not to do that
using this option, otherwise we can cause illegal instruction
errors in the resulting executable.
2024-10-15 06:38:44 -07:00
Dirkjan Ochtman be09a845d1 spf: reintroduce CheckHostParams 2024-10-15 06:04:53 -07:00
Dirkjan Ochtman 6c37410042 Use a workspace dependency for serde 2024-10-15 06:04:53 -07:00
Wez Furlong cd16f5e540 ci: apply arch flags on x86 rather than arm 2024-10-14 23:13:35 -07:00
Wez Furlong 9041b0502b ci: build-rocksdb: adjust compiler flags
I'm seeing some illegal instruction errors on the build cluster
and I suspect that something is being tuned to a cpu on one
node and isn't 100% compatible with another node.
2024-10-14 22:55:22 -07:00
Wez Furlong 2ce8ef87eb ci: add assets/ci/build-rocksdb.sh to triggers for image-builder 2024-10-14 21:13:06 -07:00
Wez Furlong 92d05f25a9 ci: build-rocksdb: reduce the -j to -j8 2024-10-14 21:07:15 -07:00
Wez Furlong 0a63a23020 ci: pre-build a static rocksdb
This commit arranges for the image builder to produce a static
build of rocksdb, and then for the populate-cache-vars.sh script
to detect that and update the environment so that the build picks
up that pre-built rocksdb instead of building a vendored version
of rocksdb on every CI run.
2024-10-14 20:52:22 -07:00
Wez Furlong 94e1f42c3a ci: log info about the agent 2024-10-14 13:56:31 -07:00
Wez Furlong eecd11a640 http injector: enable trace headers
These are almost identical to those used by smtp, the main difference
being that we don't include the Received header by default for
http injection, whereas we do for smtp in order to be compliant
with the relevant rfcs.  No such rfcs exist for the injection
protocol, so we can pick a default that makes more sense for the
majority of our target audience.
2024-10-14 09:57:29 -07:00
Wez Furlong 717b6b4e2c integration-tests: show logs in sorted order
We were collecting the logs, printing them as we found them, and
then returning the sorted result.

That made it awkward for a human to review, so what we do now
is defer printing the logged records until after we have sorted
them.

For records with the same timestamp, we sort based on the message
id and the record type so that there is some additional consistency
and to make it easier to reason about.
2024-10-14 07:33:27 -07:00
Wez Furlong abb2372550 add match_internal option to tsa automation rules
Problem scenario: you have defined an automation rule with the
unanchored regex `detected an unusual rate` that triggers a suspension.

What happens: when the remote host initially responds and that
rule matches, a suspension will be created.  When subsequent
messages are checked against that rule, the message will not
be attempted (good), but we will generate and log a transient failure
response of the form: `KumoMTA internal: suspended, rule: detected an
unusual rate`. When that response is presented to TSA, since the regex
is unanchored, the original rule will also match it, and that will
cause the duration to be reset, effectively perpetuating the suspension
until the combination of ingress and the retry window exceeds the
duration specified in the rule (bad).

You can explicity mark up your regex with an anchor to prevent
this sort of matching, but it is a PITA to do that for every
suspension rule.

This commit resolves this issue by recognizing that the default
should be to not match internally generated rules.  The newly
introduced `match_internal` boolean defaults to false and controls
whether we should consider these internal messages, and allows
the matching to be turned on when needed.  We use this in one
of the default shaping rules that is used to disable the use
of tls for broken hosts.
2024-10-14 07:33:20 -07:00
Dirkjan Ochtman 5724223bd7 spf: restrict visibility, remove unused code 2024-10-12 08:00:15 -07:00
Dirkjan Ochtman eb49753248 spf: move SpfContext into crate root 2024-10-12 08:00:15 -07:00
Dirkjan Ochtman 5b0f6208df spf: move macro expansion tests into spec module 2024-10-12 08:00:15 -07:00
Dirkjan Ochtman e2284c0957 spf: rename DomainSpec to MacroSpec 2024-10-12 08:00:15 -07:00
Dirkjan Ochtman e25029b613 spf: move SpfContext::expand() to DomainSpec 2024-10-12 08:00:15 -07:00
Dirkjan Ochtman 2264706232 spf: move DomainSpec to new spec module 2024-10-12 08:00:15 -07:00
Dirkjan Ochtman ef0584a2f1 spf: add basic support for exp modifier 2024-10-12 08:00:15 -07:00
Dirkjan Ochtman 68473d92b1 spf: add basic support for redirect modifier 2024-10-12 08:00:15 -07:00
Dirkjan Ochtman 0b662e88ab spf: tighten record parsing to support modifiers 2024-10-12 08:00:15 -07:00
Dirkjan Ochtman 5853970c0f spf: add basic support for the exists mechanism 2024-10-12 08:00:15 -07:00
Dirkjan Ochtman 487a45c9ff spf: add basic support for include mechanism 2024-10-12 08:00:15 -07:00
Dirkjan Ochtman 7d60811bf6 spf: take argument in a more flexible way 2024-10-12 08:00:15 -07:00