Commit Graph

45 Commits

Author SHA1 Message Date
Wez Furlong ef21bfd427 add msg:increment_num_attempts method 2026-02-02 09:12:35 +00:00
Wez Furlong b551d6b4c7 docs: update for release 2025.12.02-67ee9e96 2025-12-02 11:11:05 +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 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 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 db5ebb88a7 message: expose recipient list to lua api
message:recipient() may now return an array style table
holding the recipient list, if there is more than a single
recipient on the message.

Since this can be somewhat ambiguous/frustrating to work with,
there is now also a message:recipient_list() that will always
return an array style table, even if it holds just a single
element.

The included helpers have been updated to use `message:recipient_list`.

message:set_recipient() will now optionally accept an array
style table holding the recipient list to be set.
2025-10-07 07:52:58 +01:00
Wez Furlong 206dc7c7fa optionally detect legacy 8-bit during check-fix 2025-10-07 07:50:46 +01:00
Wez Furlong 981de67f1c docs: update for 2025.10.06-5ec871ab release 2025-10-07 07:38:10 +01:00
Wez Furlong c7cbd99a9f add kumo.inject_message 2025-09-09 10:38:36 +01:00
Wez Furlong 1bf9d138ce extended lua mime parsing API
refs: https://github.com/KumoCorp/kumomta/issues/117

Could also make it possible to do eg:
https://github.com/KumoCorp/kumomta/issues/142
without any explicit direct support in the product.
2025-09-09 09:15:58 +01:00
Wez Furlong 42bf5c5e61 docs: adjust reference to improve search terms
We've been hoping that mkdocs-material will ship the much anticipated
search enhancements for some time, but it's time to recognize that
we need to do something to improve the search results with how
things work right now.

This is a big commit that changes the titles of the various pages
from the code-annotated synopsis to just the name of the function.

This makes it much easier now to match things like `kumo.reject`
directly, but `reject` remains awkward to find.

I think this is the best that we can do at this time.

A few functions have been annotated with the `status: deprecated` to
show as deprecated in the toc/nav (shows with a little trash can next
to the name).
2025-05-16 14:02:19 -07:00
Wez Furlong b8310da8be docs: add warning about logging headers
TL;DR: you can easily halve your system performance by logging headers
vs. logging meta.

This is one of those things that is easy to overlook or forget,
but: whenever you need to operate on the message data, rather
than its metadata, the aggregate cost is high.

In this case, we were recently troubleshooting a system where
the CPU was bogged down and we traced it to the logging configuration: a
number of message headers were being logged in a configuration that
made heavy use of throttles and limits in its traffic shaping, and
thus had a large number of Delayed and TransientFailure events being
written to the logs.

When logging headers, each one of those events requires loading
the message from the spool and parsing out the headers.  When the
average message size is ~100KB this imposes a notable overhead
on the CPU and IO utilization of the system.

What we recommend instead of logging headers directly is capturing
the information that you want to log into the message metadata
at the time that the message is received.

The message meta is usually already loaded, but is also typically
much smaller and easier to decode than the full message content
in the cases where it is not loaded.

As a result, it is much cheaper to log meta than to log headers.

This commit adds some warnings and cross links to help folks
be aware of this, and to generally navigate related meta and logging
topics more easily via tags.
2025-04-25 05:52:44 -07:00
Wez Furlong 337b4e33a8 docs: update for stable 2025.03.19-1d3f1f67 release 2025-03-20 07:28:32 -07:00
Wez Furlong c2444b6266 add expiry to per-msg scheduling overrides
This commit allows setting a per-message `expires` timestamp
via msg:set_scheduling (and thus msg:import_scheduling_header).

The expiration takes precedence over max_age; max_age will be
ignored for messages that have configured and expiration time.

