Commit Graph
1190 Commits
Author SHA1 Message Date
Wez Furlong 452bede2e1 dkim: switch to our own mailparsing implementation 2023-08-25 08:55:28 -07:00
Wez Furlong 413566cd94 dkim: simplify building test resolver 2023-08-25 08:55:28 -07:00
Wez Furlong a42d8967cd dkim: remove Arc requirement from verification interface
It seems like this was working around an issue that does
not appear to be an issue any more.
2023-08-25 08:55:28 -07:00
Wez Furlong 6fead2d6b2 rename our forked dkim crate
We're diverging a decent amount, so let's use our own name
2023-08-25 08:55:28 -07:00
Wez Furlong 24909f4cde docs: update for 2023.08.22-4d895015 release 2023-08-25 08:38:09 -07:00
Wez Furlong 9e5f4e6ed8 CI: add write permissions to make-release.yml 2023-08-25 08:02:14 -07:00
Wez Furlong 4d89501564 update trust-dns-resolver to 0.23
With the mail-auth dep removed, we can now update this dep.
2023-08-22 17:40:14 -07:00
Wez Furlong dff9e50882 remove mail-auth dep
The only remaining usage was in a benchmark
2023-08-22 17:30:26 -07:00
Wez Furlong 05e52d4ce6 message: switch ed25519 dkim signing to cfdkim
With the upgraded ed25519-dalek crate, it's now possible to
pass in either DER or PEM encoded PKCS8 signing keys, which
makes it feasible to remove the mail-auth dep from this crate.

That in turns reduces the amount of code in here, which is nice.
2023-08-22 17:27:06 -07:00
Wez Furlong 4ad227b89e cfdkim: upgrade ed25519-dalek to 2.0.0
This release fixes an API wart that required loading both private
and public keys to create a signer.
2023-08-22 16:59:11 -07:00
Wez Furlong d4f2d2bb87 deps: remove unreferenced dep from kumod 2023-08-22 16:35:08 -07:00
Wez Furlong 34f116f0eb smtp_server: fixup rejection handling in smtp_server_message_received
Two issues:

* A kumo.reject(421,...) wasn't guaranteed to terminate the session,
  so make it do that.

* A non-421 kumo.reject would prevent the current candidate message from
  being queued, but could result in a spurious additional 250 ok
  response.

  Refactor the data phase processing so that we first make a pass
  over the messages to allow allow of them to be assessed by the
  event before we commit to logging and injecting any of them.

  Since the spool system is not (and cannot be made to be)
  transactional across multiple messages, there is still a possibility
  that a failure to spool at this stage will result in the
  previously accepted messages from that batch being accepted,
  event though we will then respond to the client with a failure
  code.

closes: https://github.com/KumoCorp/kumomta/issues/79
2023-08-22 15:55:03 -07:00
Wez Furlong d47e0d9b44 rustfmt 2023-08-22 11:39:10 -07:00
Wez Furlong 076b2001f6 CI: trigger main rust build for dependabot Cargo.lock changes 2023-08-22 11:36:40 -07:00
Wez Furlong 891ca2a230 Cargo update 2023-08-22 11:35:18 -07:00
Wez Furlong 74f3ebd26e allow configuring DNS resolver parameters 2023-08-22 11:32:23 -07:00
Wez Furlong 92212e93e9 ci: disable caching for main rust build
Not enough space otherwise(!)
2023-08-21 13:03:48 -07:00
Tom Mairs 519f508139 fix link 2023-08-21 17:14:03 +00:00
Wez Furlong 230ff7606e docs: fix links generated by since macro 2023-08-21 10:05:16 -07:00
Tom Mairs 502ae37e44 fix curl sample 2023-08-21 16:43:58 +00:00
Wez Furlong 1560e8bbae Revert "ci: maximize disk space for the docker build as well"
This reverts commit bd52d45c8e.
2023-08-21 06:30:29 -07:00
Wez Furlong 80bb116cb7 shaping: downgrade conflicting mx domains to a warning
The mail must flow!

However, it is unspecified which shaping rules we'll actually use in
that situation; the current effective order of resolution and behavior
must not be relied upon and may change without notice or anyone even
realizing that it changed.
2023-08-21 06:25:09 -07:00
Wez Furlong bd52d45c8e ci: maximize disk space for the docker build as well 2023-08-18 10:39:52 -07:00
Wez Furlong 8663578111 ci: disable caching of our rust bits in container builds
Space is at a premium in there, and the cache is too large.
2023-08-18 10:36:29 -07:00
Wez Furlong aafa7b012f CI: can't run a script in the repo before we've checked it out 2023-08-18 10:18:29 -07:00
Wez Furlong bbe1cab88a CI: try to prune space while we're running 2023-08-18 10:16:46 -07:00
Wez Furlong df3978f9c6 ensure we move to next host for smtp client timeout
Re-using the existing connection will likely be a bad idea.
2023-08-18 10:00:50 -07:00
Wez Furlong c76d3290bb consider smtp client timeouts in send_email to be transfails
Previously, we'd let these get rolled into the "something went wrong
with this host, let's try the next" bucket.

