Commit Graph
3871 Commits
Author SHA1 Message Date
dependabot[bot] a0edea99ef build(deps): bump docker/build-push-action
Bumps the github-actions group with 1 update in the / directory: [docker/build-push-action](https://github.com/docker/build-push-action).


Updates `docker/build-push-action` from 7.3.0 to 7.4.0
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](https://github.com/docker/build-push-action/compare/v7.3.0...v7.4.0)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-version: 7.4.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-10-01 09:56:06 +00:00
Wez Furlong dd0e241620 docs: changelog for 2026.09.29-b90d8bc1 2026-09-29 10:30:27 +01:00
Wez Furlong b2e94ac370 docs: prep for release
```
./assets/find-since-dev.sh 2026.09.29-b90d8bc1
./docs/build.sh
```
2026-09-29 10:28:24 +01:00
Wez Furlong b90d8bc1f3 mailparsing: Handle invalid multipart boundaries gracefully
The prior commit focused on avoiding a panic when we encountered an invalid
boundary string.  This commit makes thing degrade more gracefully: we'll
treat the bad MIME part in the same way that we deal with overly deep nesting
and handle it as an opqaque leaf part.

The new_multipart constructor now rejects an invalid boundary rather than
building an unserializable part, so a flawed policy can't accidentally create
broken messages.
2026.09.29-b90d8bc1
2026-09-29 10:22:18 +01:00
Wez Furlong 3e313ae8cd mailparsing: prevent panic on messages with empty multipart boundary
to_message_bytes now propagates errors instead of panicking. check_fix_conformance
and the HTTP injection API now report this error directly, and DSN generation
omits the original message when it cannot be serialized.
2026-09-29 10:22:18 +01:00
Wez Furlong b0bb1174d5 spf: fix silent incorrect matching for /0 and out-of-range CIDR lengths
/0 prefixes now correctly match all addresses. Invalid overlong prefix lengths
are rejected at parse time instead of silently producing wrong masks (or, in
debug builds, a panic).
2026-09-29 10:22:17 +01:00
Wez Furlong 55efb06ceb spool: reject non-v1 UUIDs when constructing a SpoolId
A malformed or forged `id` in an xfer payload could panic kumod, since
spool ids are assumed to always be v1 UUIDs with an embedded
timestamp. Every construction path now rejects anything that isn't
v1.
2026-09-28 14:04:31 +01:00
Wez Furlong c1daddcbe3 mailparsing: bound MIME nesting depth to prevent stack overflow
Deeply nested multipart content is now retained as an opaque part with
its headers parsed and raw body preserved once nesting passes 100
levels, instead of recursing until the process stack overflows.

Those messages are tagged with the new MIME_NESTING_LIMIT_EXCEEDED
conformance flag.
2026-09-28 14:04:31 +01:00
Wez Furlong 0dbd600a3f mailparsing: fix stack overflow on deeply nested header comments
The RFC 5322 comment parser recursed once per nesting level, so a header
with thousands of nested parentheses could exhaust the stack and crash
the process. It now tracks nesting depth with an explicit loop instead.
2026-09-28 14:04:30 +01:00
Wez Furlong f2d68e3f37 smtp: fix line length checks for bare LF/CR when allowed
When `invalid_line_endings` is set to Fix or Allow, correctly measure line
lengths even when messages use bare LF or CR instead of CRLF. Previously
such messages were incorrectly rejected as having overlong lines.
2026-09-28 13:21:21 +01:00
Wez Furlong b459200721 rfc3464: stop embedding full message in error context
In most cases this error context was discarded, but if your policy
script triggered an explicit parse, you might see the error context in
the lua error that it would trigger in that case.  Since it was not very
useful (and was wasteful) we now simply report the input message size
for the context instead.  The actual parse error is still the primary
reason in the error chain, so this is not a loss in information.
2026-09-28 13:21:21 +01:00
Wez Furlong bf23b5a66b mailparsing: Cap header count per block at 1000
Bounds memory amplification from crafted messages with many minimal short
headers, which previously consumed far more resident memory than their
wire size would suggest.
2026-09-28 13:21:21 +01:00
Wez Furlong 9ac0715b1d mailparsing: Remove quadratic work for MIME headers with many parameters
Fix O(N^2) CPU usage when rebuilding messages with many MIME parameters.
Decoding the parameter map, re-emitting the header, and merging original
parameters back into the rebuilt header were each quadratic. Duplicate
parameters now use consistent last-wins semantics.
2026-09-28 13:21:20 +01:00
Wez Furlong c2f748bd67 smtp_server: fix quadratic CPU usage when normalizing line endings
Avoid quadratic work for messages with many malformed line endings when using
`invalid_line_endings="Fix"`. Remove the in-place implementation entirely to
prevent future accidental use.
2026-09-28 13:21:20 +01:00
Wez Furlong 91a657c96a mailparsing: Block header injection in Authentication-Results encoding
Strip control characters from all values when encoding Authentication-Results
and ARC headers. This prevents sender-controlled values from embedding raw
CR/LF to forge headers or push trusted results into the message body.

closes: https://github.com/KumoCorp/kumomta/pull/523
2026-09-28 13:21:20 +01:00
Wez Furlong bd502355bb mta-sts: clamp max_age and guard against time addition overflow
Prevent unauthenticated remote attackers from crash looping kumod by publishing
an MTA-STS policy with an excessively large max_age value.
2026-09-28 13:21:20 +01:00
Wez Furlong 273c0996c0 kumo.fs: fix panic when glob uses absolute path with **
Avoid process abort when kumo.fs.glob is passed an absolute pattern
containing a recursive wildcard.  This was an issue in the upstream
filenamegen crate, resolved in the latest release.

closes: https://github.com/KumoCorp/kumomta/issues/578
2026-09-28 13:21:19 +01:00
Wez Furlong 399a25c304 mailparsing: Preserve Content-Disposition headers on text parts during rebuild
This maintains attachment status and filenames for calendar invitations
after conformance fixes. Completes the parameter merge logic added in
29a99b66 which only handled existing headers.

Closes: https://github.com/KumoCorp/kumomta/issues/604
Closes: https://github.com/KumoCorp/kumomta/issues/584
2026-09-28 13:21:19 +01:00
Wez Furlong c3582bbbaa check_fix_conformance: Fix multipart corruption when adding headers
Fix broken DKIM signatures and unreadable messages that occurred when
adding missing headers to multipart mail with leading blank lines or
preamble text.

closes: https://github.com/KumoCorp/kumomta/issues/607
closes: https://github.com/KumoCorp/kumomta/pull/540
2026-09-28 13:21:19 +01:00
Wez Furlong f3dcf46a85 dkim: Fix remote DoS from crafted DKIM signatures during verification
This fixes two vulnerabilities reachable via msg:dkim_verify() on inbound
mail: an out-of-bounds read panic on very short b= tags, and the anti-DoS
cap now correctly bounds all parsed signatures, not just parse failures.
2026-09-28 13:21:18 +01:00
Wez Furlong 49a2783772 mailparsing: Fix integer underflow when encoding very long MIME parameter names
This avoids panic and infinite loop, and produces valid folded output
instead of corrupt fold widths.

Fixes: #608
2026-09-28 13:21:18 +01:00
Wez Furlong 8156846567 inject: emit user-supplied address headers through the address grammar
Address headers in the HTTP inject API's generic `headers` map (`Cc`, `To`,
etc.) were emitted as unstructured text.  When they contained non-ASCII
content, the entire value (as opposed to just the display name) would
be qp-encoded, producing an invalid header.

