Commit Graph
11 Commits
Author SHA1 Message Date
Wez Furlong 7ac9a5eac0 smtp_dispatcher: handle pathologic all-452 case
Continuing in the same vein as 94628f06ab,
ensure that we have a reasonable outcome when a batch of size > 1
encounters 100% ambiguous 452 responses.

Without special consideration we'd end up in an infinite retry loop for
these, as we'd think that we'd hit the recpient limit on the connection
every time.

This commit introduces a small amount of state into the dispatcher so
that we can remember the set of (spoolid, recipient) from the prior
transaction on the session.

When deciding whether something is eligible for immediate retry
we will gate that choice on the current (spoolid, recipient) being
absent from the prior set of ids.  In this way, we bound the immediate
retry for a recipient to one per connection.

To make things a bit more robust when trying to decide whether a 452
means "too many recipients" or not, if we're not sure, we now call out
to the bounce classifier which can be configured to emit a
`TooManyRecipients` classification.  If the classifier produces either
that or some non-Uncategorized response, then we have a confident
assessment.  Otherwise, we're unsure and will factor that into the
retry strategy.
2025-11-07 08:13:36 +00:00
Wez Furlong e3fdcaa628 cargo clippy --fix 2025-04-09 10:26:07 -07:00
Dirkjan Ochtman 18db31f204 Manage all external dependencies at the workspace level 2024-11-13 13:50:27 -07:00
Dirkjan Ochtman 6c37410042 Use a workspace dependency for serde 2024-10-15 06:04:53 -07:00
Wez Furlong 3839b58d94 bounce classifier: make match order more predictable
Previously, the use of BTreeMap for the rules resulted in the overall
rule order being changed in a surprising way; the key order of the map
set the overall order by category and then by the order that the rules
appeared in the file.

This commit uses an OrderMap to preserve the ordering of the keys
in the TOML (or JSON) file so that they match the order in which
they appear in the file, rather than having them become implicit
sorted by key.

Secondly, it removes the use of BTreeMap in the overall classifier
state, so that the all of the patterns are presented in the order
in which they appeared in the sequence of files loaded in the classifier
setup.

A unit test has been added to assert that matching of ambiguous (in this
case, identical) patterns takes its precedence from the order that the
patterns appear in the file.
2024-08-06 20:50:59 -07:00
dependabot[bot] 113eeb5380 build(deps): bump the all group with 13 updates
Bumps the all group with 13 updates:

