Commit Graph
166 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 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
Ryan Bonnell d1632059ca Remove duplicate word 2025-02-08 07:29:41 -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
Wez Furlong 4ed60d30a1 docs: update for release 2025-01-29 17:05:37 -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 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 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 9e823dc352 add kumo.time lua module, with new timer object
The timer object can track latencies in lua code and is helpful for
ad-hoc, explicit "profiling" in your policy script: the latencies are
exported via a prometheus histogram.
2025-01-09 15:36:30 -07:00
Wez Furlong 4375958da2 docs: tag available_parallelism with threadpool 2025-01-08 16:00:17 -07:00
Wez Furlong 1b82b54bc8 docs: tag set_logging_threads too 2025-01-08 15:54:05 -07:00
Wez Furlong 2dc9b2b319 docs: setup tags to find threadpool related options 2025-01-08 15:52:06 -07:00
Wez Furlong 44c0c029e4 throttle: introduce LimitSpec and force_local mode
This brings parity with ThrottleSpec in allowing for explicitly
local limits, even when redis sharing is enabled.
2025-01-06 06:53:12 -07:00
Wez Furlong 39bbc0953e switch to DeferredInjectionRebind for deferred->fully realized
It's confusing to have 2 Delivery records, even if there are other
fields that distinguish between the events.
2024-12-19 10:14:26 -07:00
Wez Furlong 8be4ad82a1 add basic outbound LMTP support
This enables LMTP over TCP by setting `use_lmtp = true` in the
egress path configuration.

refs: https://github.com/KumoCorp/kumomta/issues/267
2024-12-17 06:48:52 -07:00
Wez Furlong 05295e415a add opportunistic_tls_reconnect_on_failed_handshake option
When used together with an Opportunistic TLS mode, if the handshake
or subsequent EHLO fails, we will re-connect to the current host
and disable TLS.

This is implemented as a recursive solution, which I'm not totally
keen on, but the recursion is limited to a single level so it's
not so bad.
2024-12-16 15:20:13 -07:00
Wez Furlong 5f19f7ce04 add deferred_queue option to the smtp listener
This option should be used with caution, and ideally only
for trusted networks.

The purpose is to absorb the latency of post-DATA processing
and hide it from the trust injector.

It defers processing that would normally happen in smtp_server_message_received
and instead will, at some (ideally) near-future time trigger an
smtp_server_message_deferred_inject event instead.

This will marginally increase your average injection latency but should
clamp your worst case injection latency much lower because the outliers
will not happen inline with the injecting client.
2024-12-16 11:27:40 -07:00
Wez Furlong c92cff2a60 maildir: support template expansion of maildir_path
closes: https://github.com/KumoCorp/kumomta/issues/109
2024-12-08 10:15:53 -07:00
Wez Furlong 1a83f72b6d maildir: expose dir_mode and file_mode to protocol config
You can now specify the dir and file modes in your maildir
protocol configuration.

refs: https://github.com/KumoCorp/kumomta/issues/109
2024-12-08 09:41:55 -07:00
Wez Furlong 38fd692e94 docs: show how to skip IPv6
I was halfway through adding special purpose options for this,
but I realized that skip_hosts already exists for this function
and is much more flexible.

Add an example to the docs to show how it can be done.
The same technique can be used to skip using IPv4 if that is
desired (despite being impractical with the current state
of SMTP on ipv6), but using `0.0.0.0/0` as an entry in the
skip_hosts list.

closes: https://github.com/KumoCorp/kumomta/issues/317
2024-12-04 07:33:50 -07:00
Wez Furlong cf911c4067 docs: update dev -> 2024.11.08-d383b033 2024-11-12 12:25:53 -07:00
Wez Furlong d383b033cf docs: add a refman section for template syntax 2024-11-08 10:37:08 -07:00
Wez Furlong d3e399cfda docs: describe the configuration monitoring and epoch system 2024-11-08 07:14:03 -07:00
Mike Hillyer 8bdfa734e9 Should not have made a page in the refman. 2024-11-05 17:39:16 -05:00
Mike Hillyer 1c8e3e413e Add a page for overall_max_message_rate to the reference manual. 2024-11-05 17:26:48 -05:00
Wez Furlong fbed08567f add remember_broken_tls option
This provides a simpler and easier to use option for dealing with broken
TLS.

The back story here is that sites with broken TLS ideally should result
in a TLS failure and return us to a clear text SMTP session that we
could use for the remainder if we are in opportunistic mode.

In practice, it's not that simple:

* The rustls implementation provides into_fallible() to enable this mode
  of operation, but certain handshake errors result in the session being
  unusable once the failed handshake has been communicated
* Openssl is perfectly capable of operating this way, but the Rust
  ecosystem bindings do not expose the handshake failure in a way that
  allows the clear text session to continue

If we wanted to allow the session to communicate with the failed host in
clear text we will need to make a new separate connection for this case.

There is a concern that this will bump a connection counter in a
reputation system implemented on the destination host, but it is
reasonable to wonder if a site that has broken TLS would be sufficiently
sophisticated to employ such a system.

