Commit Graph
1121 Commits
Author SHA1 Message Date
Ryan Bonnell eddc42b45c Add missing space in Markdown link to 'UserGuide' 2025-02-28 08:41:39 -08:00
Ryan Bonnell 4180e3a512 Fix accidental misspellings 2025-02-28 08:41:16 -08:00
Ryan Bonnell 04e52757a3 Re-wrap line breaks in comments for readability 2025-02-28 08:40:36 -08:00
Ryan Bonnell c91b978ea3 Fix misspelling of word 'parameter' 2025-02-28 08:40:07 -08:00
Wez Furlong 3966ca597f kumo.http.build_client: use system certificate store
This matches the behavior we switched to for the SMTP client a release
or two ago, which allows reading the system store, or overriding it via
`SSL_CERT_DIR` and `SSL_CERT_FILE` env vars.

https://docs.rs/rustls-native-certs/latest/rustls_native_certs/fn.load_native_certs.html
2025-02-28 08:41:44 -07:00
Wez Furlong 9ba637ab38 dns-resolver: add negative caching for MX lookup failures
This is why slow DNS often expanded to 3-4x as long as the expected
timeout value; we make a handful of calls in succession, assuming
that the cache was effective in an earlier stage.

We now cache errors for 5 minutes by default, and it can be configured
as desired.

refs: https://github.com/KumoCorp/kumomta/issues/325
2025-02-27 15:55:37 -07:00
Wez Furlong 10e60ea10d docs: fmt generate-toc.py 2025-02-27 06:01:11 -07:00
Wez Furlong f363445ceb add kumo.dns.set_mx_timeout and make it default to 5s
closes: https://github.com/KumoCorp/kumomta/issues/325
2025-02-27 05:54:26 -07:00
MHillyer 22a324dd8d Fix double headings. 2025-02-26 17:03:24 -05:00
MHillyer 588ecee4a8 Add YT link to Kubernetes page. 2025-02-26 16:47:19 -05:00
MHillyer c730c78d7c Add reference to Daniel's repo. 2025-02-26 15:51:25 -05:00
Wez Furlong cd6b01dfe9 throttle: fix edge case with 0ns throttle delay
The queue logic assumes that if we get Some(duration) back from a
throttle check that it must be a non-zero duration.

We found a configuration that used a custom lua delivery handler
together with a max_message_rate throttle. When running with local
(non-redis) throttles it is possible that the in-memory throttle
implementation can return a 0ns delay.

This results in the queue subsystem choosing to requeue the message
using the throttle duration as the delay, which results in the message
being due immediately, which causes recursion into the insert-ready
flow, which performs the same throttle check with the same 0ns result,
and repeat until a stack overflow occurs on the spool in thread.

The circumstances to trigger this are a bit niche and racy: if you turn
up debug logging you can perturb the timing so that the stack overflow
is not 100% repeatable. It is unlikely to cause a stack overflow on the
inbound processing side because the threads doing that processing are
multiplexing many other events that can also perturb the timing.

This commit addresses this edge case in a very simple way: if the
duration is 0, then we return `None` for the duration.  This is actually
how we handle this for one of the redis throttle implementations
already. This commit makes the other two cases consistent with that.
2025-02-26 08:43:05 -07:00
Wez Furlong 4987cc3a84 traffic-gen: support weights for the destination domains 2025-02-25 14:00:37 -07:00
Wez Furlong 39f6aede9e logging: create sub-directory structure if needed
previously, we assumed that only the parent log_dir might be the thing
that would need to be created on demand.

If you configure per-record log files with subdirectories in them, and
the indicated directory didn't already exist, then we'd error out.

This commit will catch the error in that case and try to fill out the
directory structure on demand, which makes things a bit more convenient.
2025-02-25 12:23:50 -07:00
Wez Furlong 0666374f58 tsa: expose underlying log hook back_pressure to configuration 2025-02-24 08:59:58 -07:00
Wez Furlong a805184a8f remove deprecated unused fields from tsa shaping object 2025-02-24 08:59:24 -07:00
Ryan Bonnell 8a64d672fd Modify command usage to match required arguments 2025-02-21 16:18:18 -08:00
Wez Furlong 3071fe9701 add shrink_policy queue config option
This allows reducing how much of a message is freed when it is
delayed.
2025-02-21 17:15:52 -07:00
Wez Furlong 3805afdcc1 docs: fixup list presentation for (low|no)_memory_reduction_policy 2025-02-21 14:32:36 -07:00
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