Commit Graph

500 Commits

Author SHA1 Message Date
Wez Furlong d6eb5176ad docs: remove rapidoc HTTP explorer
It has been replaced by our own static generation.
2026-01-30 16:37:12 +00:00
Wez Furlong 255a3c66bc docs: flesh out more of the JSON Schema metadata 2026-01-30 16:23:46 +00:00
Wez Furlong 4bdbf4c58f remove dead code
This `Header` type was unused except for being exported into
the JSON schema, where it was also unreferenced.
2026-01-30 15:53:09 +00:00
Wez Furlong bd4e3f72c8 docs: add jsonschematodocs utility
We currently use a rather hacky embedding of rapidoc to provide a
generic browser around the jsonschema export from our API interface.

It's not great for a couple of reasons:

* The font sizes are tiny
* The documentation rapidoc produces is not indexable, being
  generated by javascript when the browser loads.  This also
  prevents making proper links to the various doc pages

This commit introduces a little utility that we can use during
the doc build to translate the schema into documentation files
that can then be processed as normal by the build.

This commit does this just for kumod at this time, but we could
also add tsa daemon in the future if we expand its API surface.
2026-01-30 15:43:09 +00:00
Wez Furlong c3d48af8f3 jsonschema: refine some metadata
These annotations allow the jsonschema to round-trip through the
utoipa json schema parser, which is important for a follow up
commit that will facilitate improved docs.
2026-01-30 08:13:06 +00:00
Wez Furlong 524fdd87af docs: add tags to kcli commands
This helps link together related things in the docs
2026-01-28 12:49:32 +00:00
Wez Furlong 549e9c611d add per-message xfer functionality
This commit adds a new kumo.xfer module that allows configuring or
cancelling xfer on a per-message basis.
2026-01-28 12:49:06 +00:00
Wez Furlong d0e8e1e9db fix generating multiple To headers with http injection API
Previously, if setting `content.headers["To"]` we'd generate one header
for that value, and one for the per-recipient `To` header value.

We now check to see if the former is present; if so, we'll skip
generating the per-recipient `To` header value.
2026-01-23 12:19:53 +00:00
Wez Furlong baa1775fc2 docs: metrics: note about pruning out metrics
and adjust comment about authorization: now in `main`, it is possible to
change the default ACL if you desire.
2026-01-19 16:13:34 +00:00
Wez Furlong 74d95f81a6 docs: refine recent proxy server doc changes
refs: #459
2026-01-19 07:45:10 +00:00
Wez Furlong 2369162e75 proxy: flip no_splice to use_splice in proxy policy file
This option was named `--no-splice` on the command line because that
was the easiest UX there.  The negative logic makes it harder to
understand how to enable/disable, so let's flip it and default
use_splice=true.

refs: #459
2026-01-19 07:45:09 +00:00
Kevin Vu 8e832ad071 docs: add kumo.start_proxy_listener and changelog entry
Fixes #459
2026-01-19 07:45:09 +00:00
Kevin Vu c3ed6279d5 feat: add TLS and RFC 1929 auth to KumoProxy
Add TLS encryption and username/password authentication support for
the KumoProxy SOCKS5 server, with full Lua configuration capabilities.

Proxy Server Changes:
- Add kumo.start_proxy_listener() Lua function with TLS support
- Add proxy_server_auth_rfc1929 event for Lua-based auth validation
- Return AuthInfo from auth for ACL system integration
- Support optional and required authentication modes
- Maintain backwards-compatible legacy CLI mode (--listen, --timeout-seconds)

Breaking Changes:
- Cache renamed from rfc5321_rustls_config to rustls_client_config

