Commit Graph

46 Commits

Author SHA1 Message Date
Tom Mairs 6d4ef9a303 fix typo 2024-07-09 15:09:09 +00:00
Wez Furlong 722f19a078 docs: fix name of requeue_message event in the example 2024-07-08 09:11:34 -07:00
Wez Furlong ef8cbea354 docs: fixup links to the rapidoc http page 2024-06-27 19:56:53 -07:00
Wez Furlong e683fed556 docs: move Log Record to its own reference page
This makes it a bit easier to find and link to.
2024-06-27 08:28:45 -07:00
Wez Furlong a2d76df7a9 NEW: rebind API and kcli subcommand
refs: https://github.com/KumoCorp/kumomta/issues/209
2024-06-24 12:26:06 -07:00
Wez Furlong 8673045fff docs: update for latest release 2024-06-10 09:30:17 -07:00
Wez Furlong 5a1999a1b1 Add kumo.make_throttle and throttle_insert_ready_queue event
These allow performing arbitrary rate limiting operations
at both reception time and when messages are moved from the
scheduled queue and into the ready queue.

refs:  https://github.com/KumoCorp/kumomta/issues/149
2024-03-15 12:21:57 -07:00
Wez Furlong a16a886f0e add requeue_message event
In the end I decided to implicitly make the message due for immediate
delivery in the case where the queue was changed; I couldn't think
of a good reason not to do that, and it simplifies the implementation
both of the event internals for anyone implementing the event
themselves in their lua policy.

refs: https://github.com/KumoCorp/kumomta/issues/149
2024-03-08 13:35:06 -07:00
Mike Hillyer 95c3e3b444 Build out new page on inbound SMTP AUTH, update related documents and TOC, rename smtpauth page outbound_auth to differentiate from inbound_auth.md. Update smtp listener page to point to it, update refman auth plain page to reflect latest fields. 2023-12-07 17:00:58 -05:00
Wez Furlong 8af7e85c6b docs: update version info for latest release 2023-11-29 12:08:34 -07:00
Wez Furlong c1c4ce723e add pre_init event 2023-11-06 08:10:53 -07:00
Wez Furlong 1872dc71a0 shaping: calling shaper.should_enqueue_log_record is no longer required
Allow multiple should_enqueue_log_record hooks to be registered,
and take advantage of that inside the shaping helper.

`shaper.should_enqueue_log_record` no longer needs to be explicitly
plumbed from the config, but we allow calling it still for compatibility
reasons.

We will remove that compatibility after the next stable release.
2023-11-03 08:52:40 -07:00
Wez Furlong 929d51deba events: plumbing for registering multiple handlers
Previously, we'd restrict `kumo.on` to allowing just a single
instance of an event to be registered. The purpose of this was
to help surface logical errors where copypasta would result in
a bogus configuration.

With multiple helper lua modules now wanting to take responsibility
for some portion of the event handling, it is becoming more complex
to stitch things together.

It is desirable to allow multiple handlers for certain events,
so that a module can handle just its area of responsibility
without worry other modules about it.

This commit introduces a CallbackSignature type that allows
defining the function signature for event callbacks.

The signature can be pre-created and registered ahead of setting
up any lua contexts, which allows declaring whether an event
can have multiple callbacks registered.

The `get_queue_config` event handler has been set to allow multiple
callbacks.
2023-11-02 18:11:17 -07:00
Wez Furlong ffc15f2f74 docs: smtp_client_rewrite_delivery_status: see also memoize 2023-11-01 13:45:05 -07:00
Wez Furlong 10bade362b docs: add version info to rewrite and regex set map 2023-11-01 13:41:34 -07:00
Wez Furlong 343411c3d2 Add event for rewriting a failed smtp response
This will only trigger for messages where we've gotten to MAIL FROM or
later, and where we got a non-250 response.

The event is passed the response + the domain, tenant, campaign and
routing domain.  It can return an alternative response code value
or `null` to indicate no change.
2023-11-01 13:25:15 -07:00
Wez Furlong 39a046e07c docs: add missing routing_domain param to get_queue_config event examples 2023-10-18 06:56:01 -07:00
Wez Furlong 18223c7799 docs: add note about http_auth 2023-09-12 12:59:40 -07:00
Wez Furlong 24909f4cde docs: update for 2023.08.22-4d895015 release 2023-08-25 08:38:09 -07:00
Wez Furlong d35bffc80d Automated doc formatting fix 2023-08-12 13:55:14 +00:00
Wez Furlong 99fcfbc64e kumod: refresh queue_config periodically
This commit causes the scheduled queue maintainer to refresh
the queue config by calling the get_queue_config event approximately
every minute while the queue is alive.