Now we directly consider them to be transient failures, log them
and requeue them.
2023-08-18 08:06:29 -07:00
Wez Furlong 068e5d8f30 ci: don't build twice in the main rust workflow 2023-08-17 14:05:33 -07:00
Wez Furlong 52ef34c967 ci: disable incremental builds
The hope is that this reduces disk overheads in the target directory
2023-08-17 13:30:55 -07:00
Wez Furlong 3d0d699692 ci: rm maximize-build-space action from containerized builds
It doesn't work for those
2023-08-17 12:58:40 -07:00
Wez Furlong 889d42a445 CI: take a stab at improving free space before running
Seems like everyone on the internet is finding that GH actions
disk space is a bit tight.  Let's adopt this action that is
intended to delete some things that are not often used and
see if that helps our builds
2023-08-17 12:49:25 -07:00
Wez Furlong 3e35d8143f deps: update tokio and related deps 2023-08-17 10:49:25 -07:00
Wez Furlong d843579d1e refactor: control some dep versions via workspace Cargo.toml
This makes it easier to upgrade the version holistically later.
2023-08-17 10:49:25 -07:00
Wez Furlong cfe496524a Create dependabot.yml 2023-08-17 10:45:36 -07:00
Wez Furlong 629b65533a smtp client: remove [] from ip literal host names 2023-08-17 09:45:10 -07:00
Wez Furlong 7223bd1be1 cargo update 2023-08-16 20:43:01 -07:00
Wez Furlong f2920266df smtp client: RSET at the start of send_mail
Speculatively clear out any weird state that we may be in.
2023-08-16 19:46:19 -07:00
Wez Furlong 2a8397d6ff ready_queue: improve debug logging for deliver_message error case 2023-08-16 19:40:51 -07:00
Wez Furlong f48af29093 rfc5321 client: improve trace diagnostics 2023-08-16 18:40:29 -07:00
Wez Furlong 786e053ba5 catch kumo.on called inside kumo.on
Event handlers must be registered at the file scope and not from
within another event handler in order for events to be consistently
triggered and handled.

In particular, the `init` event is only ever triggered once on
server startup.  If other handlers are registered from within the
init event, those will only ever fire when we re-use that original
lua context, which is good for a limited number of uses before it
is aged out of the resource pool.  That might work under very
limited or lightweight testing scenarios, but will otherwise
result in very inconsistent behavior.

We now catch and prevent, with a very visible error, attempting
to call `kumo.on` from within an event handler.
2023-08-16 16:21:51 -07:00
Wez Furlong d05f4cd8fa smtp client: try parsing ServerName from ip addr
`ServerName::try_from` doesn't consider ip addresses, so let's
explicitly consider them ourselves first and see if we get
any better results.

https://docs.rs/rustls/latest/rustls/client/enum.ServerName.html
2023-08-16 09:08:28 -07:00
Wez Furlong 998f3dca20 improve error message when using TLS with an ip literal
Previously, it would result in:

"KumoMTA internal: failed to connect to any candidate hosts: invalid DNS name: invalid dns name: invalid dns name, invalid DNS name: invalid dns name: invalid dns name"

which is not at all instructive.

Now it should report something like:

"KumoMTA internal: failed to connect to any candidate hosts: STARTTLS: 10.0.0.1 is not a valid DNS name"
2023-08-16 08:59:32 -07:00
Wez Furlong 71924490d3 message: add set_recipient and set_sender methods 2023-08-15 14:51:35 -07:00
Wez Furlong d46d3754af refactor: extract our nom_utils
Should make it easier to reuse in a later commit
2023-08-14 07:54:33 -07:00
Wez Furlong 699c4e7dad mailparsing: fix warning about unused overall_conformance field
Just expose it as header conformance
2023-08-14 07:29:53 -07:00
Wez Furlong d26e34553c cargo update 2023-08-14 07:23:21 -07:00
Wez Furlong 29169f96bb mailparsing: our own error chain type
with blackjack and External errors.

Add some error case tests to validate the error output
2023-08-13 22:10:15 -07:00
Wez Furlong fae08d33ab mailparsing: add Content-Disposition header 2023-08-13 22:10:15 -07:00
Wez Furlong e862291a5b mailparsing: tidy up and add some accessors 2023-08-13 22:10:15 -07:00