closes: https://github.com/KumoCorp/kumomta/pull/598
2026-09-28 13:21:18 +01:00
Wez Furlong 3b44bafadc inject: defer content.from/content.reply_to encoding until after templating
normalize() previously encoded the from/reply_to display name into a
Mailbox before the template engine ran. That allowed a substituted value to
splice a second mailbox into the header, since the templated name was
concatenated into an already-encoded string rather than escaped as a unit.
The raw name is now templated first and encoded afterward, over the
assembled Mailbox.

refs: https://github.com/KumoCorp/kumomta/pull/598
2026-09-28 13:21:18 +01:00
Wez Furlong be6cff1909 mailparsing: rewrite bare CR/LF in a display name to a space
quote_string passed a CR or LF straight through into a quoted display name.
that would terminate the header line early, causing the subsequent bytes
to appear as a separate injected header.

This has been resolved, taking care to preserve legitimate folding.
2026-09-28 13:21:17 +01:00
Wez Furlong 98df321f88 mailparsing: fold long mailbox display names at the addr-spec boundary
Mailbox::encode_value now folds between the display name and `<addr>`,
treating both as atomic, instead of leaving callers to whitespace-wrap
the whole encoded mailbox. That whitespace wrap could fold inside a
quoted display name and corrupt it.
2026-09-28 13:21:17 +01:00
Wez Furlong 5698c0e9ea kumod: add a characterization test for from/reply_to templating
Add a test asserting that content.from and content.reply_to's display
names undergo per-recipient template substitution.
2026-09-28 13:21:17 +01:00
Wez Furlong 2736059965 mod-mimepart: unify header.value onto ParsedHeader
Route the Lua `header.value` field getter through
`Header::structured()`, eliminating the duplicate name-to-parser
`NAME_GETTER` table.

