Commit Graph

1102 Commits

Author SHA1 Message Date
Wez Furlong a1fb96dfc0 add (low|no)_memory_reduction_policy options
These provide more control over the memory vs spool IO tradeoff
when memory is short.
2025-02-21 10:48:14 -07:00
Wez Furlong f3fd2d9691 docs: fixup tags page
The tags plugin was rewritten and broke the old way of pulling
in the tags; update that page, and include it in the toc.
2025-02-20 16:00:16 -07:00
Wez Furlong 7cf6b93783 memory: allow setting soft and low memory limit/thresholds
If you have a lot of RAM, using only default percentages could
potentially leave some RAM unused.  These lua functions
allow more precise control over the limits.
2025-02-20 12:06:12 -07:00
Wez Furlong 1ce8239dd9 add kumo.string.eval_template function 2025-02-20 08:52:04 -07:00
Wez Furlong 9f4a2590c6 templating: expose more of minijinja-contrib 2025-02-20 08:52:04 -07:00
MHillyer 61bf9b77cc Linter fixes. 2025-02-20 13:04:57 +00:00
MHillyer c4a6f22b25 Add a note to the index to let the reader know that the referene manual is the most current at any given time. 2025-02-20 10:05:09 +00: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
Wez Furlong f210a95e37 dkim helper: fixup vault usage
Appending `.key` to the implicit vault path doesn't make a lot
of sense.

Removing extraneous slash from example in the docs.
2025-02-13 14:42:16 -07:00
Ryan Bonnell 9a19328f32 Fix mispelling in comment 2025-02-11 19:32:01 -07:00
Wez Furlong 774c5b04e6 docs: fixup to reflect how timeout is specified for the http client 2025-02-11 11:57:55 -07:00
Ryan Bonnell 9f71496d3e Omit duplicate character in sentence 2025-02-10 15:35:26 -07:00
Mike Hillyer fdcc027a47 Add references to the Docker examples to the relevant User Guide pages. 2025-02-10 09:48:37 -05:00
Wez Furlong a2904155fe fix: using commas in display name w/ injection api 2025-02-10 07:39:09 -07:00
Ryan Bonnell d1632059ca Remove duplicate word 2025-02-08 07:29:41 -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
Ryan Bonnell e127f56899 Fix misspelled word 2025-02-07 06:12:31 -07:00
Ryan Bonnell 3134722537 Fix misspelling 2025-02-06 16:48:55 -07:00
Wez Furlong d331df5965 dkim: add separate key cache to signer machinery
The signer cache maps the signer parameters to a pre-made
signing context.

It is essentially a map of (domain, key) -> signer.

Assuming that the (domain,key) tuple is unique, then this is
a good, effective use of that cache.

However, if multiple domains can share the same key then we
can end up re-parsing the same key data for each of them,
which is moderately expensive and a waste of CPU.

This commit introduces an additional cache for the key source to
the resultant compiled key.

