Commit Graph
3584 Commits
Author SHA1 Message Date
Wez Furlong 863c323c3a deps: upgrade nom to latest 7.x release 2026-03-28 07:20:27 +00:00
Wez Furlong 4b84181479 SharedString: remove deref to str, deal with fanout
Removes the deref to str as this is now a fallible operation that
can panic.

Process the fanout of this change, which is dealing with more
possibility that things might be binary in more places.

There are some transitional APIs introduced as deprecated so that I'm
nagged to remove them already: I want to get the bulk of the code aware
of the possibility of binary sorted before I tackle adjusting the
message parser for that, so that that particular commit is more
self-contained.
2026-03-28 07:20:27 +00:00
Wez Furlong 5a72795376 refactor: conceptually enable mimepart construction from binary
Enable constructing or replacing the body portion of a mime
part with binary content.
2026-03-28 07:20:27 +00:00
Wez Furlong 16f019794e kumo-wrap: enable operating on bytes 2026-03-28 07:20:26 +00:00
Wez Furlong 1ac2f0ee5b mailparsing: refactor SharedString for binary data
This is a step towards allowing non-UTF-8 data to be tracked
in the SharedString type.

It is not complete; some tests now panic with UTF-8 input where
they would previously implicitly perform a lossy conversion.
That will be resolved in subsequent commit(s).
2026-03-28 07:20:26 +00:00
Wez Furlong 084389b7ae dkim: remove implicit policy status for mismatching From/Signing domains
It was pointed out that we had this policy and that it wasn't part of
the spec.

That behavior was imported along with the crate when we forked it from
the cloudflare implementation.

Let's remove it; folks that need it can use a couple of lines of lua to
recreate it if they need it.
2026-03-28 07:20:08 +00:00
Wez Furlong 959928a540 summarize when connection errors are due to unplumbed ip on proxy
This is similar the prior two commits; this one summarizes the case
where socks5 is in use and the bind(2) fails on the proxy server,
indicating unplumbed addresses on the server.

We cannot do the equivalent with HA proxy as its protocol has
no provision for this sort of feedback.
2026-03-28 07:20:07 +00:00
Wez Furlong 36014efd85 summarize when connection failures are due to proxy issues
Following from prior commit, if we failed to connect to a proxy,
summarize that in the resulting transfient failure reason.
2026-03-28 07:20:07 +00:00
Wez Furlong cfaea43cab summarize when connection failures are due to unplumbed ips
Similar to how we summarize and inform when all connection errors
are due to broken TLS, recognize and inform when all connection
errors are due to a source_address that cannot be bound due to
the address not being plumbed on the system.  This does not
include other reasons that `bind(2)` can fail, just the case
where the address is not present.