`Date` continues to return the raw header string for backwards
compatibility.
2026-09-28 13:21:16 +01:00
Wez Furlong d2f31b4fdf mailparsing: emit MIME-Version with its RFC 2045 canonical spelling
Headers were built and rebuilt as "Mime-Version" rather than
"MIME-Version". Both are valid per RFC 2045, but some spam filters,
such as rspamd, score the mixed-case form as a deliverability signal.
Fix the header name in the accessor macro and in ParsedHeader's
grammar table, the places that spell it, and update the snapshot
tests across mailparsing, message, kumo-log-types, mod-mimepart, and
kumod that captured the old spelling, along with the reference docs
that showed the old casing in their examples. #564
2026-09-28 13:21:16 +01:00
Wez Furlong b3fb13b5fa mailparsing: unify header parsing behind a name-driven ParsedHeader type
Add `ParsedHeader`, which parses a header's raw bytes using the grammar
implied by its name (mailbox list, address list, date, MIME parameters,
and so on) and re-encodes it back to canonical form. `Header::rebuild()`
now goes through this lookup instead of a hand-written table, which
also fixes `Authentication-Results`: it was falling through the old
table's unstructured fallback and being left as free text instead of
being parsed and re-encoded like the other structured headers.
2026-09-28 13:21:16 +01:00
Wez Furlong b5bcff1542 kumo-wrap: fix hard-wrap to split multi-byte words on char boundaries
wrap() hard-wrapped an over-long word byte by byte, which could slice a
multi-byte UTF-8 sequence in half and panic when the result was
validated as UTF-8. Walk the word in UTF-8 chunks instead, splitting
only between whole characters and passing invalid byte runs through
unchanged.
2026-09-28 13:21:15 +01:00
cargo-dependency-cooldown[bot] 9c1f2afc0f deps: update Cargo.lock via cooldown 2026-09-28 12:59:42 +01:00
Wez Furlong bb74f3857c kumo-jsonl: skip only oversized records, not whole segments
When a record exceeds the configured max_line_size, discard just that record
and continue reading the rest of the segment instead of aborting the entire
segment.
2026-09-28 09:57:52 +01:00
Wez Furlong d56fd68ef9 kumo-jsonl: Fix silent data loss for records larger than 128KiB
The zstd decompression buffer now grows on demand to read records up to
a configurable 128 MiB cap.  Oversized records are rejected explicitly
both on read and write, with matching limits so all written records are
guaranteed readable.
2026-09-28 09:57:52 +01:00
Wez Furlong 81280f37ca Create SECURITY.md 2026-09-28 09:32:55 +01:00
Wez Furlong aedcdd9993 docs: update for 2026.09.22-a276d4a8 2026-09-23 15:29:18 +01:00
Wez Furlong d9851e3e02 update dev -> 2026.09.22-a276d4a8
Update docs for new stable tag