This allows sharing of the same compiled key across signing
parameters that otherwise vary, and should help to shave off
some latency.
2025-02-06 16:47:15 -07:00
Wez Furlong 832121e337 dkim: avoid creating unused threads for SIGN_POOL
We only use the blocking threads portion of the thread pool,
so avoid the default of creating number-of-cores threads
for the IO portion.  We have to create one even though we
don't use it, otherwise tokio is unhappy.
2025-02-06 16:47:14 -07:00
Ryan Bonnell 6e39c91295 Edit words 2025-02-06 13:58:49 -07:00
Ryan Bonnell 8372c9d733 Remove errant backtick from sample code block 2025-02-06 13:58:12 -07:00
Wez Furlong 0ab606cfee memoize: make epoch-based invalidation optional
It is not always desirable to invalidate with the epoch,
so allow opting in instead of always invalidating that way.
2025-02-06 11:06:25 -07:00
Ryan Bonnell 97eb27c62e Improve code formatting and update grammar (#333)
* Add code formatting for readability

* Update verb tense
2025-02-05 13:06:02 -07:00
Wez Furlong 33dcc6b003 docs: changelog for #331 2025-02-05 11:22:46 -07:00
Wez Furlong cf09289579 dkim: allow duration strings to be used for signer ttls
This is a nice convenience
2025-02-05 11:22:46 -07:00
Ryan Bonnell ebb34dec7b Add missing space in sentence 2025-02-05 11:22:35 -07:00
Mike Hillyer 8b2a1ac170 Add SDLC response to the FAQ. 2025-01-31 11:25:18 -05:00
Wez Furlong 4ed60d30a1 docs: update for release 2025-01-29 17:05:37 -07:00
Wez Furlong 833f82a818 egress_source: fix potentially stale rr state when config changes
Previously, we would compare only the names of the pools when
updating the round robin source selection state.

That meant that if you change the composition of a pool by changing
either the number of the definition of its constituent sources,
that change may not take effect until the corresponding queues
had aged out.

This commit resolves this by comparing both the name and the
composition of the pool when deciding to rebuild the source
selection state.
2025-01-29 12:38:38 -07:00
Wez Furlong 8042f7b07a config: invalid pooled lua context when epoch changes
I noticed while testing the throttle serialization commit
that precedes this one that my directly-in-the-lua-file config
changes weren't being picked up when the config epoch changed.

This commit revises the pooling logic to also check the epoch
in addition to the age of the pooled entries.
2025-01-29 11:24:36 -07:00
Wez Furlong 04a1777727 docs: changelog for #329 2025-01-29 10:28:54 -07:00
Wez Furlong ea8f2be678 docs: add weird period example to throttle docs 2025-01-29 09:45:04 -07:00
Wez Furlong 87e0939f43 throttle: expose max_burst throttle spec
This was always present, it just wasn't something we provided a syntax
to specify.

max_burst allows you to control how quickly your throttle budget will
be consumed over the throttle time period.

The default max_burst is equal to the limit you specify, allowing
the full budget to be instantaneously consumed.

refs: https://github.com/KumoCorp/kumomta/issues/326
2025-01-29 09:22:57 -07:00
Wez Furlong e3b3bfefb3 docs: changelog for #328 2025-01-28 10:35:58 -07:00
Wez Furlong d224feb62f tracing: enable server-side processing of terse flag
Cutting down on the data being transmitted can reduce the number
of lag events.

Increase the channel buffer size as well while we're in here.
2025-01-28 10:35:19 -07:00
Wez Furlong 399c8505ae avoid potential cache thrashing issue with remember_broken_tls
A customer reported a really long log record like:

```
KumoMTA internal: failed to connect to any candidate hosts: TLS
handshake failed: tls handshake eof, will re-connect in the clear
because opportunistic_tls_reconnect_on_failed_handshake=true, TLS
handshake failed: tls handshake eof ...
```

the site in question had just a single address in its connection plan.

I don't see how we could loop like this unless the cache that is
used to indicate that TLS is broken is being thrashed and the value
that we write to it in response to this event triggering is
never actually sticking in the cache.

This commit introduces a per-session variable to flag that TLS
is broken for this particular site, so that we don't have to rely
on the cached value when we're about to loop and retry.
2025-01-24 19:34:11 -07:00
Wez Furlong f9d8ceee9d inspect-sched-q: add now time to the response
This is useful when sanity checking the due times vs. the current time
2025-01-24 15:28:37 -07:00
Wez Furlong e474516b01 add reconnect_strategy option
This controls what we do in an smtp session when we experience a
disconnect during message sending; do we give up on the session,
continue with the connection plan, or try to connect to the same
host again and continue sending any additional messages there?
2025-01-24 13:43:49 -07:00
Wez Furlong 54e809dc93 smtp_dispatcher: fix incorrect reuse of closed connection
In the smtp client we internally map IO and timeout errors into
a NotConnected state and break its internal socket, prevent it
from trying to talk to a broken session.

In the dispatcher layer that sits above it, when we consider
whether we need to open a connection, we look only to see if
we have a connection open or not.

If that connection is in a broken state we would keep trying to
use it, because we didn't consider that it might have such
an internal broken state.

This commit fixes up that logic so that we realize that it is
broken, and allow us to move to the next host in the connection
plan.
2025-01-24 13:43:49 -07:00
Wez Furlong b29cea10f4 rfc5321 client: fix rset regression 2025-01-24 13:43:49 -07:00
Mike Hillyer c606ac8244 Update changelog title for consistency. 2025-01-24 11:50:14 -05:00
Wez Furlong 6841841283 first run at an inspect-sched-q command
This can return a sample (or all) of the messages as well as
some additional queue metadata for a named scheduled queue.

refs: #231
2025-01-23 17:10:41 -07:00
Wez Furlong 01c52eef03 docs: update for 2025.01.23-7273d2bc release 2025-01-23 13:49:35 -07:00
Wez Furlong bb66d06169 docs: add opportunistic_tls_reconnect_on_failed_handshake to changelog 2025-01-23 07:32:08 -07:00
Wez Furlong c215ed9c2f rfc5321: add enable_rset and enable_pipelining options
These control whether we'll use RSET and/or PIPELINING when
sending via SMTP.
2025-01-23 07:20:00 -07:00
Wez Furlong b8752b23b1 docs: mention LMTP support
refs: #267
2025-01-20 08:32:48 -07:00
Wez Furlong cf6f3540e7 Add new Delay log record type
The purpose of this record is to log additional context about why
a message might end up in the scheduled queue when it hasn't
logged a TransientFailure.

There are a few situations around handling throttles and limits
where we might put a message back into the scheduled queue, without also
logging a TransientFailure record. It's possible that we should
reconsider some of those, but for the moment, there is an observability
hole that needs to be filled.

What this commit does is introduce an `InsertContext` which can hold one
or more `InsertReason`s about why a message is being inserted into the
scheduled queue.

There are 3 primary reasons for insertion:

* Received - the message was just received/injected
* Enumerated - the message was discovered in spool enumeration
* DueTimeWasReached - the message is now due for delivery and is being
  popped off the scheduled queue

The additional reasons can be added to the context to provide more
color about what happened.

When a message is added to the scheduled queue, the accumulation
in the InsertContext is examined, and if the context doesn't
indicate that the message was Enumerated and it wasn't also
already logged as a TransientFailure, a `Delay` record is
logged.

The `Delay` record includes in its `response.content` the ordered set of
InsertReasons as well as the delay duration and due time.

Logging Delay records might place undesirable pressure on the
logging storage, so you may wish to disable it via:

```lua
kumo.configure_local_logs {
  per_record = {
    Delay = {
      -- Suppress Delay records
      enable = false
    }
  }
}
```

or similar.
2025-01-17 13:21:47 -07:00
Wez Furlong 9770d333b5 egress_source: allow empty egress pools
We said that this worked, and while it does in the code,
we wouldn't allow you to deserialize an empty list of sources.
2025-01-16 11:46:05 -07:00
Wez Furlong 12895496be tsa: fix automation rules with multiple SetConfig actions
Only the first would take effect because the rule_hash we
computed included all of the actions, so each individual
action would appear to be a duplicate of the first.

This commit ensures that we vary the hash per-action
to avoid this, and augments the integration test
to explicitly verify the result.
2025-01-15 14:41:50 -07:00