Add an integration test to capture the error message for
that situation, for easier future reference.
2026-03-28 07:20:07 +00:00
Wez Furlong ffe960e8ea tests: capture what happens if we can't connect to ha proxy
This commit doesn't change any behavior, just captures the
current behavior if an ha proxy server is not reachable.
2026-03-28 07:20:06 +00:00
Mike Hillyer 8d2966727b Link tweak. 2026-03-27 12:50:40 -04:00
Mike Hillyer 6ac3df137d Updating API index in refman to reflect changes to ACL. 2026-03-27 12:48:28 -04:00
Mike Hillyer 44273ed1d1 Update FUNDING.yml 2026-03-16 15:05:50 -04:00
dependabot[bot] 1761afd307 build(deps): bump docker/setup-buildx-action from 3 to 4
Bumps [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) from 3 to 4.
- [Release notes](https://github.com/docker/setup-buildx-action/releases)
- [Commits](https://github.com/docker/setup-buildx-action/compare/v3...v4)

---
updated-dependencies:
- dependency-name: docker/setup-buildx-action
  dependency-version: '4'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-16 14:40:58 +00:00
dependabot[bot] 448d3d7e55 build(deps): bump quinn-proto from 0.11.13 to 0.11.14
Bumps [quinn-proto](https://github.com/quinn-rs/quinn) from 0.11.13 to 0.11.14.
- [Release notes](https://github.com/quinn-rs/quinn/releases)
- [Commits](https://github.com/quinn-rs/quinn/compare/quinn-proto-0.11.13...quinn-proto-0.11.14)

---
updated-dependencies:
- dependency-name: quinn-proto
  dependency-version: 0.11.14
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-16 14:40:39 +00:00
Wez Furlong d48ad3cb5b mod-serde: sort pretty-printed json object keys
This makes things a bit easier for human consumption, especially
for the `resolve-shaping-domain` utility.
2026-03-16 08:35:00 +00:00
Wez Furlong 4bd063f246 resolve-xxx: allow use with http:// special tsa/xfer queues
These utilities would simplistically assume that the input domain
was always a valid DNS name, which is true for the majority of
things, but our internal webhook, TSA and xfer queue names include
http URLs and would choke these utilities.

We now fall back to using the input "domain" if the MX resolution
attempt throws an error; the error is typically a failure to parse
rather than something like NXDOMAIN which is generally returned as an
empty result.
2026-03-16 08:20:47 +00:00
Wez Furlong c0440ea138 rfc3464: fix issue with addresses enclosed in <>
This is a follow on from the previous commit; apparently some sites
will enclose addresses in <> even though this is not covered in the
RFC.

Let's cut the address parsing over to the SMTP parser rather than
the mail header parser, as they have rather different semantics
and both ARF and OOB are SMTP-centric.
2026-03-16 08:06:35 +00:00
Wez Furlong 813c7935d6 rfc5965: fix an issue with addressed enclosed in <>
We had a report that the enclosing <> were being passed through
to the JsonLogRecord in some log hook flows, which meant that
we'd try to parse them as EnvelopeAddresses and fail.
2026-03-13 10:36:36 +00:00
Raphael Sprenger aaf7f3fcce use correct option add_auth_results_header
Updating the wrongly stated "add_authentication_results" to the correct "add_auth_results_header" in check.md.
2026-03-13 07:23:12 +00:00
Wez Furlong 1c5221ba00 add /api/admin/task-dump api endpoint
This dumps out a trace of all tokio tasks.  It is quite expensive,
and currently unsettles the tokio runtime such that you need to
repeatedly call this endpoint in order for a subsequent graceful
shutdown to clock through and complete.
2026-03-11 15:19:23 +00:00
Wez Furlong c151016472 lruttl: add consistency/robustness check
In our thundering herd protection we intentionally limit the number of
pending lookups for a given key to just 1.  That is controlled via
a semaphore.

We have pre-existing logic that checks to see if the semaphore has been
closed (eg: by a task being cancelled), but despite this, we do
occasionally have reports from users with `timed out after 120s on
semaphore acquire while waiting for cache to populate` for the shaping
data cache.

This typically correlates with eg: long IO waits due to eg: a spike in
transient failures and usually some sort of logging of headers, but not
always.

The not always situation bothers me as we don't currently have a good
explanation of what might be causing the excessive delay.

This commit adds an additional sanity check: when a new lookup is
initiated, if the semaphore is still open (not cancelled), but has been
open for longer than the populate timeout, then we treat this similarly
to the semaphore being closed: we'll create a new semaphore, reset the
expiration and the caller will typically then promote itself to the task
that will satisfy the lookup.

The side effect of this all waiters should become unblocked and awake
either with an error status or with the result of the new lookup, which
should help to clear any persistent/recurring blocking state associated
with this.

This change doesn't provide more insight (I have something in mind for a
follow-on commit for that), but should help make forward progress.
2026-03-11 15:19:23 +00:00
Wez Furlong 2658c8616e refactor: move ShuttingDownError into lifecycle
This centralizes a little bit of logic and makes things a hair cleaner.
2026-03-11 15:19:23 +00:00
Wez Furlong 50dececf3c lifecycle: add label to Activity::get error case
Continuing thread from prior commit, improve the context we
show during shutdown.

Take the opportunity to switch Mutex to parking_lot which is
slightly faster and doesn't have the warty unwrap() API
surface.
2026-03-11 15:19:22 +00:00
Wez Furlong 1f0fc9a26d log hooks: add more error context
We may log things like this during shutdown:

```
logging-3 kumod::logging::hooks: Error while calling should_enqueue_log_record: shutting down
```

but it isn't clear which part of the operation is sensitive to the
shutdown situation, so adding some context may help focus attention.
2026-03-11 15:19:22 +00:00
dependabot[bot] 72e3c03af2 build(deps): bump actions/upload-artifact from 6 to 7
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 6 to 7.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v6...v7)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-09 11:07:45 +00:00
dependabot[bot] 901857bae2 build(deps): bump actions/download-artifact from 7 to 8
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 7 to 8.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/v7...v8)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-version: '8'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-09 11:07:36 +00:00
Wez Furlong 21548eba0e mx_list_refresh: fix a test flake 2026-03-09 09:44:16 +00:00
Wez Furlong 359405d77c integration-test: fixup a test flake 2026-03-09 09:01:01 +00:00
Wez Furlong 8958935426 cargo update 2026-03-09 08:49:36 +00:00
Wez Furlong 57a7b5e425 update rust-openssl to dane-openssl-v0.10.75 2026-03-05 17:19:52 +00:00
Wez Furlong e4594e8550 sources.lua: fix defining empty egress pools
The example in the FAQ does this but it did not validate because the
associated structure was not defined, because there were no sources
in the pool!

Fix up the logic to allow creating an empty pool.

https://docs.kumomta.com/faq/how_do_i_create_an_always_suspended_queue/
2026-03-05 16:57:51 +00:00
Wez Furlong 654f9b88f5 new: ip_lookup_strategy option in make_egress_path
This provides control over IPv4 and IPv6 lookups based on the source
and/or destination.
2026-03-04 16:33:32 +00:00
Wez Furlong 4eef49df3c docs: remove suspended option from docs
This was removed from the product over a year ago in
16fb1ae316
2026-03-04 15:14:50 +00:00
Wez Furlong 332595ee2a queue.lua: add typing to setup methods
We had an issue where a typo resulted in a relatively inscrutable
error at runtime:

```lua
local queue_helper =  queue_module:setup ('/opt/kumomta/etc/policy/queues.toml')
```

produced this:

```
problem initializing: call validate_config callback: runtime error: /opt/kumomta/share/policy-extras/queue.lua:602: bad argument #1 to 'for iterator' (table expected, got nil)
stack traceback:
        [C]: in function 'next'
        /opt/kumomta/share/policy-extras/queue.lua:602: in function </opt/kumomta/share/policy-extras/queue.lua:551>
Error: Initialization raised an error: call validate_config callback: runtime error: /opt/kumomta/share/policy-extras/queue.lua:602: bad argument #1 to 'for iterator' (table expected, got nil)
stack traceback:
        [C]: in function 'next'
        /opt/kumomta/share/policy-extras/queue.lua:602: in function </opt/kumomta/share/policy-extras/queue.lua:551>
```

with the changes in this commit we'll present this issue like this,
during server startup, which points a little more clearly at the setup
call and the file names parameter, and suggests more strongly that it
should be a list of strings (or config objects):

```
    runtime error: [string "./simple_policy.lua"]:52: assets/policy-extras/queue.lua:463 QueueHelperSetup: invalid value for field 'file_names'
    assets/policy-extras/queue.lua:463 Expected value of type 'list<variant<string,QueueHelperConfig>>' but got type 'string' '/opt/kumomta/etc/policy/queues.toml'
    stack traceback:
        [C]: in function 'error'
        assets/policy-extras/typing.lua:78: in method 'raise'
        assets/policy-extras/typing.lua:249: in metamethod 'newindex'
        assets/policy-extras/typing.lua:258: in function <assets/policy-extras/typing.lua:253>
        (...tail calls...)
        assets/policy-extras/queue.lua:463: in function 'policy-extras.queue.setup_with_options'
        (...tail calls...)
        [string "./simple_policy.lua"]:52: in main chunk
```

this change actually surfaced a minor issue in the ndr.lua file that is
part of an integration test, as well as in my adhoc simple_policy file.
2026-03-04 09:23:08 +00:00
Wez Furlong 030520b04c docs: update changelog for stable release 2026-03-04 08:05:09 +00:00
Wez Furlong 93e8e7dd01 docs: update since('dev') macros for stable release 2026-03-04 08:03:21 +00:00
Wez Furlong 7a18a11e48 add helper script for cutting a release
This saves me some time updating the docs, and is more important
now that we use that since macro in rust crate source too.
2026-03-04 08:01:10 +00:00
Wez Furlong bb93ecb17e log_record.md: add a couple of missing log record types 2026-03-04 07:47:07 +00:00
Wez Furlong b3c72e97d3 log_record.md: note about how size can be reported as zero 2026-03-04 07:40:57 +00:00
Wez Furlong e4650a22e5 docs: fix minor typo in access_control.md 2026-03-04 07:39:05 +00:00
Wez Furlong ead20faa0f tsa: ensure that we have the status endpoint in the default ACL 2026-03-03 19:39:20 +00:00
Mike Hillyer c4c161543f Typo. 2026-03-03 13:53:31 -05:00
Wez Furlong 7d521fd493 docs: clarify enable_mta_sts 2026-03-03 17:19:25 +00:00
Wez Furlong 0e329c134f rustfmt
nightly rust changed how pub use imports get formatted,
do a sweep to get those changes reflected in main.
2026-03-02 15:42:27 +00:00
Wez Furlong d489f738f3 fix an issue around mx_list and config refreshing
If you have two scheduled queues with the same mx_list and then one of
those domains is updated to use a different mx_list, depending on the
ordering of the updates and subsequent traffic, the changed domain may
continue to have traffic route through the old mx_list.

The reason for this is that protocol configuration for that egress path
comes from the scheduled queue configuration, and there is no explicit
dependency between the two pieces of configuration.

This commit resolves this by adding a sanity check that the protocol
information is consistent with the ready queue instance.  If it is no
longer consistent we'll remove the association between the rq name and
the instance, then wind down any associated dispatchers.
2026-03-02 15:13:01 +00:00
Aditya Ganti f0e48bdb27 dkim: fix wrapping issue
It was reported that AWS SES could mark the DKIM signature as failed
when using a specific combination of headers in the header list,
with specific lengths of the other fields.

The reason for this is that we had two passes of wrapping applied
to the header, and they might not agree on the formatting of
the header.

The solution is to remove the second pass and just take a bit more
care to emit the header in a wrapped form in the first instance,
that way there can be no discrepancy or conflict.

closes: https://github.com/KumoCorp/kumomta/pull/483
2026-02-28 08:17:09 +00:00
Wez Furlong 04076707ec http injection: template errors are now reported with status 422
As part of this, we move template compilation to happen before
we queue up deferred generation; the compilation step should
be plenty fast enough that we can reasonably do that synchronously
and report any compilation errors back to the peer.
2026-02-25 14:25:38 +00:00
Wez Furlong 5bb60b06d0 smtp_dispatcher: improve handling of unilateral disconnects
The goal is to treat peer-initiated-unilateral-disconnects as being
somewhat equivalent to the way that we would idle out the connection if
we had no messages for it, on the supposition that the most likely
cause of a disconnect in between command verbs that we send is that
the peer decided that we were idle too long.  That isn't the only
possible reason, but it is the motivating example.

For the idled-out case we should close the current session and
have our message(s) go out on a separate session.  We don't want
to try the next host in the connection plan in case we're talking
to some kind of honey pit configuration where only the first
MX in the plan is valid, and even talking to a secondary can
harm your ability to send to the first in the future.

Handling this is a little tricky because we need to take care of
the distinction between getting a unilateral before or after
we've attempted to send a message.

In the before-case we don't want to blindly assume that we should start
a new session because that would mean that a persistent issue on the
first MX would have us spinning our wheels trying new connections only
to the first MX over and over.

This commit adds a couple of integration tests that contrive situations
where we exercise some pertinent cases.

refs: https://github.com/KumoCorp/kumomta/pull/482
2026-02-25 13:26:17 +00:00
Wez Furlong b018f8f128 machine-info: add docs/examples to jsonschema 2026-02-24 13:59:18 +00:00