Refs: #451
Closes: 459
2026-01-19 07:45:02 +00:00
Wez Furlong 1d8ce2bb74 http inject: add integration test for request_body_limit
This commit doesn't change any behavior, it just adds an explicit
test for exceeding request_body_limit, and expands on the docs
for request_body_limit to clarify the response when the limit
is exceeded.
2026-01-15 13:52:10 +00:00
Wez Furlong 5b20731ea4 docs: restore proper version for template_dialect
This was accidentally lost in 75debad675
2026-01-07 07:48:20 +00:00
Wez Furlong 885c4914ca docs: update openapi spec for amp_html 2026-01-07 07:46:27 +00:00
Mike Hillyer 75debad675 Updating headings in Inject API doc so that sidebar menu populates correctly. 2026-01-06 12:23:49 -05:00
Wez Furlong 0a112417c0 Add support for AMP in the message builder and injection APIs 2025-12-19 06:37:27 +00:00
Aditya Ganti af59493e00 Add aws_sign_v4 helper on kumo.http.Request (#458)
* Add aws_sign_v4 helper to kumo.http.Request and cross-link docs

Co-authored-by: Aditya Ganti <adityaganti@mac.mynetworksettings.com>
2025-12-18 07:14:36 -07:00
Wez Furlong 07ab3d44a3 inject+xfer: cut over to AuthInfo from AuthKind
Replace the older type with the newer one.

Serialize a copy of auth_info when handling deferred generation,
so that we have a lossless representation of that state when
we eventually process the request.  That doesn't change really
anything today, but will enable more granular ACL checks in
the future.

Pass the auth_info through to the http_message_generated and
xfer_message_received events to enable more granular access
control policies to be scripted.
2025-12-18 10:19:09 +00:00
Wez Furlong 5926112956 acct: add kumo.aaa.configure_acct_log
This function sets up the accounting log which records authentication
and authorization events to a local log file.

Add some test assertions that we're not seeing any failed authn/authz
in a number of integration tests.

Add explicit check for failed a request to kcli's streaming metrics
parser, which previously would ignore the request status.
2025-12-18 08:22:31 +00:00
Wez Furlong 3e85297fca authn: allow returning AuthInfo from smtp/http auth event callbacks
This commit allows the policy to return a richer representation of
the authentication information, which can include multiple identities
and group membership information.
2025-12-18 06:30:06 +00:00
Wez Furlong 4055c50522 authz: introduce an ACL facility
This commit is a step towards some general improvements around
our handling of authentication and authorization.

This commit is focused primarily on authorization, but there are
some adjustments to how we track authentication as part of enabling
that.

We now have a separate AuthInfo type that holds the overall
authentication information/context associated with an inbound
SMTP or HTTP session.

It is populated with the peer_address as a fact rather than a statement
of trust.

If authentication via the appropriate lua auth callback is successful,
then the AuthInfo has additional identities added.

There are some types and events for loading access control lists and
matching their rules against an AuthInfo.

There is now a system default ACL that is equivalent to the prior
hard-coded access policy that was encoded into each HTTP endpoint.

This change makes it possible to replace the ACL with a
user-defined ACL.

Later will be some work on authentication to allow more options
for HTTP auth.
2025-12-18 06:30:06 +00:00
Wez Furlong b551d6b4c7 docs: update for release 2025.12.02-67ee9e96 2025-12-02 11:11:05 +00:00
Wez Furlong 67ee9e96ea docs: mail_auth: dmarc is implemented and available 2025-12-02 10:54:29 +00:00
Wez Furlong c379a931a1 docs: fix typo 2025-11-27 17:18:11 +00:00
Wez Furlong 38a15fe891 docs: format aws_sign_v4
refs: https://github.com/KumoCorp/kumomta/pull/457
2025-11-25 13:16:20 +00:00
Aditya Ganti b96dd0843f Add AWS SigV4 signature module (#457)
* Add AWS SigV4 signature module

 - Implements complete AWS Signature Version 4 algorithm
 - Supports all AWS services (S3, SNS, SQS, Kinesis Firehose, etc.)
 - Includes SHA256 hashing and HMAC-SHA256 signing
 - Secure key management via KeySource (files, Vault, inline)
 - Session token support for temporary credentials
 - Comprehensive documentation and examples
 - 5 unit tests and 5 integration tests (all passing)

 Exposes kumo.aws.sign_v4() function to Lua for signing AWS API
 requests. This enables KumoMTA to integrate with AWS services for
 streaming logs to Kinesis Firehose, storing data in S3, sending
 notifications via SNS, and more.

 Tested with:
 - S3 GET/PUT requests
 - SNS POST requests
 - SQS with query parameters
 - Kinesis Firehose PutRecord

updating README.md file

Co-authored-by: Aditya Ganti <adityaganti@mac.mynetworksettings.com>
2025-11-25 06:14:48 -07:00
Wez Furlong 245221ae29 docs: clarify Time and TimeDelta
It wasn't clear that these pages were describing a class rather than a
literal object.

Add some more usage examples.
2025-11-20 15:26:42 +00:00
Wez Furlong 027e3e9f75 docs: wrap examples in normalize_smtp_response.md 2025-11-20 14:54:26 +00:00
Wez Furlong 7b240db3e1 docs: fix copypasta in smtp_server_rewrite_response page
It said smtp_CLIENT instead of server
2025-11-20 14:53:03 +00:00
Wez Furlong 2023aba6af docs: mention template dialect in injection and eval_template APIs 2025-11-20 14:50:15 +00:00
Wez Furlong 3781ff7d95 docs: format 2025-11-19 07:57:37 +00:00
Wez Furlong 6f53931fde add kumo.invoke_get_egress_(pool|source)
These functions are similar to the existing
invoke_get_egress_path_config and invoke_get_queue_config functions;
they return the configuration information that is defined by your
overall policy in the same way that the system does.

The intent is for more advanced policies that need that info to
decide how to configure other parts of the policy.

Docs are included, and I fleshed out the missing docs for the two
pre-existing functions.
2025-11-14 07:04:58 +00:00
Wez Furlong 4c89acae96 docs and changelog for require_proxy_protocol #440 2025-11-13 15:27:39 +00:00
Wez Furlong f2f792e74f kumo.digest: add various HMAC_SHAXXX functions 2025-11-13 12:06:32 +00:00
Wez Furlong fdd2276dfb mod-digest: switch from ring::digest to aws-lc-rs::digest
Switch away from ring to aws-lc-rs which API compatible and has support
for more digest algorithms.

Add support for all of the current algorithms.
2025-11-13 11:10:13 +00:00
Wez Furlong 26a0c86c49 Expose version number to lua via kumo.version
I'm surprised that we didn't already do this!
It allows phrasing the policy to accommodate different versions
of kumo.
2025-11-13 06:30:35 +00:00
Wez Furlong 4917ee6245 prohibited_hosts: add v4 and v6 any address
Saw an MX record that expands to 0.0.0.0 in the wild.

As well as being nonsense, that causes a mail loop, so we should add it
to prohibited_hosts.

I noticed that we also did not document its default value, so the
doc update here shows the before and after for this.
2025-11-10 15:09:11 +00:00
Wez Furlong d4028f9931 Add smtp response text normalizer 2025-11-09 08:09:51 +00:00
Wez Furlong ad8a858136 templates: add Handlebars dialect
This is fairly barebones: there are very few helpers at this time.

refs: https://github.com/KumoCorp/kumomta/issues/446
2025-11-09 07:53:20 +00:00
Wez Furlong e106c3d496 template: add Static engine
This engine does no templating; the source text is output exactly
as it was entered into the template engine.

Expose template_dialect to the http injection API and add a test
to show that selecting the Static dialect doesn't perform any
template expansion.

refs: https://github.com/KumoCorp/kumomta/issues/446
2025-11-09 07:53:19 +00:00
Wez Furlong 7ac9a5eac0 smtp_dispatcher: handle pathologic all-452 case
Continuing in the same vein as 94628f06ab,
ensure that we have a reasonable outcome when a batch of size > 1
encounters 100% ambiguous 452 responses.

Without special consideration we'd end up in an infinite retry loop for
these, as we'd think that we'd hit the recpient limit on the connection
every time.

This commit introduces a small amount of state into the dispatcher so
that we can remember the set of (spoolid, recipient) from the prior
transaction on the session.

When deciding whether something is eligible for immediate retry
we will gate that choice on the current (spoolid, recipient) being
absent from the prior set of ids.  In this way, we bound the immediate
retry for a recipient to one per connection.

To make things a bit more robust when trying to decide whether a 452
means "too many recipients" or not, if we're not sure, we now call out
to the bounce classifier which can be configured to emit a
`TooManyRecipients` classification.  If the classifier produces either
that or some non-Uncategorized response, then we have a confident
assessment.  Otherwise, we're unsure and will factor that into the
retry strategy.
2025-11-07 08:13:36 +00:00
Wez Furlong 4c6d7ca8ea add policy-extras.mail_auth module
This aggregates the various authentication-results producing auth checks
into a more convenient function.

Part of this change improves some plumbing in the dkim checking (we no
longer raise an error for a missing From, but instead indicate a failed
dkim result), and we now support passing down a resolver name to the
various checking functions, to facilitate testing and other more
advanced use cases.

refs: https://github.com/KumoCorp/kumomta/issues/16
refs: https://github.com/KumoCorp/kumomta/issues/84
2025-11-02 11:56:57 +00:00
Wez Furlong 49cdee1ec5 lruttl: expose pre-defined cache info to the docs
This commit adds some plumbing to allow us to collect metadata
about the caches and spit it out into a json file that we can
then use in the docs to show the predefined caches, capacities
and brief comments about their purpose.

We put that info on the set_lruttl_cache_capacity doc page.
2025-11-01 07:40:40 +00:00
Wez Furlong 5ad7df0203 arc: expose arc_seal and arc_verify methods to lua
refs: https://github.com/KumoCorp/kumomta/issues/16
2025-10-31 12:16:32 +00:00
Wez Furlong 6adb43221f Expose text wrapping function as kumo.string.wrap
Extracts the wrap function to its own little crate and expose that to
lua.
2025-10-29 12:06:06 +00:00
Wez Furlong 67bf14ca20 improve header wrapping functions
Augment the docs to clarify that msg:append_header and
msg:prepend_header do no modification of the value by default.

Adjust the wrapping used by Header:new_unstructured so that it
hard wraps before the SMTP line length limit.

Add optional encode parameter to msg:append_header and
msg:prepend_header so that those methods can opt-in to the
Header:new_unstructured formatting.

Add HeaderMap:append method to mirror the existing HeaderMap:prepend
method.

Add unit tests that demonstrate the effect of wrapping/encoding
for both the "dumb" msg:append_header and msg:prepend_header functions,
and the "smarter" HeaderMap:prepend and HeaderMap:append methods that
always encode their parameters.

Update the docs for the headermap flavor of these methods to indicate
that they will always encode the value.
2025-10-29 11:35:42 +00:00
Wez Furlong 1d70c2ffbb new smtp_server_rewrite_response event
This allows you to customize or otherwise adjust the responses
made by the smtp server.
2025-10-29 08:54:10 +00:00
Wez Furlong 47aac10ea6 data-loader: allow callback/event based loading of secrets
This allows a (more or less) arbitrary lua function to be used to load
data.

The primary advantage of this is that the size of the resulting
KeySource struct is smaller than it would be to hold the actual data
inline.  It also enables the surrounding code to be slightly better
factored.
2025-10-24 13:41:27 +01:00