Commit Graph
1225 Commits
Author SHA1 Message Date
Wez Furlong c3dff7e2c8 docs: update for latest release 2025-05-06 18:24:15 -07:00
Wez Furlong b29689af74 docs: memoize: allow_stale_reads 2025-05-06 05:55:44 -07:00
Wez Furlong 507822f1c9 docs: fmt 2025-05-06 05:55:34 -07:00
Mike Hillyer 9249fbc482 Remove extra references. 2025-05-05 16:10:09 -04:00
Wez Furlong e8573f9a76 rfc5965: ignore bogus rfc822 dates arrival or reception-date headers
The rfc includes a bogus date in one of its examples, which the
underlying chrono library produces an error for.

Since we don't loudly report failures in parsing incoming reports,
this sort of error is confusing for the user.

These date fields are optional, so we can convert the error to
None without harming the overall outcome.
2025-05-05 08:48:41 -07:00
Wez Furlong fedd2959b6 enhance log_arf, log_oob to support LogThenDrop
It is common to want to express that incoming reports should
be logged, but not relayed.

This commit facilitates that by expanding `log_arf` and `log_oob`
to allow more than just a simple boolean value.

We now support both LogThenRelay and LogThenDrop as dispositions
for an incoming report, as well as Ignore to not care about the
report content.

For the LogThenDrop case we'll log only the incoming OOB or Feedback
record to the logs and then discard the incoming message.

For LogThenRelay we'll log the incoming OOB/Feedback report as well
as enqueue the message and log a Reception and, subsequently, records
for its delivery attempts.

The previously supported boolean values are mapped to `Ignore` (false)
and `LogThenRelay` (true), respectively: their behavior is the same as
in prior releases.

The integration test and smtp server tracing infra has been enhanced a
bit to support extracting these new disposition states from the tracer
during the integration test.
2025-05-05 08:25:40 -07:00
Wez Furlong 9641bcf1ff docs: note about domain-suffix when using iptables 2025-05-01 10:23:01 -07:00
Wez Furlong db1f3c3773 docs: wrap iptables command 2025-05-01 10:20:01 -07:00
Wez Furlong c3b65667a6 docs: expand discussion around iptables 2025-05-01 10:19:15 -07:00
Wez Furlong 3732bc0fef docs: code formatting 2025-05-01 10:09:01 -07:00
Mike Hillyer d57953ba87 Formatting and spelling fixes. 2025-05-01 12:55:44 -04:00
Mike Hillyer 35e49a4312 Typo fix. 2025-05-01 12:31:05 -04:00
Mike Hillyer 366b45c2e5 Formatting update. 2025-05-01 12:31:05 -04:00
Mike Hillyer e08111beee Implement Wez's feedback to use meta instead of header in the logging example. 2025-05-01 12:31:05 -04:00
Mike HillyerandWez Furlong d9273e2e19 Update docs/faq/how_do_i_include_multiple_files.md
Co-authored-by: Wez Furlong <wez@wezfurlong.org>
2025-05-01 12:31:05 -04:00
Mike Hillyer 1a68d526f5 Update to linux tuning to show possible parameters but not values to prevent copypasta. 2025-05-01 12:31:05 -04:00
Mike Hillyer c978a23a8c Update Linux tuning to have less examples so that people don't blindly implement them. 2025-05-01 12:31:05 -04:00
Mike HillyerandWez Furlong 1ef1cf4cc3 Update docs/userguide/performance/testing.md
Co-authored-by: Wez Furlong <wez@wezfurlong.org>
2025-05-01 12:31:05 -04:00
Mike HillyerandWez Furlong 50a274fa83 Update docs/userguide/performance/loghooks.md
Co-authored-by: Wez Furlong <wez@wezfurlong.org>
2025-05-01 12:31:05 -04:00
Mike HillyerandWez Furlong 1a645681fd Update docs/userguide/performance/loghooks.md
Co-authored-by: Wez Furlong <wez@wezfurlong.org>
2025-05-01 12:31:05 -04:00
Mike Hillyer b92812cf8b Add glob example. 2025-05-01 12:31:05 -04:00
Mike HillyerandWez Furlong 163f826fa1 Update docs/userguide/performance/architecture.md
Co-authored-by: Wez Furlong <wez@wezfurlong.org>
2025-05-01 12:31:05 -04:00
Mike HillyerandWez Furlong 7b5b655a09 Update docs/userguide/performance/architecture.md
Co-authored-by: Wez Furlong <wez@wezfurlong.org>
2025-05-01 12:31:05 -04:00
Mike Hillyer 670133a64f Quick edit. 2025-05-01 12:31:05 -04:00
Mike Hillyer 5035b82092 Add a SPOF FAQ entry. 2025-05-01 12:31:05 -04:00
Mike Hillyer 62a48d4787 Added the architecture page, further tweaks. 2025-05-01 12:31:05 -04:00
Mike Hillyer c086a08c03 Linter complaints. 2025-05-01 12:31:05 -04:00
Mike Hillyer 08224b223d DNS and loghook pages 2025-05-01 12:31:05 -04:00
Mike Hillyer dd4a2acf60 Updates to the performance chapter of the userguide. 2025-05-01 12:31:05 -04:00
Mike Hillyer 01cd7985ae Update Message flow page to go deeper on some of the events and factors that will need to be tuned. 2025-05-01 12:31:05 -04:00
Mike Hillyer 27447c8e0b Updated testing page to use the sink container rather than the sink init.lua so that testers will be encouraged to have more realistic tests. 2025-05-01 12:31:05 -04:00
Mike Hillyer 66a377bae6 Initial re-arranging of existing performance related content from the Operation chapter to the Performance chapter. 2025-05-01 12:31:05 -04:00
Mike Hillyer ab40de0920 Initial commit just to test my changes. 2025-05-01 12:31:05 -04:00
Wez Furlong cd09170bc4 throttle: fix TTL issue with redis-script based throttles
When using throttles with a long period, a porting issue from the JS
based throttle code meant that we'd compute a TTL in *seconds* but tell
redis that its value is in *milliseconds*, resulting in a much shorter
expiration time than desired, allowing more messages to pass the
throttling condition.