```
./assets/find-since-dev.sh 2026.09.22-a276d4a8
./docs/build.sh
```
2026-09-23 15:26:24 +01:00
Wez Furlong a276d4a8f5 ci: build Rocky Linux 9 packages for aarch64
Add an aarch64 entry to the build-rocky matrix so we produce Rocky 9
RPMs for arm64, using the aarch64 Rocky 9 builder image that already
exists.
2026.09.22-a276d4a8
2026-09-22 11:51:15 +01:00
Wez Furlong d689965966 rustfmt 2026-09-21 20:20:54 +01:00
Wez Furlong 3a88e3c883 spool: fix rocksdb load-shedding gate never reopening after a single-signal error
The gate could latch permanently when only one of the two error signals
(foreground or background) ever moved, requiring an operator restart. It now
auto-reopens for a retry after `error_unlatch_duration`, regardless of which
signal latched it.

Also serializes foreground error reporting with gate transitions so a
concurrent fatal error cannot be undone by a reopen, and rejects a zero
`error_unlatch_duration` when automatic reopening is enabled. The underlying
cause is always logged. Adds a reusable LD_PRELOAD fault-injection crate and
integration tests that reproduce a full disk and a slow disk to drive the
latch-and-reopen cycle end to end.

Fixes #597
2026-09-21 20:16:32 +01:00
cargo-dependency-cooldown[bot] eddc89aa36 deps: update Cargo.lock via cooldown 2026-09-21 13:39:56 +01:00
Tom Mairs 00df937be2 remove trailing dot 2026-09-18 13:59:51 +01:00
cargo-dependency-cooldown[bot] 68da6d9b61 deps: update Cargo.lock via cooldown 2026-09-15 10:45:02 +01:00
Wez Furlong b2de451163 mailparsing: escape literal underscore in Q encoded headers
A literal underscore in a header value that needed RFC 2047 Q encoding was
emitted unescaped, so a conforming mail client decoded it back to a space
and silently corrupted the header. Underscores are now escaped as =5F, and
the Q encoder passes through only the punctuation RFC 2047 permits unencoded
in a phrase.
2026-09-10 13:58:53 +01:00
Wez Furlong 4490208918 docs: add glossary to nav 2026-09-08 07:44:47 +01:00
Wez Furlong 2303a3c038 docs: format code examples 2026-09-08 07:43:52 +01:00
Mike Hillyer 61f91a2395 Initial commit of glossary. 2026-09-01 15:31:35 -04:00
Wez Furlong 2a40536127 ci: disable workspace lints in docs docker build
This is a bit of a hack, but should hopefully fix up the doc build
2026-08-27 23:15:28 +01:00
Wez Furlong 9ff30af0a5 mod-http: fix pairs() header iteration hang
Iterating a response's headers with pairs() looped forever when a header name
repeated, which could happen for example with multiple Set-Cookie headers.
2026-08-27 18:00:41 +01:00
Wez Furlong d5461cdae4 rustfmt 2026-08-27 14:40:31 +01:00
Wez Furlong f9b50adcea clippy: forbid direct use of chrono's rfc2822 date functions
We have mailparsing wrappers that format and parse rfc2822 dates without
panicking on out-of-range values or rejecting the obsolete timezones that
real senders emit. This moves every existing caller onto those wrappers and
adds a clippy lint that requires them in place of chrono's versions.
2026-08-27 14:38:48 +01:00