Commit Graph
1360 Commits
Author SHA1 Message Date
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 3d7802db37 docs: changelog for keysource event callback 2025-11-20 15:12:35 +00:00
Wez Furlong 65fde5c03b docs: fixup whitespace in changelog 2025-11-20 15:09:16 +00:00
crxandWez Furlong 39fbf150a9 traffic-gen header in changelog (#455)
* Changelog update

Co-authored-by: Wez Furlong <wez@wezfurlong.org>
2025-11-20 08:08:15 -07: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 1c3b6dc14a smtp_dispatcher: fix reverse order for mx_list
When using an explicit mx_list, rather than consuming the DNS-provided
MX records, we were populating the connection plan LIFO with the mx_list
which is specified as a FIFO.

The result was that we would connect to the addresses in the reverse of
the intended order.

Most users only populate a single entry for mx_list, if they use this at
all, so it has flown under the radar.  This issue was introduced
together with the mx_list feature in bcd2946c53.

This commit corrects that issue so that the behavior conforms to the
intended and documented ordering, and tweaks the tests to accommodate
it; the test changes required were:

1. disconnect_in_data was actually sensitive to the order, and encoded
   the reverse ordering in its expectations. :-/
   It now correctly encodes the correct order, which should allow
   detection of regression in the future.

2. disconnect_terminate_ok is sensitive to extraneous TransientFailures.
   It was implicitly dependent on the ordering of the mx_list in the
   sense that it relied on the FIFO list returning as [127.0.0.1, ::1],
   which resulted in trying ::1 first (because that list is consumed as
   LIFO), failing due to ::1 not actually being bound in the test
   environment, and proceeding to test with 127.0.0.1 being the last
   working address.

   With the ordering fixed that test started to fail because the second
   host in the correct connection plan was ::1 and that was not
   reachable, triggering a TransientFailure against the expectations
   of the test.

   The goal of the test was to verify the behavior in the
   exhausted-connection-plan case, rather than the
   unreachable-final-mx-case, so the resolution here is to add v6
   addresses to the skip_hosts config.  Will that come back to haunt us?
   Time will tell.
2025-11-13 06:12:38 +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 7703b9fcf2 docs: migrate userguide amqp example to basic_publish
Since we have deprecated the `build_client` approach, we should
be showing how to use the preferred function!
2025-11-10 11:58:46 +00:00
Wez Furlong c06b0bc0c0 docs: changelog for normalize_smtp_response 2025-11-09 08:13:39 +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 b5f2c46f08 docs: add breaking change note about RCPT TO 552 status
in 18e55a6e91 I noticed that we should be
handling 552 as a transient failure, but I neglected to mention this
change in the changelog because it seemed obscure and "couldn't" hurt
anyone.

I overlooked that we have client response rewriting and of course this
change did impact one of our sponsors that rewrites certain transient
452 responses to 552 responses.

So, let's add a note explaining this to see if we can prevent others
from hitting it in the future.
2025-11-04 17:11:34 +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 c085e368b2 dkim_(key|signer)_cache: enable thundering herd protection
Use the managed accessor for thundering herd protection.

May help with a situation as discussed in
https://github.com/KumoCorp/kumomta/pull/438
2025-10-31 18:04:17 +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 e9deb2500d dkim: fix subdomain checking issue 2025-10-31 12:16:30 +00:00
Wez Furlong f03fbed72b docs: fixup issues with the integrations section 2025-10-31 12:16:09 +00:00
Tom MairsandWez Furlong 1cd1d0aa95 Cleaning up Integration docs (#444)
* Add Tatami Monitor integration doc

* update docs

* Add Mautic integratoin doc

* Add rspamd integration and hornet integration

* Update docs/userguide/integrations/grafana.md

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

* Fix bash references and make links relative

* clean up links

* fix markup

* fix markup

---------

Co-authored-by: Wez Furlong <wez@wezfurlong.org>
2025-10-30 22:15:59 -06:00
Tom MairsandWez Furlong bcdc949d07 More Integration modification (#443)
* Add Tatami Monitor integration doc

* update docs

* Add Mautic integratoin doc

* Add rspamd integration and hornet integration

* Update docs/userguide/integrations/grafana.md

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

* Fix bash references and make links relative

---------

Co-authored-by: Wez Furlong <wez@wezfurlong.org>
2025-10-30 21:13:08 -06:00
Tom Mairs 9c8fe01848 Added integration docs (#442)
* Add Tatami Monitor integration doc

* Add Mautic integration doc
2025-10-30 16:19:57 -06: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 8c0eb21df3 docs: workaround upstream mkdocs live reloading bug
refs: https://github.com/mkdocs/mkdocs/issues/4032
refs: https://github.com/pallets/click/issues/3084
refs: https://github.com/squidfunk/mkdocs-material/issues/8478
2025-10-25 07:00:07 +01:00
crx 5132f87b96 Feature/traffic-gen custom headers (#434)
* traffic-gen: add support for --header
2025-10-24 09:08:42 -07: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
Mike Hillyer ab2e7ad662 Add reference to AL 2/2023 and remove CentOS 7 reference. 2025-10-23 12:35:08 -06:00
Mike Hillyer a8230ae8dd Update install doc in Userguide to specify Rocky 8/9. 2025-10-23 12:31:25 -06:00
Wez Furlong 6f31d5514c new Time and TimeDelta objects for lua
Motivated by https://github.com/KumoCorp/kumomta/pull/403,
this commit introduces reasonably full featured Time and TimeDelta
types built atop the chrono crate.

closes: https://github.com/KumoCorp/kumomta/pull/403
2025-10-22 17:26:35 +01:00
Dario MaiocchiandWez Furlong 847cc21e9b implement aes-cbc block with examples
Add CBC and ecb Block mode aes encryption/decryption.

To facilitate testing this better, and just to be nicer overall, adjust
data-loader's KeySource::key_data variant to support loading raw binary
bytes.

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

Closes: https://github.com/KumoCorp/kumomta/pull/395
2025-10-22 11:55:16 +01:00
Wez Furlong ac22d6848d docs: format 2025-10-21 21:26:32 +01:00
Wez Furlong 6fc0d782ff spf: populate smtp.mailfrom in Auth-Results, add check_msg func
Add a convenience function that is intended to be used around the
time that you might be building up the overall set of
Authentication-Results.

Populate missing smtp.mailfrom in SPF authentication result.
2025-10-21 21:25:21 +01:00
Mike Hillyer 10ab901174 Update index for new integration page. 2025-10-18 12:07:00 -04:00
Wez Furlong 0a117e9407 fix incorrectly treating 552 as TransientFailure
We should do this ONLY when the response is to a RCPT TO command,
otherwise it is a permanent failure.

refs: https://github.com/KumoCorp/kumomta/issues/431
2025-10-16 16:03:12 +01:00
Mike Hillyer 87bc5d0c7b Typo fix. 2025-10-16 09:56:29 -04:00
Mike Hillyer 0334af7780 Add link. 2025-10-16 09:51:38 -04:00
Mike Hillyer 60a8cf7135 Add EmailElement to Integrations section of UserGuide. 2025-10-16 09:51:38 -04:00
Wez Furlong 8ba93b5454 add smtp_server_rejections counter to metrics
This is incremented each time we log a Rejection record from the smtp
server.

The service label identifies the listener address, and there is a
special `total` that is incremented as a rollup across all listeners.

```
 # HELP smtp_server_rejections number of Rejection records logged by the smtp server
 # TYPE smtp_server_rejections counter
 smtp_server_rejections{service="127.0.0.1:2025"} 1
 smtp_server_rejections{service="total"} 1
```

closes: https://github.com/KumoCorp/kumomta/issues/429
2025-10-15 06:59:56 +01:00
Wez Furlong 7eeb755f30 mailparsing: fix quoting issue with Mailbox display name
Let's base our quoting decisions based on whether the string is fully
atext compatible, and once quoting, on whether the character requires
quoting within the quoted string.

refs: https://github.com/KumoCorp/kumomta/issues/428
2025-10-14 14:59:04 +01:00