The expiration time is independent of the other scheduling
restrictions.
2025-03-15 07:18:13 -07:00
Wez Furlong 45d8449c69 message: add msg:shrink() and msg:shrink_data() methods
These are helpful when explicitly managing memory overheads
2025-02-19 15:55:12 -07:00
Ryan Bonnell b5bd819b87 Fix verb usage and improve text replacement example (#338)
* Fix passive verb usage

* Add clarity to text replacement example
2025-02-07 06:13:14 -07:00
Wez Furlong e06a4a9049 docs: rotate changelog for 2024.11.08-d383b033 2024-11-12 12:28:40 -07:00
Mike Hillyer 00ccd5d69c Update the add_authentication_results page to show SPF as well as DKIM. 2024-11-08 11:11:28 -05:00
Wez Furlong 8673045fff docs: update for latest release 2024-06-10 09:30:17 -07:00
Wez Furlong 898ed52410 add msg:append_text_html and msg:append_text_html
These can be used to insert tracking pixels/links.

closes: https://github.com/KumoCorp/kumomta/issues/120
2024-03-31 14:04:46 -07:00
Wez Furlong 1fb712e2bf Add msg:set_data()
This method allows replacing the message payload arbitrarily.
This is a building block for more advanced and convenient
modification operations.

refs: https://github.com/KumoCorp/kumomta/issues/117
refs: https://github.com/KumoCorp/kumomta/issues/120
2024-03-31 06:57:59 -07:00
Wez Furlong 33c7557afb msg: add num_attempts, set_due and queue_name methods
refs: https://github.com/KumoCorp/kumomta/issues/149
2024-03-08 13:35:03 -07:00
Mike Hillyer 8558ae88bc Update remaining tables with new fix. 2024-01-05 15:31:05 -05:00
Mike Hillyer f45696eacc Forgot to add table fix to get_meta 2024-01-05 15:06:55 -05:00
Mike Hillyer ea2ec286b9 Fix formatting of notes. 2024-01-05 15:03:25 -05:00
Mike Hillyer 30d4a7cda9 Adding table workaround to other metadata pages. 2024-01-05 14:57:47 -05:00
Mike Hillyer 72492df381 Create new master metadata index page, update existing metadata pages to reflect the change. 2024-01-05 13:54:12 -05:00
Wez Furlong 8af7e85c6b docs: update version info for latest release 2023-11-29 12:08:34 -07:00
Wez Furlong 38179d59c4 docs: fix some broken links 2023-11-06 08:14:11 -07:00
Wez Furlong 3b10d637f9 docs: show how to use dkim verification
refs: https://github.com/KumoCorp/kumomta/issues/82
2023-09-14 13:03:41 -07:00
Wez Furlong 5d9d32e7ed Automated doc formatting fix 2023-08-30 00:25:15 +00:00
Wez Furlong 884f8b0171 docs for msg:check_fix_conformance
refs: #17
refs: #24
refs: #26
2023-08-29 17:08:16 -07:00
Wez Furlong 24909f4cde docs: update for 2023.08.22-4d895015 release 2023-08-25 08:38:09 -07:00
Wez Furlong 71924490d3 message: add set_recipient and set_sender methods 2023-08-15 14:51:35 -07:00
Wez Furlong 3fd76dd45a introduce routing_domain concept
Augments our queue name format to be
`campaign:tenant@domain!routing_domain`.

The routing_domain is optional.  If the routing_domain is not set, its
effective value is that of the recipient domain.

You can `msg:set_meta('routing_domain', 'bar.com')` to set the
routing_domain for a message, so if the original recipient was
`user@foo.com`, that would cause the computed queue name for it to be
`foo.com!bar.com`.

The routing_domain is used when deciding on the ready_queue name
and destination MXs, so continuing our example, instead of resolving
`foo.com` MX records we'd resolve `bar.com` and deliver to that site.

The `get_egress_path_config` event `domain` parameter is redefined to be
the effective `routing_domain`.

The `get_queue_config` event `domain` parameter is the regular recipient
domain. The `routing_domain` is not currently made available to
`get_queue_config`. If/when we expose it, it will likely be via a
queue name object instead of adding an additional parameter. That would
be a breaking change.

The consequence of not exposing this parameter is that per-message
routing scenarios for the same domain (but different routing domains)
cannot vary the scheduled queue parmeters (eg: retry intervals). Even
though they would have separate scheduled queue instances, those
instances would have the same scheduled queue parameters.  If you need
to be able to do that, then explicitly setting the domain portion of the
queue name would be a way to do that: `msg:set_meta('queue',
'foo.com-via-bar.com!bar.com')`.  `get_queue_config` would then be
called with `domain='foo.com-via-bar.com'` and your policy could then
respond accordingly.
2023-08-10 08:43:20 -07:00
M.L. Oelering effa1a6a16 Add doc for remove_all_named_headers 2023-07-06 14:29:59 -07:00
Tom Mairs 2b617a8c65 fix typo 2023-06-30 05:20:35 +00:00
Wez Furlong 2992e42138 add received_from and received_via meta values
We don't set received_via for http because axum/hyper make it a
bit weird to access that information and it will require some
effort to figure out how to get that without breaking the
existing proxy-aware client IP determination.
2023-06-13 15:18:06 -07:00
Wez Furlong f0e0ffe828 add message:set_force_sync
refs: https://github.com/KumoCorp/kumomta/issues/6
2023-05-08 17:37:54 -07:00
Wez Furlong c61d6aaa04 docs for kumo.http 2023-05-05 15:08:48 -07:00
Wez Furlong b3f3f877df add functions for working with address headers 2023-03-14 18:53:47 -07:00
Wez Furlong da5f2433c0 add rfc3464 delivery status report parser 2023-03-02 14:46:30 -07:00
Wez Furlong 2b0ba702cb add scheduling constraints
This is implemented by allowing the Message:set_due method to
load the message metadata to consult the scheduling constraints,
which should mean that all scheduling updates have the constraints
applied to them.
2023-03-01 09:43:48 -07:00
Wez Furlong 6dfb44012e add some header manipulation functions 2023-02-26 15:01:05 -07:00
Wez Furlong 51d9928ead docs: add more reference content 2023-02-25 20:41:50 -07:00