Commit Graph
1276 Commits
Author SHA1 Message Date
Wez Furlong e4bb5d674d add msg:dkim_verify()
This method returns an array of AuthenticationResult reflecting
the verification status.

refs: https://github.com/KumoCorp/kumomta/issues/82
2023-09-14 13:03:41 -07:00
Mike Hillyer a13cb785ae Add mention of contributors to the credits page in the documentation. 2023-09-14 15:54:31 -04:00
Wez Furlong 1283646960 ci: skip install mdbook-linkcheck
we no longer use it
2023-09-14 10:31:40 -07:00
Wez Furlong d8bea99caa docs: fixup some rustdoc warnings 2023-09-14 10:29:50 -07:00
Wez Furlong cb1f64fe9d docs: add internal rust API docs to reference section 2023-09-14 10:18:22 -07:00
Wez Furlong 92332a7a65 dkim: have verification return Vec<AuthenticationResult>
Replaces the dkim result types from this crate with
AuthenticationResults which contain the additional
data required to construct high-quality Authentication-Result
headers.

refs: https://github.com/KumoCorp/kumomta/issues/82
2023-09-14 08:33:10 -07:00
Wez Furlong 179723e055 mailparsing: add support for Authentication-Results header
This commit enables parsing and constructing AuthenticationResults
according to https://datatracker.ietf.org/doc/html/rfc8601

refs: https://github.com/KumoCorp/kumomta/issues/82
2023-09-13 20:58:56 -07:00
Wez Furlong ba262ff006 ci: maybe fix docker build for kafka 2023-09-13 09:35:19 -07:00
Wez Furlong 18f7c953bc ci: remove centos7 build
It's having problems building kafka support, and the folks that
were using it won't need it much longer.

So let's skip that headache for now!
2023-09-13 09:29:28 -07:00
Wez Furlong 08089d8f18 http: allow tracing requests
Add `tower_http::trace=debug` to the diagnostic log filter to capture
tracing spans around each HTTP request.
2023-09-12 13:24:53 -07:00
Wez Furlong 18223c7799 docs: add note about http_auth 2023-09-12 12:59:40 -07:00
Wez Furlong e3bb129331 centos7: nth time's the charm for cmake? 2023-09-12 10:21:28 -07:00
Wez Furlong dfe3562a7d smtp_server: fix SMTP AUTH response
When the client used the (inefficient!) multi-stage variant
of AUTH PLAIN, we didn't send the 334 response, so both
parties sat waiting for each other and eventually timed out.
2023-09-12 10:06:10 -07:00
Wez Furlong 123f41d06b centos7: remove cmake rpm 2023-09-12 09:56:01 -07:00
Wez Furlong a04d40df73 centos7: try installing a newer cmake for kafka build 2023-09-12 09:30:37 -07:00
Wez Furlong 8d04b7e99e install cmake for kafka support
refs: https://github.com/KumoCorp/kumomta/issues/32
2023-09-11 16:02:09 -07:00
Wez Furlong fa6acdf378 First run at a kafka integration
It compiles, but is otherwise completely untested as of yet.

Usage:

```lua
local producer = kumo.kafka.build_producer {
  ["bootstrap.servers"] = "localhost:9092",
}
producer:send {
  topic = "my.topic",
  payload = "my payload",
  -- how long to keep trying to submit to kafka
  -- before a lua error will be raised.
  -- This is the default.
  timeout = "1 minute",
}
```

refs: https://github.com/KumoCorp/kumomta/issues/32
2023-09-11 15:30:35 -07:00
Wez Furlong aa53c1dd8e unbound: fix link; should be "obj lib", not "lib obj"
This should fix the build on CI
2023-09-08 20:23:23 -07:00
Wez Furlong a0cd9b20af unbound: refine build some more 2023-09-08 17:12:47 -07:00
Wez Furlong aea2e02755 unbound: deliberate break build so we can see more context 2023-09-08 16:42:26 -07:00
Wez Furlong 1307e32989 unbound: refine probing, maybe fix build? 2023-09-08 15:50:16 -07:00
Wez Furlong b62242bff7 unbound: do proper probing for funcs and headers
hopefully will fix centos 7 build
2023-09-08 14:08:04 -07:00
Wez Furlong 8948cb0334 tempfile: use consistent version across multiple crates 2023-09-08 11:34:19 -07:00
Wez Furlong 89349cf5bc unbound: fix build on various linux
arc4random is on fedora38, but not rhel/centos/rocky/ubuntu lts

Just pretend we don't have it on all systems so we use the fallback.

remove some openssl assumptions that were true for fedora but not ubuntu 20
2023-09-08 08:38:01 -07:00
Wez Furlong 1a5980066a docs: changelog for #81 2023-09-08 06:53:41 -07:00
Nathalie Cai 1aca4ae3a8 add dkim canonicalization to dkim helper 2023-09-08 06:51:04 -07:00
Wez Furlong 4e47a48f80 dns-resolver: add function to resolve TLSA records
refs: https://github.com/KumoCorp/kumomta/issues/8
2023-09-03 06:53:09 -07:00
Wez Furlong f1acad388a dns-resolver: add is_secure flag to MailExchanger
This is set to true when the MX was resolved with DNSSEC validated.

refs: https://github.com/KumoCorp/kumomta/issues/8
2023-09-02 17:05:05 -07:00
Wez Furlong 0a4c8aa39e dns-resolver: add ability to configure unbound
Adds a lua function (needs docs) to do basic configuration of
unbound, and a feature for dns-resolver that is really just to
make it more convenient for me to test and compare the two
resolvers via:

cargo nextest run -p dns-resolver --features live-dns-tests

vs:

