Commit Graph

567 Commits

Author SHA1 Message Date
kay ozaki bf6f9104dc exposing memory config parameters 2026-02-03 08:29:00 +00:00
Wez Furlong f53ed1aeae add kumo.xfer.xfer_in_requeue for xfer during requeue
Ordinarily, the logic that calls the requeue_message event is
responsible for increasing the number of attempts, computing the revised
due time, and processing message expiration.

When using XFER to move a message to another node, we capture the
scheduling state at the point that the xfer was initiated.

If we do this inside the requeue_message event callback then we will
capture the scheduling information *prior* to the normal adjustments
that would happen later.

This commit adds kumo.xfer.xfer_in_requeue to handle this case; you pass
through the scheduling information parameters that were added to the
requeue_message event in the prior commit, and it will compute any
revised scheduling for the message before wrapping the message up
in the XFER encapsulation and moving the message to the xfer queue.

This adjusted process ignores message expiration, so if the message
is on its last retry it will be xfer'd to the target host which then
might choose to perform the expiration.  We can't handle the expiration
in the context of `requeue_message` because the event handler doesn't
own the message and has no way to signal that it has reached the end of
its life.

Folks doing xfer in requeue_message will generally be moving the message
well in advance of it being expired, so this minor limitation is not
expected to be a practical problem.
2026-02-02 15:21:43 +00:00
Wez Furlong 722cd85e82 expose more details to the lua requeue_message event 2026-02-02 15:11:15 +00:00
Wez Furlong b963a5b6a8 docs: clarify that api_xfer_inject_v1_post is an internal api 2026-02-02 13:28:00 +00:00
Wez Furlong 12c4a2f880 docs: change http generated doc disclaimer from note -> info 2026-02-02 10:32:02 +00:00
Wez Furlong ef21bfd427 add msg:increment_num_attempts method 2026-02-02 09:12:35 +00:00
Wez Furlong 14eb3ef52e docs: relative-ize a couple of generated doc links 2026-02-02 08:17:32 +00:00
Wez Furlong b5fb4bd1f9 docs: replace manual http docs with generated docs
we now just have one section containing docs for the HTTP API,
which makes things a bit easier to reason about.
2026-02-02 08:17:20 +00:00
Wez Furlong 90e3c6c1be docs: improve the generated docs for the injection HTTP api 2026-02-02 07:59:38 +00:00
Wez Furlong d0278947ed docs: replace manual metrics docs with auto-generated ones
I factored out the sample outputs and used an include to pull
in that content.

In the future, we could automate creating those sample data files
based on the live instance, however, it will need some thought
as many metrics are instantiated dynamically.  That means that
simply launching the server to dump the initial counters could
miss a large number of the main production counters that are
the most interesting.  Likely we'll need something smarter than
that approach.  But that is an issue for the future!
2026-02-01 08:56:12 +00:00
Wez Furlong 70863b3090 docs: fixup absolute links in generated api docs
Rewrite them to work as relative markdown links so that the
docs are correctly linked in the standalone doc server.
2026-02-01 08:34:25 +00:00
Wez Furlong de9e55aef5 docs: remove some pages in favor of generated versions
A number of manually authored HTTP api docs can now be replaced
by the versions generated from code, making them more accurate
and less likely to drift away from the implementation as
future changes are made, so that's what this commit does.
2026-02-01 08:24:48 +00:00
Wez Furlong cebf0774f4 docs: define json schema tag for linking to kcli docs
Define, by convention, a tag like `kcli:bounce` to indicate that
a jsonschema path definition is linked to the `kcli bounce` subcommand.

This commit adds appropriate tags to each command, and teaches
the jsonschematodocs utility how to generate a boilerplate
paragraph containing the link.
2026-02-01 07:43:10 +00:00
Wez Furlong a8163b6e48 refactor http listener path registration
This commit changes how the various http endpoints are registered;
previously we had to define the handler function in one place,
then in another, explicitly register that handler with a path
and operation type with the router.  If we wanted to also export
documentation about that method, we would need to annotate the handler
with a duplicate of the path and method type.

There was a decent amount of boiler plate and it was very easy to omit
some of that registration information, or for it to potentially drift
or be mistranscribed.

This commit eliminates most of the boiler plate; now we require that
every endpoint be annotated with the utoipa::path macro, which
centralizes the handler, path and method type definition in one place.

To register the route and docs we now have a much simpler
`router_and_docs!` macro that can register both the with the axum router
and with the openapi docs machinery.
2026-02-01 07:30:07 +00:00
Wez Furlong b08179e08e refactor: tidy up jsonschema registration
DRY when it comes to listing out components, request and response
bodies.  We don't need to centrally list those if we're good
at annotating the path macros.

This commit removes a couple of schemas from the docs; that's
ok because the content of those was already inlined into the
respective endpoint docs anyway, so we're not losing anything,
just eliminating a redundant copy of the same information
on a second location.
2026-01-31 07:29:46 +00:00
Wez Furlong ee70f2dbcb docs: fix broken metamethods link 2026-01-30 16:45:12 +00:00
Wez Furlong dfe86f4671 docs: add missing MimeParams section 2026-01-30 16:44:09 +00:00
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