If we did want to allow making a new connection to the same host, it is
a bit awkward to fit into our current mx host connection plan system.

So, with all that in mind, this commit tries a slightly different
approach:

* A new `remember_broken_tls = "3 days"` field in the egress path config
  will enable an in-process cache to keep track of the site_names that
  advertise STARTTLS and for which we failed to handshake, or failed to
  re-EHLO after a handshake.

* That will cause the connection plan to move on to subsequent hosts, if
  any.  It won't cause us to re-attempt the current host.

* Subsequent connection attempts (which may be immediate if there are
  additional hosts in the current session plan) will consult the
  broken tls cache for the site, and use that to decide on the
  availability of TLS

* If we previously encountered broken TLS, we will effectively treat
  the site as not advertising TLS in EHLO, but will generate an
  appropriate error message if TLS is Required.

Since we track the breakage in a cache with per-item TTLs, you
can set the duration as appropriate to your situation.

The cache will be cleared when the process is restarted.

There is no sharing of the cache between nodes.

This is a much lower complexity solution than the existing workaround
using TSA automation rules to override the site with Disabled TLS, and
will help to minimize the number of rules for that purpose in the TSA
daemon.

Note that this commit doesn't change any behavior; we can do a followup
commit to replace those TSA rules with this mechanism.
2024-10-31 13:11:49 -07:00
Wez Furlong 207bf44f18 docs: format enable_dane.md 2024-10-28 20:46:03 -07:00
Wez Furlong 18cbdeae1a fixup enable_dane page
it was still formatted as if it were part of its former home
in the big page for make_egress_path.

Tidy it up.
2024-10-25 09:09:11 -07:00
Laurent Marchaud 6142808730 fix a few typos in the docs
Signed-off-by: Laurent Marchaud <laurent@marchaud.com>
2024-10-24 12:10:53 -04:00
Wez Furlong bee7153872 docs: update configure_redis_throttles redis-cell info 2024-10-08 13:39:07 -07:00
Wez Furlong 1cc1c703a4 docs: add thread pool tuning functions
These could do with some more exposition and explanation,
but just getting them into the docs is good enough for now
2024-09-24 18:43:53 -07:00
Wez Furlong 667d1a91cb docs: fix check-liveness links 2024-09-09 09:50:46 -07:00
Wez Furlong 4fa23e9a7d http injector: add deferred generation
There's big explanation about this in the included docs change.

The TL;DR is: we can now optionally queue the request and generate it
asynchronously wrt. the incoming injection request.

There's also a throttle that can be used to constrain this, because
the asynchronous submission disconnects the injection request from
any kind of back pressure that we'd otherwise have to indicate to
the injector that there might be load related issues.
2024-09-06 10:12:33 -07:00
Wez Furlong 7fe88f34a6 queue: make the default strategy SingletonTimerWheel 2024-09-02 14:08:48 -07:00
Wez Furlong 541b8f28e4 shaping: add provider concept to shaping helper
This enables shaping based on MX hostname and domain name matching
rules.

At a lower level, this is supported via two new options:
additional_connection_limits and additional_message_rate_throttles that
allow specifying arbitrarily scoped named limits and throttles, which
in addition to allowing provider-based rules in the shaping helper,
allow things like global or other more esoteric scoping of constraints.

closes: https://github.com/KumoCorp/kumomta/pull/260
2024-09-02 10:42:15 -07:00
Wez Furlong a42871cb11 docs: update since dev -> 2024.09.02-c5476b89 2024-09-02 07:27:50 -07:00
Wez Furlong a18308a3b2 docs: mention SingletonTimerWheel 2024-09-01 15:38:12 -07:00
Wez Furlong 7961bff955 docs: split configure_local_logs into multiple pages 2024-08-18 22:28:41 -07:00
Wez Furlong 75e8a32b59 docs: split start_http_listener into multiple pages 2024-08-18 22:18:59 -07:00
Wez Furlong 1b32aa1b4b docs: split start_esmtp_listener into multiple pages 2024-08-18 20:02:35 -07:00
Wez Furlong 34df28bbb1 docs: fixup a few links from page splitting 2024-08-18 19:52:19 -07:00
Wez Furlong dbdd69a8c7 docs: split make_egress_source into separate files 2024-08-18 19:47:35 -07:00
Wez Furlong 632357ac70 docs: split make_egress_pool into separate pages 2024-08-18 19:40:47 -07:00
Wez Furlong b775816885 docs: split make_egress_path into separate pages 2024-08-18 19:33:31 -07:00
Wez Furlong 1bd2b00b4e docs: move make_listener_domain options to their own pages 2024-08-18 19:19:30 -07:00
Wez Furlong 4af9c7035f docs: move make_queue_config fields to their own pages
This makes them easier to search for, and find.
2024-08-18 19:14:34 -07:00
Wez Furlong 84056ffb44 add disk space monitoring
This commit adds disk space monitors for the configured spool
and local log file locations.

Incoming messages will be rejected when the available space is below
the configured amount.

The default minimum is 10%.
2024-08-18 09:17:42 -07:00