Commit Graph

567 Commits

Author SHA1 Message Date
Wez Furlong 5fb9dd104d fix regression in serializing original_message in ARF
This got overlooked around the time that 7518ca6de was pushed.
The intent was to serialize as a string when possible, bytes otherwise.
2026-05-29 09:45:22 +01:00
Wez Furlong 5a7aa96cf1 docs: update for 2026.05.12-a6845223 release 2026-05-27 06:47:55 +01:00
Wez Furlong 62de291279 docs: suggest folks prefix their metadata names
Should help to avoid possible conflicts with the core metadata names.
2026-05-12 14:35:16 +01:00
Harsh Jha 7cba56bc06 http injection: allow static per-recipient metadata
That metadata is accessible in to via msg:get_meta('extra')

closes: https://github.com/KumoCorp/kumomta/pull/516
Co-authored-by: Wez Furlong <wez@wezfurlong.org>
2026-05-12 14:25:46 +01:00
kay ozaki 1febfcc55e lua counter series using kumo-counter-series
Co-authored-by: Wez Furlong <wez@wezfurlong.org>
closes: https://github.com/KumoCorp/kumomta/pull/507
2026-05-07 15:35:17 +01:00
Wez Furlong 2c0e9982e1 docs: fmt examples in import_headers.md 2026-05-07 14:25:34 +01:00
Oleg Orekhov c237e16c5f mod-http: allow disabling certificate verification on the client
closes: https://github.com/KumoCorp/kumomta/pull/504
2026-05-07 14:18:09 +01:00
Wez Furlong 421b8a289e proxy: keepalive will work on macos and other unix too
So remove the linux only gate
2026-05-06 22:38:50 +01:00
Jack c4dbaa743b proxy-server: add tcp_keepalive option
Some upstream peers (e.g. QQ Mail's rate-limiter) silently hold a
proxied TCP connection open indefinitely — sending no data, FIN, or RST
— rather than cleanly refusing.  Without some kind of timeout
management, the two file descriptors for such a session remain open for
the lifetime of the process, slowly exhausting the kernel's
file-descriptor table and occupying proxy-server worker slots.

This commit configures kernel level keepalive options with reasonable
defaults to detect and close out this class of connection.

Co-authored-by: Wez Furlong <wez@wezfurlong.org>

Closes: https://github.com/KumoCorp/kumomta/pull/509
2026-05-06 21:09:10 +01:00
Wez Furlong ee1e5b980e message: add msg:import_headers, a flexible alternative to import_x_headers
import_headers takes an array of per-spec option tables, each describing
how a single header name or pattern should be imported into the message
metadata. Compared to import_x_headers it adds:

 * Trailing-`*` wildcard patterns (e.g. `X-*`) alongside exact names.
   Bare/leading/interior wildcards are rejected at compile time.
 * `match` of `first`, `last` (default), or `all`. `all` captures every
   matching header instance as an array of strings; the others capture
   a string. Specs that produce no matches write nothing.
 * `transform` selects the metadata key style: `snake_case` (default,
   matches the existing import_x_headers behavior), `kebab_case`,
   `camel_case`, or `pascal_case`. Header matching itself is always
   case-insensitive.
 * `target` overrides the metadata key for exact-name specs.
 * `remove` strips the matched headers from the message body in a
   single follow-up pass.

When more than one spec could match a header, the first matching spec
wins, so callers can place specific rules ahead of a wildcard catch-all.

import_x_headers now delegates to import_headers, so its behavior is
unchanged and the two share a single implementation.

retain_headers now passes the header index alongside the &Header to its
closure, which import_headers uses for its post-pass removal step
instead of tracking a parallel counter. Existing callers that don't
need the index ignore it with `_`.

Closes: #515
2026-05-06 16:30:36 +01:00
Wez Furlong 37236c40b1 docs: update for the 2026.04.09-ea3b2a9b release 2026-04-29 08:07:13 +01:00
Wez Furlong ea87ea6ab3 make HeaderAddress localpart consistent with EnvelopeAddress
This was previously just returning everything before the final at-sign.
Now we use the same parsing approach and return the normalized local
part.

This is technically a breaking change, but it is minor and improves
the overall state of things.
2026-04-09 15:42:40 +01:00
kayozaki dc1cf4a93a Adding kumo.fs.stat to get file/dir meta data (#497) 2026-04-04 19:52:12 +01:00
Wez Furlong 7d89393b8c docs: Add webhook processing examples using kumo.jsonl 2026-04-04 12:09:36 +01:00
Wez Furlong 9a77373136 add batched webhook examples using kumo.jsonl 2026-04-04 11:45:42 +01:00
Wez Furlong eebfd3aa56 kumo.jsonl: add some basic docs 2026-04-04 11:14:48 +01:00
Harsh Jha f08b184037 feat: pre-define to_header substitution in HTTP injection API
Pre-populate a `to_header` template substitution with the default
formatted `To` header for each recipient. Users can reference it via
`{{ to_header }}` and override it per-recipient in substitutions.

closes: https://github.com/KumoCorp/kumomta/pull/501
2026-04-01 08:17:12 +01:00
kay ozaki 77a8e951c5 mod-string: add ends_with, starts_with
closes: https://github.com/KumoCorp/kumomta/pull/498
2026-03-31 15:23:49 +01:00
Wez Furlong 937611feb9 rfc5321: improve handling of quoted local parts in envelope addresses
This commit refactors the EnvelopeAddress types(!) so that the brains
of them are centralized in the rfc5321 crate, removes the one from
the log-types crate, and replaces the internals of the one in the
message crate with the rfc5321 implementation.

This revised implementation accommodates quoted local parts more
consistently and exposes the local part via a normalizing accessor which
is in turn used when comparing addresses for equality.

This means that `"foo"@` and `foo@` now compare the same, and if you
have setup a maildir that generates per-user maildirs, we'll use the
normalized form of the local part rather than whatever is on the
incoming address.

Another side effect of this commit is that we can now accept exotic
quoted addresses like `"info@"@example.com` without falsely complaining
about having too many `@` signs in the address.

closes:  https://github.com/KumoCorp/kumomta/issues/495
2026-03-28 07:20:35 +00:00
Wez Furlong 8cb8b3fa7e new: kumo.encode.charset_decode/kumo.encode.charset_encode
These are more immediately useful to me for writing tests, but are
generally useful when you have a policy that might need to to deal
with legacy encoding schemes more directly.
2026-03-28 07:20:34 +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
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 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 93e8e7dd01 docs: update since('dev') macros for stable release 2026-03-04 08:03:21 +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
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 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 b018f8f128 machine-info: add docs/examples to jsonschema 2026-02-24 13:59:18 +00:00
Wez Furlong d8a7b0170e add new cpu usage metrics
refs: https://github.com/KumoCorp/kumomta/issues/186
2026-02-24 12:19:54 +00:00
Wez Furlong 9bd3a5da23 introduce kumo-machine-info crate
This crate queries machine/system information which is intended
to be used in system monitoring.

This information is not centrally collected or retained by kumocorp,
merely reported via an API endpoint which is accessible only to trusted
IPs.

Machine info tries to interrogate information about the running/hosting
cloud platform for the major cloud providers, as well as indicate
whether it is running in a container of some kind.

The full cloud information is not re-exported via the API endpoint at
this time, but a fingerprint that encodes things like the instance-id is
included.
2026-02-24 12:19:53 +00:00
Tobias Horst 719e140f0e mod_nats: integrate nats
Publish messages using the jetstream client.
Supports password and token authentication.

Co-authored-by: Wez Furlong <wez@wezfurlong.org>
Closes: https://github.com/KumoCorp/kumomta/pull/449
2026-02-24 11:03:43 +00:00
Wez Furlong 80decbc08e redis: add redis_operation_latency histogram
This enables tracking the latency and status of redis operations.
2026-02-20 08:15:09 +00:00
Wez Furlong 5f7fae1d6b tsa: add basic /tsa/status endpoint
This simply returns a 200 response and can be used to determine
that TSA service is up.
2026-02-20 06:51:23 +00:00
Wez Furlong 1690e6526a refactor: move start_proxy_listener to proxy module
We're keeping a reference to it via kumo.start_proxy_listener briefly,
just in case someone is using that live somewhere.

We don't need to changelog this, as this whole feature hasn't
been in a stable tag yet.

refs: https://github.com/KumoCorp/kumomta/pull/472
2026-02-06 07:31:30 +00:00
Wez Furlong 37111c8036 add auto-gen docs for proxy-server http api and metrics
refs: https://github.com/KumoCorp/kumomta/pull/472
2026-02-06 07:11:56 +00:00
Aditya Ganti f898e2a7e6 Add Prometheus metrics to proxy-server
Co-authored-by: Wez Furlong <wez@wezfurlong.org>

closes: https://github.com/KumoCorp/kumomta/pull/472
2026-02-06 07:11:27 +00:00
Wez Furlong 4f636a0fae skip_hosts: downgrade to a transient failure
This is a conceptually breaking change, but shouldn't be harmful
in practice.

Recently, Microsoft hosted domains have had a number of incidences where
the DNS stopped returning IPv4 addresses, which lead to systems that
employ skip_hosts to disable their IPv6 addresses (presumably due to
difficulties in warmup and reputation) to trigger the terminal case
where we would sweep the ready queue away as a permanent routing
failure.

In the context of a transient failure to route ipv4 the permanent
disposition was surprising and unwanted so it feels better to make
the effect of this situation more closely map to how we handle the
case where no MX records are returned.
2026-02-04 13:12:14 +00:00
Wez Furlong 87b64c8d2b docs: flesh out docs for a number of metrics
Give some suggestions on how to interpret a number of the metrics,
as well as cross linking to relevant documentation for them.
2026-02-04 11:45:11 +00:00
Wez Furlong 5efbc8d7c3 docs: link to metrics index from http metrics endpoint docs 2026-02-04 09:10:25 +00:00
Wez Furlong 66e5aa5508 docs: generate a page for each exported metric 2026-02-04 09:10:25 +00:00
Wez Furlong 828eb68017 tsa: fixup json schema
This makes it possible to load the schema with utoipa's parser.
This will be useful in the next commit which adds generated
docs to the doc build.
2026-02-03 12:23:17 +00:00
Wez Furlong 5d8708daa9 docs: fix typo in the xfer injection endpoint docs 2026-02-03 08:29:11 +00:00
Wez Furlong a1014b952f docs: recurse into anyof elements in jsonschema
This allows showing eg: the XferProtocol::target field inline in the
xfer docs.
2026-02-03 08:29:11 +00:00
Wez Furlong c5a6a1fb00 Adjust docs based on code review 2026-02-03 08:29:00 +00:00