cargo nextest run -p dns-resolver --features live-dns-tests,default-unbound
2023-09-02 16:55:15 -07:00
Wez Furlong 2cfe058ba6 dns-resolver: add Unbound resolver as a potential
It's not currently possible to configure it that way, but the
code now allows for that possibility.
2023-09-02 15:47:27 -07:00
Wez Furlong 42034aa31c dns-resolver: refactor to make trust resolve look more unboundy
This is a step towards introducing the ability to select between
the two resolvers
2023-09-02 13:42:21 -07:00
Wez Furlong bffaf88477 unbound: add trust anchor bootstrapping for DNSSEC 2023-09-02 08:58:42 -07:00
Wez Furlong 1f475b98fe unbound: add remaining accessors/API 2023-09-02 07:42:29 -07:00
Wez Furlong 9e4894599c unbound: add error strings 2023-09-02 07:33:56 -07:00
Wez Furlong 90f7ff4735 unbound: expose various config methods 2023-09-02 07:26:28 -07:00
Wez Furlong 04131edf6d unbound: add async query interface 2023-09-02 06:47:11 -07:00
Wez Furlong 3bbe7b59b7 add libunbound
This is sufficient to run a basic resolve and return some answers
2023-09-01 20:25:53 -07:00
Wez Furlong 9423f07b66 add: libunbound-sys
This crate vendors in the unbound sources and builds libunbound
for use as a DNS resolver.
2023-09-01 17:13:11 -07:00
Wez Furlong c99d949d5a tsa: don't fail publish request for NXDOMAIN domains
Also annotate errors to make it more obvious in logs where
the error is originating.
2023-08-31 10:29:58 -07:00
Wez Furlong 250db18fae server-common: re-print initialization errors
If init fails, we log an error message immediately, then proceed
to shut down the server, which then prints a succint "Error:
Initialization raised an error" message.

It can be easy to overlook the error context and conclude that
there is none.

This commit will now re-display the error message at the bottom,
so that it is printed out twice.

For example:

```
./target/debug/kumod --policy /tmp/bad.lua
2023-08-31T17:20:46.569685Z  INFO localset-0 kumo_server_common::http_server: http listener on 0.0.0.0:8000
2023-08-31T17:20:46.570330Z  INFO localset-0 kumo_server_common::http_server: https listener on 0.0.0.0:8001
2023-08-31T17:20:46.570761Z  INFO localset-0 kumod::smtp_server: smtp listener on 0.0.0.0:2025
2023-08-31T17:20:46.621327Z ERROR localset-0 kumo_server_common::start: problem initializing: callback error
stack traceback:
        [C]: in function 'kumo.on'
        [string "/tmp/bad.lua"]:86: in function <[string "/tmp/bad.lua"]:6>
caused by: Attempting to register an event handler via `kumo.on('get_listener_domain', ...)` from within the event handler 'init'. You must move your event handler registration so that it is setup directly when the policy is loaded in order for it to consistently trigger and handle events.
2023-08-31T17:20:46.621437Z  INFO localset-0 kumo_server_common::start: initialization complete
2023-08-31T17:20:46.621581Z  INFO localset-0 kumod::smtp_server: smtp listener on 0.0.0.0:2025 -> stopping
2023-08-31T17:20:46.622242Z  INFO       main kumo_server_common::start: Shutdown completed OK!
Error: Initialization raised an error: callback error
stack traceback:
        [C]: in function 'kumo.on'
        [string "/tmp/bad.lua"]:86: in function <[string "/tmp/bad.lua"]:6>
caused by: Attempting to register an event handler via `kumo.on('get_listener_domain', ...)` from within the event handler 'init'. You must move your event handler registration so that it is setup directly when the policy is loaded in order for it to consistently trigger and handle events.
```
2023-08-31 10:21:11 -07:00
Wez Furlong d3b4a191af MTA-STS: expose to path config, implement in smtp_dispatcher
This should be sufficient to enable this feature!

refs: https://github.com/KumoCorp/kumomta/issues/7
2023-08-31 08:54:12 -07:00
Wez Furlong a9c190c2d5 mta-sts: add mx matching helper 2023-08-31 08:11:42 -07:00
Wez Furlong b3c1117005 mta-sts: implement higher level policy fetch/cache 2023-08-31 08:10:36 -07:00
Wez Furlong 8b7776e34d mta-sts: parser/loader for policy dns and http info
refs: https://github.com/KumoCorp/kumomta/issues/7
2023-08-30 16:13:01 -07:00
Wez Furlong a9c8122675 dns-resolver: allow grabbing the resolver
Switch to using ArcSwap to manage owning the resolver; that makes
it a bit cheaper than the rwlock we were using before, and also
allows sharing out a reference to the resolver for use by other
crates that don't really need to take a direct dep on this one.
2023-08-30 08:53:55 -07:00
Nathalie CaiandNathalie Cai 6bb9ac387c add mx_list_ip_map to smtp protocole for tls connection (#80)
add mx_list_ip_map to smtp protocole for tls connection

Co-authored-by: Nathalie Cai <ncai@chapsvision.com>
2023-08-30 08:29:18 -07:00
Wez Furlong bbfa1122c4 docs: unconditionally install social plugin deps
mkdocs now refuses to start without them installed, even when
this plugin is disabled.
2023-08-30 08:26:08 -07:00
Wez Furlong f536657e08 allow optional spaces after MAIL FROM:, RCPT TO:
closes: https://github.com/KumoCorp/kumomta/issues/76
2023-08-30 08:18:39 -07:00
Wez Furlong 5d9d32e7ed Automated doc formatting fix 2023-08-30 00:25:15 +00:00
Wez Furlong 134014d988 message: avoid rebuilding when the fix only requires adding headers 2023-08-29 17:22:09 -07:00