In addition, we now thread the routing_domain through to get_queue_config
2023-08-12 06:22:54 -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
Wez Furlong b08c865bdb docs: include new tsa related info to the reference section 2023-08-04 11:05:08 -07:00
Wez Furlong 0c7978e341 breaking: configure_log_hook: add required name parameter
The name is passed through to should_enqueue_log_record as an additonal
parameter to make it possible to reason about whether a given record
should get queued for a specific log hook instance.

This is a breaking change, but it can be easily resolved by adding
the name parameter to the `configure_log_hook` call.
2023-07-03 08:45:58 -07:00
Wez Furlong f65e985e64 docs: add since macro. document connection metadata object 2023-06-28 13:52:15 -07:00
Wez Furlong e8a049cc83 document listener parameter to get_listener_domain update helpers
Allow per-listener listener-domain configuration
2023-05-31 15:46:12 -07:00
Wez Furlong ce7dece927 move domains out of listener, replace with get_listener_domain event
This commit also includes a policy helper
`policy_extras.listener_domains` to make it convenient to define
listener domains in toml and/or json files.

To facilitate this, the DomainMap rust structure has been exposed
to lua code via the new `kumo.domain_map.new` function.
2023-05-31 12:29:44 -07:00
Wez Furlong b7c557c31a define_egress_(pool|source) -> make_egress_(pool|source)
Switch the configuration plumbing for pools and sources to be pull-based
rather than push based.

In other words, rather than defining them in the `init` event,
you now need to supply them to the new `get_egress_pool` and
`get_egress_source` events.

Data is cached by default for 1 minute. This allows for new sources
to come into being on-demand, and for data to age out and change
over time, without requiring that the server be restarted.

This commit updates the reference section, but there is some content
in the user guide that refers to the old style of configuration that
will need to be updated.

refs: https://github.com/KumoCorp/kumomta/issues/13
2023-05-30 14:08:07 -07:00
Wez Furlong 9b1d82275c add spool_message_enumerated event
closes: #42
2023-05-30 10:14:37 -07:00
Mike Hillyer 0eefbccd5d Typo fix. 2023-05-18 16:44:32 -04:00
Wez Furlong cceaccf06a docs: webhook/lua delivery reference
refs: https://github.com/KumoCorp/kumomta/issues/36
refs: https://github.com/KumoCorp/kumomta/issues/18
2023-05-08 13:51:06 -07:00
Wez Furlong 384da92c0e docs: update dkim signing to use header from 2023-03-14 18:53:47 -07:00
Mike Hillyer af04bd7ce0 Update time notation and example script. 2023-03-14 19:12:46 -04:00
Wez Furlong b56bed5060 docs: fix admonish syntax, explain the global variable thing better 2023-03-11 23:06:59 -07:00
Wez Furlong 269e0702b4 add SMTP AUTH PLAIN support
Verified via:

```
swaks ... --auth plain --tls --auth-user scott --auth-password tiger
```
2023-03-11 16:23:49 -07:00
Wez Furlong 523492da26 docs: fixup dkim signing 2023-03-03 10:56:22 -07:00
Wez Furlong f912fab58b docs: egress source, egress path etc. 2023-02-28 10:31:00 -07:00
Wez Furlong 9ab1727792 rename: dest_site -> egress path 2023-02-28 09:56:20 -07:00
Wez Furlong 93ff9e1991 adjust dest_site to queue based on source->site
There needs to be another pass over this for naming,
but this brings us closer to the state shown in the
diagram in the readme.
2023-02-28 06:29:26 -07:00
Wez Furlong 0eefb02bed make destination site queues per-tenant
To facilitate this, formatlize the `campaign:tenant@domain` naming
and add a helper type to parse and format that tuple of information
to make it easier to work with in the code.

Adjust the get_x_config events to accept those parameters.
2023-02-26 19:59:56 -07:00
Wez Furlong 73f1c179f0 rename http_message_injected -> generated
that better reflects when it is being called
2023-02-26 10:35:07 -07:00
Wez Furlong 1935f21953 add http_message_injected event for signing http injected mail 2023-02-26 10:23:49 -07:00
Wez Furlong fcb665f841 docs: note that the message has a Received header 2023-02-26 09:43:48 -07:00
Wez Furlong 6645763606 docs: document HTTP APIs 2023-02-25 22:42:08 -07:00
Wez Furlong 51d9928ead docs: add more reference content 2023-02-25 20:41:50 -07:00
Wez Furlong bfe1d5f94b docs: add some basic reference info
The content here needs to be fleshed out some more, but this commit
is intended to get the skeleton in place.
2023-02-25 14:59:20 -07:00