| Package | From | To |
| --- | --- | --- |
| [strum](https://github.com/Peternator7/strum) | `0.25.0` | `0.26.1` |
| [k9](https://github.com/aaronabramov/k9) | `0.11.6` | `0.12.0` |
| [lipsum](https://github.com/mgeisler/lipsum) | `0.8.2` | `0.9.0` |
| [zstd](https://github.com/gyscos/zstd-rs) | `0.12.4` | `0.13.0` |
| [tungstenite](https://github.com/snapview/tungstenite-rs) | `0.20.1` | `0.21.0` |
| [async-channel](https://github.com/smol-rs/async-channel) | `1.9.0` | `2.1.1` |
| [flume](https://github.com/zesterer/flume) | `0.10.14` | `0.11.0` |
| [metrics](https://github.com/metrics-rs/metrics) | `0.20.1` | `0.22.0` |
| [env_logger](https://github.com/rust-cli/env_logger) | `0.10.2` | `0.11.1` |
| [notify](https://github.com/notify-rs/notify) | `5.2.0` | `6.1.1` |
| [zstd-safe](https://github.com/gyscos/zstd-rs) | `6.0.6` | `7.0.0` |
| [which](https://github.com/harryfei/which-rs) | `4.4.2` | `6.0.0` |
| [git2](https://github.com/rust-lang/git2-rs) | `0.16.1` | `0.18.1` |


Updates `strum` from 0.25.0 to 0.26.1
- [Release notes](https://github.com/Peternator7/strum/releases)
- [Changelog](https://github.com/Peternator7/strum/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Peternator7/strum/commits/v0.26.1)

Updates `k9` from 0.11.6 to 0.12.0
- [Commits](https://github.com/aaronabramov/k9/commits)

Updates `lipsum` from 0.8.2 to 0.9.0
- [Release notes](https://github.com/mgeisler/lipsum/releases)
- [Commits](https://github.com/mgeisler/lipsum/compare/0.8.2...0.9.0)

Updates `zstd` from 0.12.4 to 0.13.0
- [Release notes](https://github.com/gyscos/zstd-rs/releases)
- [Commits](https://github.com/gyscos/zstd-rs/compare/v0.12.4...v0.13.0)

Updates `tungstenite` from 0.20.1 to 0.21.0
- [Changelog](https://github.com/snapview/tungstenite-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/snapview/tungstenite-rs/compare/v0.20.1...v0.21.0)

Updates `async-channel` from 1.9.0 to 2.1.1
- [Release notes](https://github.com/smol-rs/async-channel/releases)
- [Changelog](https://github.com/smol-rs/async-channel/blob/master/CHANGELOG.md)
- [Commits](https://github.com/smol-rs/async-channel/compare/v1.9.0...v2.1.1)

Updates `flume` from 0.10.14 to 0.11.0
- [Changelog](https://github.com/zesterer/flume/blob/master/CHANGELOG.md)
- [Commits](https://github.com/zesterer/flume/commits)

Updates `metrics` from 0.20.1 to 0.22.0
- [Changelog](https://github.com/metrics-rs/metrics/blob/main/release.toml)
- [Commits](https://github.com/metrics-rs/metrics/compare/metrics-v0.20.1...metrics-v0.22.0)

Updates `env_logger` from 0.10.2 to 0.11.1
- [Release notes](https://github.com/rust-cli/env_logger/releases)
- [Changelog](https://github.com/rust-cli/env_logger/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rust-cli/env_logger/compare/v0.10.2...v0.11.1)

Updates `notify` from 5.2.0 to 6.1.1
- [Release notes](https://github.com/notify-rs/notify/releases)
- [Changelog](https://github.com/notify-rs/notify/blob/main/CHANGELOG.md)
- [Commits](https://github.com/notify-rs/notify/commits/notify-6.1.1)

Updates `zstd-safe` from 6.0.6 to 7.0.0
- [Release notes](https://github.com/gyscos/zstd-rs/releases)
- [Commits](https://github.com/gyscos/zstd-rs/compare/zstd-safe-6.0.6...zstd-safe-7.0.0)

Updates `which` from 4.4.2 to 6.0.0
- [Release notes](https://github.com/harryfei/which-rs/releases)
- [Changelog](https://github.com/harryfei/which-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/harryfei/which-rs/compare/4.4.2...6.0.0)

Updates `git2` from 0.16.1 to 0.18.1
- [Changelog](https://github.com/rust-lang/git2-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/git2-rs/compare/0.16.1...git2-0.18.1)

---
updated-dependencies:
- dependency-name: strum
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: all
- dependency-name: k9
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: all
- dependency-name: lipsum
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: all
- dependency-name: zstd
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: all
- dependency-name: tungstenite
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: all
- dependency-name: async-channel
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: all
- dependency-name: flume
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: all
- dependency-name: metrics
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: all
- dependency-name: env_logger
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: all
- dependency-name: notify
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: all
- dependency-name: zstd-safe
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: all
- dependency-name: which
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: all
- dependency-name: git2
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: all
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-06 19:23:23 -07:00
Wez Furlong fa7d12f562 deps: update toml 2024-02-06 15:10:51 -07:00
Wez Furlong e6973c2a04 slim down some deps
This helps to remove "false" deps on things like openssl; now that
is linked in only to those components that need it (eg: things that
use unbound for dnssec, or the smtp client for DANE).

This makes the binaries other than kumod (which still has max deps)
a few MB smaller; not a massive win, but nice all the same.
2023-12-22 10:24:30 -07:00
Wez Furlong ec937b52ef Allow using arbitrary bounce classification labels
refs: https://github.com/KumoCorp/kumomta/issues/98
2023-11-29 12:09:05 -07:00
Wez Furlong d5b13a263b Add kumo.configure_bounce_classifier
and connect it to the logger
2023-03-02 08:59:03 -07:00
Wez Furlong 74635be9fb Add extensible bounce classifier
The classifier can load and merge rules from multiple files.
A basic iana enhanced status codes ruleset is provided.
A deployment can define their own to augment that set.

This commit is just the core classifier functionality; it
is not yet connected to kumod.

The classification enum is a bit of an amalgam of categories
defined by other well-known vendors/products and the categories
defined by IANA.  Some classifications have no corresponding
rules at the current time.
2023-03-02 08:27:32 -07:00