This issue doesn't apply to the redis-cell based throttle
implementation.

The fix here is simply to switch the `PX` (TTL in milliseconds) to
`EX` (TTL in seconds).

Possibly this was the source of the flakeyness that we could never
run down in https://github.com/KumoCorp/kumomta/issues/297
2025-04-30 14:15:39 -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 448fa55afb docs: update for docker dev build naming change 2025-04-24 09:13:20 -07:00
Wez Furlong 02eee83cb5 docs: add explicit chmod to the gpg key 2025-04-22 09:32:12 -07:00
Wez Furlong 18e510ebe2 ready_queue: introduce dispatcher_wakeup_strategy and maintainer_wakeup_strategy
These allow optionally reducing how aggressively the dispatcher and
maintainers will be awoken when message(s) are submitted to the ready
queue.

The default behavior remains the same; the new thing here is the
ability to make it more relaxed, which should reduce some CPU
overheads for very busy systems with many queues.

Making things more relaxed does introduce a possibility for higher
outbound latency in some edge cases with low or bursty traffic.
2025-04-16 15:19:27 -07:00
Wez Furlong 6bc216c18d docs: make tsa changelog entry very slightly more broad
Aside from importing data on startup, we no longer use sqlite.
2025-04-14 11:38:24 -07:00
Wez Furlong 1f37a104f6 mailparsing: rebuild of binary attachments could corrupt them
We were blanket-applying the text charset conversion and it was
interpreting the binary bytes as windows-1252 content, which could cause
us to then re-encode the content as the utf8 equivalent of the 1252
interpretation of those bytes.
2025-04-14 10:05:27 -07:00
Wez Furlong 8c3b297cda tsa: improve event_history storage
In a pathological configuration (essentially unbounded and continually
increasing number of campaigns, tenants, coupled with a synthetic
10% rate of triggering drastic bounce automation rules) I observed
that tsa could trip over itself when locking the sqlite db to
maintain the event history table.  This in turn causes delays
in responding to the shaping data endpoint, leading to timeout
errors in kumod.

This commit removes the sqlite-based event_history table that was
the source of that contention and replaces it with a much more
compact and easier to reason about set of in-memory data structures
built around a sharded hash map.  This makes it very quick to
insert and return the current count when assessing rules with
triggering thresholds.

This new state is serialized using msgpack and periodically saved
in the background, as well as on shutdown.
2025-04-11 10:04:31 -07:00
Wez Furlong f8ccda9dfc admin bounce: add caching+negative caching for queue insertion
For sites with large numbers of admin bounce entries, it is
desirable to negatively cache the lookup so that we can avoid
extraneous matching overhead.

We use a generation counter to determine if any rules have changed
and allow that to drive the invalidation of negative caching.

Otherwise, we cache the last lookup and, if the generation is the
same, then we cache the prior result and respect its expiration.
2025-04-10 10:37:57 -07:00
Wez Furlong 8ecbe25b4e set_timeq_spawn_reinsertion is now the default
After running this at a couple of sites, this appears to be
good overall, so let's remove the option, reduce complexity
and make things better by default.
2025-04-10 08:42:18 -07:00
Wez Furlong 8b1b639d98 message: implicitly load data/meta when calling lua get/set meta/data
I saw an instance where the throttle_insert_ready_queue event was
trying to inspect the metadata but failing because the metadata was
not loaded.

This should avoid that problem.
2025-04-06 08:59:44 -07:00
Wez Furlong eda083f083 dns-resolver: use thundering herd protection and add semaphore
This commit does two things:

* Migrate the limit of 128 concurrent lookups from the shaping code
  and into the general mx lookup code
* Adjust the mx lookup implementation to run inside the cache
  getter, which applies thundering herd protection to the lookup.

These together will constrain the amount of queries being sent
to the upstream dns resolver and reduce the chances of it being
overwhelmed, especially if we are doing duplicate queries from
multiple concurrent contexts simultaneously.
2025-04-06 08:45:49 -07:00
Wez Furlong 5eb57e63d5 shaping.toml: disable dane for office365-dane
We cannot default it to enabled because a fully working
dane setup requires additional configuration in the resolver
and we cannot guarantee that that has happened here.
2025-04-06 07:47:00 -07:00
Wez Furlong e7ca5b4424 docs: update changelog to reflect more of kcli top's new features 2025-04-04 13:51:34 -07:00
Wez Furlong 0fc21cbbc6 kcli top: add vertical scrollbar
There are a lot of metrics these days, we need to scroll through them!
Use the arrow keys, page up/down and home/end for this purpose.

closes: https://github.com/KumoCorp/kumomta/issues/372
2025-04-03 14:00:59 -07:00
Wez Furlong c7fe9489c3 fix: failure to load ed25519 dkim private key
This was probably the casualty of some earlier refactoring
that has gone unnoticed until now.

Since we don't have explicit context on which key format to
parse in this helper function that is used in multiple places,
let's just make it try to parse both rsa and ed25519.

closes: #368
2025-04-03 10:11:24 -07:00
Edgar Vaitkevicius d0314c0f3a Updated Kafka producer docs
They mistakenly referred to AMQP and queues before.
2025-04-03 09:37:04 -07:00