We had a sponsor report an issue where we'd log an error during
processing a log hook. It transpired that the recipient list we were
attempting to log was `["metadata is not loaded"]`, which doesn't parse
as a valid EnvelopeAddress (see prior commit:
52e2f95e9f)
This commit fixes up the recipient_list logic in the logging function to
avoid taking the error message as the recipient list, and moves the
metadata loading to happen just before we try to read the recipient
list.
This should work around the issue, but a consequence is that we might
be holding on to the metadata for that message in RAM for longer than
we should; will need to do some thinking about managing the resident
status in this situation better.
This aggregates the various authentication-results producing auth checks
into a more convenient function.
Part of this change improves some plumbing in the dkim checking (we no
longer raise an error for a missing From, but instead indicate a failed
dkim result), and we now support passing down a resolver name to the
various checking functions, to facilitate testing and other more
advanced use cases.
refs: https://github.com/KumoCorp/kumomta/issues/16
refs: https://github.com/KumoCorp/kumomta/issues/84
This commit adds some plumbing to allow us to collect metadata
about the caches and spit it out into a json file that we can
then use in the docs to show the predefined caches, capacities
and brief comments about their purpose.
We put that info on the set_lruttl_cache_capacity doc page.
Augment the docs to clarify that msg:append_header and
msg:prepend_header do no modification of the value by default.
Adjust the wrapping used by Header:new_unstructured so that it
hard wraps before the SMTP line length limit.
Add optional encode parameter to msg:append_header and
msg:prepend_header so that those methods can opt-in to the
Header:new_unstructured formatting.
Add HeaderMap:append method to mirror the existing HeaderMap:prepend
method.
Add unit tests that demonstrate the effect of wrapping/encoding
for both the "dumb" msg:append_header and msg:prepend_header functions,
and the "smarter" HeaderMap:prepend and HeaderMap:append methods that
always encode their parameters.
Update the docs for the headermap flavor of these methods to indicate
that they will always encode the value.
This allows a (more or less) arbitrary lua function to be used to load
data.
The primary advantage of this is that the size of the resulting
KeySource struct is smaller than it would be to hold the actual data
inline. It also enables the surrounding code to be slightly better
factored.
Add CBC and ecb Block mode aes encryption/decryption.
To facilitate testing this better, and just to be nicer overall, adjust
data-loader's KeySource::key_data variant to support loading raw binary
bytes.
Co-authored-by: Wez Furlong <wez@wezfurlong.org>
Closes: https://github.com/KumoCorp/kumomta/pull/395
Add a convenience function that is intended to be used around the
time that you might be building up the overall set of
Authentication-Results.
Populate missing smtp.mailfrom in SPF authentication result.
This is incremented each time we log a Rejection record from the smtp
server.
The service label identifies the listener address, and there is a
special `total` that is incremented as a rollup across all listeners.
```
# HELP smtp_server_rejections number of Rejection records logged by the smtp server
# TYPE smtp_server_rejections counter
smtp_server_rejections{service="127.0.0.1:2025"} 1
smtp_server_rejections{service="total"} 1
```
closes: https://github.com/KumoCorp/kumomta/issues/429