Commit Graph

1381 Commits

Author SHA1 Message Date
Jagoda Estera Ślązak 93c0c3a891 feat: Check incoming email return address (#72)
If the MAIL FROM doesn't match the From header,
we do not reject the mail, as this can be caused
by e.g. SRS forwarding. Instead, we reset the envelope
address, so it is reinjected as `MAIL FROM:<>`
to prevent sending a bounce message.

Closes #67

Signed-off-by: Jagoda Ślązak <jslazak@jslazak.com>
2026-08-18 12:21:28 +02:00
Jagoda Estera Ślązak b05164a86e refactor: Check if email is encrypted before verifying DKIM (#71)
This way we won't be logging DKIM rejections on messages that
would be rejected anyway due to not being encrypted.

Fixes #69

Signed-off-by: Jagoda Ślązak <jslazak@jslazak.com>
2026-08-18 12:21:28 +02:00
Jagoda Estera Ślązak d64d546582 fix(logs): Log correct address for outbound messages (#70)
Fixes #68

Signed-off-by: Jagoda Ślązak <jslazak@jslazak.com>
2026-08-18 12:21:27 +02:00
Jagoda Estera Ślązak 9cf0bba7ed chore(release): prepare for 0.5.1 (#65)
Signed-off-by: Jagoda Ślązak <jslazak@jslazak.com>
2026-08-18 12:21:27 +02:00
Jagoda Estera Ślązak 4e274ae280 fix(logs): Log From address instead of envelope MAIL FROM. (#66)
Fixes #64

Signed-off-by: Jagoda Ślązak <jslazak@jslazak.com>
2026-08-18 12:21:27 +02:00
Jagoda Estera Ślązak 8fefc1cc94 fix(dkim): Accept TXT records with escaped quotes (#61) 2026-08-18 12:21:27 +02:00
Jagoda Estera Ślązak 83aa54bb82 fix(smtp): Properly handle bounce messages (#63)
Closes #58

Signed-off-by: Jagoda Ślązak <jslazak@jslazak.com>
2026-08-18 12:21:27 +02:00
dependabot[bot] 7f6215b875 chore(deps): Bump taiki-e/install-action from 2.67.30 to 2.68.5 (#57)
Bumps [taiki-e/install-action](https://github.com/taiki-e/install-action) from 2.67.30 to 2.68.5.
- [Release notes](https://github.com/taiki-e/install-action/releases)
- [Changelog](https://github.com/taiki-e/install-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/taiki-e/install-action/compare/288875dd3d64326724fa6d9593062d9f8ba0b131...71b48393496777ee11188c07a34d48b048a985cd)

---
updated-dependencies:
- dependency-name: taiki-e/install-action
  dependency-version: 2.68.5
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-08-18 12:21:27 +02:00
Jagoda Estera Ślązak 9d22b2b79a fix(dkim): Accept TXT records with no v= tag (#62)
Cache at most 3 TXT records instead of trying to find one that includes `DKIM`.

Closes #59

Signed-off-by: Jagoda Ślązak <jslazak@jslazak.com>
2026-08-18 12:21:27 +02:00
Jagoda Estera Ślązak 60ce20d3aa chore(release): prepare for 0.5.0 (#56)
Signed-off-by: Jagoda Ślązak <jslazak@jslazak.com>
2026-08-18 12:21:27 +02:00
Jagoda Estera Ślązak d823b28390 feat: Save rejected messages to /tmp (#55) 2026-08-18 12:21:27 +02:00
l 4fde0d5c5f refactor: do not copy the mail in memory for DKIM verification (#54)
`String::from_utf8_lossy` always copies the data
for the case when it needs to replace invalid UTF-8,
but we don't want invalid UTF-8 anyway as replacing
invalid UTF-8 characters will break DKIM signature.
2026-08-18 12:21:27 +02:00
Jagoda Estera Ślązak 5b24879573 fix(dkim): Make simple header canonicalization work properly (#53)
Previously header parsing caused leading whitespaces to be
trimmed in HeaderBody, which resulted in incorrect simple
header canonicalization.

Signed-off-by: Jagoda Ślązak <jslazak@jslazak.com>
2026-08-18 12:21:27 +02:00
Jagoda Estera Ślązak d8681d237f chore(release): prepare for 0.4.1 (#51)
Signed-off-by: Jagoda Ślązak <jslazak@jslazak.com>
2026-08-18 12:21:27 +02:00
Jagoda Estera Ślązak 223fa3c67b chore(tests): Add a way to disable DKIM for tests (#50)
Signed-off-by: Jagoda Ślązak <jslazak@jslazak.com>
2026-08-18 12:21:27 +02:00
Jagoda Estera Ślązak 1192531afc chore(release): prepare for 0.4.0 (#49)
Signed-off-by: Jagoda Ślązak <jslazak@jslazak.com>
2026-08-18 12:21:27 +02:00
Jagoda Estera Ślązak 3dfac56db9 feat: Support addresses using domain literals (#42)
If the incoming email comes from address that uses
domain literals `[<ipv4>]` or `[IPv6:<ipv6>]`,
skip DKIM verification and instead check IP
alignment with originating IP from XFORWARD
command.

Signed-off-by: Jagoda Ślązak <jslazak@jslazak.com>
2026-08-18 12:21:27 +02:00
Jagoda Estera Ślązak 23074f0898 feat!: DKIM verifier (#35)
* feat!: DKIM verifier

This implements a DKIM verification as well as a strict
DKIM signature alignment check with domain in `From`
header address.

Caches the retrieved RDATA using in-memory LRU.

BREAKING CHANGE: incoming messages now require DKIM signatures
  aligned to domain of the `From` header address.

Signed-off-by: Jagoda Ślązak <jslazak@jslazak.com>

* chore(license): License binaries under GPLv3

Signed-off-by: Jagoda Ślązak <jslazak@jslazak.com>

---------

Signed-off-by: Jagoda Ślązak <jslazak@jslazak.com>
2026-08-18 12:21:27 +02:00
Jagoda Estera Ślązak dc97e85ebe chore(release): prepare for 0.3.0 (#45)
Signed-off-by: Jagoda Ślązak <jslazak@jslazak.com>
2026-08-18 12:21:27 +02:00
dependabot[bot] d59d1c8f8f chore(deps): Bump dtolnay/rust-toolchain (#46)
Bumps [dtolnay/rust-toolchain](https://github.com/dtolnay/rust-toolchain) from f7ccc83f9ed1e5b9c81d8a67d7ad1a747e22a561 to efa25f7f19611383d5b0ccf2d1c8914531636bf9.
- [Release notes](https://github.com/dtolnay/rust-toolchain/releases)
- [Commits](https://github.com/dtolnay/rust-toolchain/compare/f7ccc83f9ed1e5b9c81d8a67d7ad1a747e22a561...efa25f7f19611383d5b0ccf2d1c8914531636bf9)

---
updated-dependencies:
- dependency-name: dtolnay/rust-toolchain
  dependency-version: efa25f7f19611383d5b0ccf2d1c8914531636bf9
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-08-18 12:21:27 +02:00
dependabot[bot] d0891ef3f1 chore(deps): Bump taiki-e/install-action from 2.67.24 to 2.67.30 (#48)
Bumps [taiki-e/install-action](https://github.com/taiki-e/install-action) from 2.67.24 to 2.67.30.
- [Release notes](https://github.com/taiki-e/install-action/releases)
- [Changelog](https://github.com/taiki-e/install-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/taiki-e/install-action/compare/4573997e3b6c0fbc22f7acab193b00a8a3ca817d...288875dd3d64326724fa6d9593062d9f8ba0b131)

---
updated-dependencies:
- dependency-name: taiki-e/install-action
  dependency-version: 2.67.30
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-08-18 12:21:27 +02:00
dependabot[bot] 9206fae6d3 chore(deps): Bump env_logger from 0.11.8 to 0.11.9 (#47)
Bumps [env_logger](https://github.com/rust-cli/env_logger) from 0.11.8 to 0.11.9.
- [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.11.8...v0.11.9)

---
updated-dependencies:
- dependency-name: env_logger
  dependency-version: 0.11.9
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-08-18 12:21:27 +02:00
Jagoda Estera Ślązak 5c603db830 feat: Support legacy, pre-OpenPGP packet format (#44)
Support legacy packet format for compatibility with GnuPG.

Closes: #43

Signed-off-by: Jagoda Ślązak <jslazak@jslazak.com>
2026-08-18 12:21:27 +02:00
dependabot[bot] 51f5f36478 chore(deps): Bump taiki-e/install-action from 2.67.16 to 2.67.24 (#37)
Bumps [taiki-e/install-action](https://github.com/taiki-e/install-action) from 2.67.16 to 2.67.24.
- [Release notes](https://github.com/taiki-e/install-action/releases)
- [Changelog](https://github.com/taiki-e/install-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/taiki-e/install-action/compare/a362280ea100b5bb920cf9040c038ce9a50c7943...4573997e3b6c0fbc22f7acab193b00a8a3ca817d)

---
updated-dependencies:
- dependency-name: taiki-e/install-action
  dependency-version: 2.67.24
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-08-18 12:21:27 +02:00
Jagoda Estera Ślązak f34642e96c refactor: Use a custom, minimal SMTP client instead of lettre (#33)
This disables the Nagle's algorithm on re-insertion.

Signed-off-by: Jagoda Ślązak <jslazak@jslazak.com>
2026-08-18 12:21:27 +02:00
Jagoda Estera Ślązak 0dfc3fae4e refactor: Remove unnecessary Arc (#36)
`Arc` around handler configs are not needed,
as they are not shared.

Signed-off-by: Jagoda Ślązak <jslazak@jslazak.com>
2026-08-18 12:21:27 +02:00
dependabot[bot] e7becac980 chore(deps): Bump taiki-e/install-action from 2.67.6 to 2.67.16 (#34)
Bumps [taiki-e/install-action](https://github.com/taiki-e/install-action) from 2.67.6 to 2.67.16.
- [Release notes](https://github.com/taiki-e/install-action/releases)
- [Changelog](https://github.com/taiki-e/install-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/taiki-e/install-action/compare/8444b4f2165ec93147f3ee41e06495653063ad11...a362280ea100b5bb920cf9040c038ce9a50c7943)

---
updated-dependencies:
- dependency-name: taiki-e/install-action
  dependency-version: 2.67.16
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-08-18 12:21:27 +02:00
Jagoda Estera Ślązak ebaa3587a6 chore(dist): Switch to musl targets (#31)
Ensures filtermail binaries are 100% statically linked.

Signed-off-by: Jagoda Ślązak <jslazak@jslazak.com>
2026-08-18 12:21:27 +02:00
Jagoda Estera Ślązak a5b1cada7b chore(release): prepare for 0.2.0 (#30)
Signed-off-by: Jagoda Ślązak <jslazak@jslazak.com>
2026-08-18 12:21:27 +02:00
Jagoda Estera Ślązak f2941c9807 feat: Configurable rate limiter max burst size (#28)
Signed-off-by: Jagoda Ślązak <jslazak@jslazak.com>
2026-08-18 12:21:27 +02:00
dependabot[bot] f4d9a7e747 chore(deps): Bump taiki-e/install-action from 2.66.7 to 2.67.6 (#24)
Bumps [taiki-e/install-action](https://github.com/taiki-e/install-action) from 2.66.7 to 2.67.6.
- [Release notes](https://github.com/taiki-e/install-action/releases)
- [Changelog](https://github.com/taiki-e/install-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/taiki-e/install-action/compare/542cebaaed782771e619bd5609d97659d109c492...8444b4f2165ec93147f3ee41e06495653063ad11)

---
updated-dependencies:
- dependency-name: taiki-e/install-action
  dependency-version: 2.67.6
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-08-18 12:21:27 +02:00
dependabot[bot] e99f71aadd chore(deps): Bump actions/checkout from 6.0.1 to 6.0.2 (#25)
Bumps [actions/checkout](https://github.com/actions/checkout) from 6.0.1 to 6.0.2.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/8e8c483db84b4bee98b60c0593521ed34d9990e8...de0fac2e4500dabe0009e67214ff5f5447ce83dd)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: 6.0.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-08-18 12:21:27 +02:00
link2xt 71739d3334 refactor: remove Mutex around rate limiter
Rate limiter handles all the necessary locking internally.
2026-08-18 12:21:27 +02:00
link2xt fa762d0cb5 perf: disable Nagle's algorithm and do own buffering on server connections
I don't know if Postfix as the client disables delayed ACKs,
but if delayed ACKs are enabled, Nagle's algorithm introduces unnecessary delays.
2026-08-18 12:21:27 +02:00
Jagoda Estera Ślązak 5dc49d20dd chore(release): prepare for 0.1.2 (#22)
Signed-off-by: Jagoda Ślązak <jslazak@jslazak.com>
2026-08-18 12:21:27 +02:00
Jagoda Estera Ślązak ac5042a3d5 fix: Make inbound/outbound log messages consistent (#23)
Signed-off-by: Jagoda Ślązak <jslazak@jslazak.com>
2026-08-18 12:21:27 +02:00
Jagoda Estera Ślązak ac3ea7fd8e fix: Set logs required by grafana to INFO (#21)
Signed-off-by: Jagoda Ślązak <jslazak@jslazak.com>
2026-08-18 12:21:27 +02:00
Jagoda Estera Ślązak 62de6d824c perf: Use governor for rate limiting (#20)
Fixes: #19

Signed-off-by: Jagoda Ślązak <jslazak@jslazak.com>
2026-08-18 12:21:27 +02:00
Jagoda Ślązak 02976942b9 chore(release): prepare for 0.1.1
Signed-off-by: Jagoda Ślązak <jslazak@jslazak.com>
2026-08-18 12:21:27 +02:00
Jagoda Ślązak 1d981ccbf4 chore: Configure git-cliff
Signed-off-by: Jagoda Ślązak <jslazak@jslazak.com>
2026-08-18 12:21:27 +02:00
Jagoda Estera Ślązak 8eee767e85 refactor: Apply more lints (#17)
Sets lint rules and applies required changes.

Fixes: #16

Signed-off-by: Jagoda Ślązak <jslazak@jslazak.com>
2026-08-18 12:21:27 +02:00
Jagoda Estera Ślązak 44c8c1906f feat: Improve logging (#13)
Improves logs and reduces verbosity.

Fixes: #8

Signed-off-by: Jagoda Ślązak <jslazak@jslazak.com>
2026-08-18 12:21:27 +02:00
Jagoda Estera Ślązak 8ba2bc22c5 fix(config): Set default values for internal SMTP ports and max message size (#12)
Fixes: #7

Signed-off-by: Jagoda Ślązak <jslazak@jslazak.com>
2026-08-18 12:21:27 +02:00
Jagoda Estera Ślązak 3c9fd2718d chore(dist): Configure cargo-dist (#10)
Signed-off-by: Jagoda Ślązak <jslazak@jslazak.com>
2026-08-18 12:21:27 +02:00
Jagoda Estera Ślązak 0f8a02d4d2 fix: Correct a typo in SMTP answer (#11)
Signed-off-by: Jagoda Ślązak <jslazak@jslazak.com>
2026-08-18 12:21:27 +02:00
l 3ac927ed2d refactor: get rid of indexing and slicing in check_armored_payload() (#15)
Indexing can potentially panic, without indexing
it is easier to make sure there will be no crash.
2026-08-18 12:21:27 +02:00
Jagoda Estera Ślązak 6f5dd21c8e fix: Improve address extraction from SMTP commands (#14)
Prevents extraction failing on SRS.

Fixes: #9

Signed-off-by: Jagoda Ślązak <jslazak@jslazak.com>
2026-08-18 12:21:27 +02:00
dependabot[bot] 2350cbabeb chore(deps): Bump dtolnay/rust-toolchain (#4)
Bumps [dtolnay/rust-toolchain](https://github.com/dtolnay/rust-toolchain) from 6d653acede28d24f02e3cd41383119e8b1b35921 to f7ccc83f9ed1e5b9c81d8a67d7ad1a747e22a561.
- [Release notes](https://github.com/dtolnay/rust-toolchain/releases)
- [Commits](https://github.com/dtolnay/rust-toolchain/compare/6d653acede28d24f02e3cd41383119e8b1b35921...f7ccc83f9ed1e5b9c81d8a67d7ad1a747e22a561)

---
updated-dependencies:
- dependency-name: dtolnay/rust-toolchain
  dependency-version: f7ccc83f9ed1e5b9c81d8a67d7ad1a747e22a561
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-08-18 12:21:27 +02:00
dependabot[bot] ba11f37eed chore(deps): Bump Swatinem/rust-cache from 2.8.1 to 2.8.2 (#5)
Bumps [Swatinem/rust-cache](https://github.com/swatinem/rust-cache) from 2.8.1 to 2.8.2.
- [Release notes](https://github.com/swatinem/rust-cache/releases)
- [Changelog](https://github.com/Swatinem/rust-cache/blob/master/CHANGELOG.md)
- [Commits](https://github.com/swatinem/rust-cache/compare/f13886b937689c021905a6b90929199931d60db1...779680da715d629ac1d338a641029a2f4372abb5)

---
updated-dependencies:
- dependency-name: Swatinem/rust-cache
  dependency-version: 2.8.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-08-18 12:21:27 +02:00
dependabot[bot] 91f5fbf193 chore(deps): Bump thiserror from 2.0.17 to 2.0.18 (#3)
Bumps [thiserror](https://github.com/dtolnay/thiserror) from 2.0.17 to 2.0.18.
- [Release notes](https://github.com/dtolnay/thiserror/releases)
- [Commits](https://github.com/dtolnay/thiserror/compare/2.0.17...2.0.18)

---
updated-dependencies:
- dependency-name: thiserror
  dependency-version: 2.0.18
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-08-18 12:21:27 +02:00