Commit Graph

99 Commits

Author SHA1 Message Date
l 94f1b29917 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-02-19 19:06:08 +01:00
Jagoda Estera Ślązak 7d4fac698f 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-02-19 14:33:40 +01:00
Jagoda Estera Ślązak 083ec1a60b chore(release): prepare for 0.4.1 (#51)
Signed-off-by: Jagoda Ślązak <jslazak@jslazak.com>
2026-02-17 13:07:46 +01:00
Jagoda Estera Ślązak 6e2a37956c chore(tests): Add a way to disable DKIM for tests (#50)
Signed-off-by: Jagoda Ślązak <jslazak@jslazak.com>
2026-02-17 13:00:31 +01:00
Jagoda Estera Ślązak 4eb7e9fd63 chore(release): prepare for 0.4.0 (#49)
Signed-off-by: Jagoda Ślązak <jslazak@jslazak.com>
2026-02-17 10:38:31 +01:00
Jagoda Estera Ślązak 4837754245 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-02-16 18:25:21 +01:00
Jagoda Estera Ślązak a096d0550f 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-02-16 09:50:55 +01:00
Jagoda Estera Ślązak 3bf8395ef6 chore(release): prepare for 0.3.0 (#45)
Signed-off-by: Jagoda Ślązak <jslazak@jslazak.com>
2026-02-14 14:42:55 +01:00
dependabot[bot] 85d6c381b3 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-02-14 14:36:27 +01:00
dependabot[bot] 21f0614b5d 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-02-14 14:35:33 +01:00
dependabot[bot] 10fd148155 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-02-14 14:34:36 +01:00
Jagoda Estera Ślązak cc1604b0b2 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-02-13 12:31:39 +01:00
dependabot[bot] c1f728535f 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-02-10 11:29:31 +01:00
Jagoda Estera Ślązak 0ee1e9924c 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-02-06 11:15:14 +01:00
Jagoda Estera Ślązak 8d18b73681 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-02-05 16:42:06 +01:00
dependabot[bot] 47f16360a4 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-02-02 11:05:48 +01:00
Jagoda Estera Ślązak 7be2004051 chore(dist): Switch to musl targets (#31)
Ensures filtermail binaries are 100% statically linked.

Signed-off-by: Jagoda Ślązak <jslazak@jslazak.com>
2026-01-28 20:06:04 +01:00
Jagoda Estera Ślązak 95fd106e43 chore(release): prepare for 0.2.0 (#30)
Signed-off-by: Jagoda Ślązak <jslazak@jslazak.com>
2026-01-28 18:22:53 +01:00
Jagoda Estera Ślązak 23231d462c feat: Configurable rate limiter max burst size (#28)
Signed-off-by: Jagoda Ślązak <jslazak@jslazak.com>
2026-01-28 17:47:48 +01:00
dependabot[bot] 9a8e4fe65c 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-01-27 10:07:52 +01:00
dependabot[bot] c0104152e8 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-01-27 10:06:35 +01:00
link2xt aa5999cc25 refactor: remove Mutex around rate limiter
Rate limiter handles all the necessary locking internally.
2026-01-26 17:59:12 +00:00
link2xt 3be4c4d5ee 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-01-26 14:56:36 +00:00
Jagoda Estera Ślązak 0990a23700 chore(release): prepare for 0.1.2 (#22)
Signed-off-by: Jagoda Ślązak <jslazak@jslazak.com>
2026-01-22 15:24:33 +01:00
Jagoda Estera Ślązak cab16fc8f1 fix: Make inbound/outbound log messages consistent (#23)
Signed-off-by: Jagoda Ślązak <jslazak@jslazak.com>
2026-01-22 15:14:28 +01:00
Jagoda Estera Ślązak ca6ccd9acf fix: Set logs required by grafana to INFO (#21)
Signed-off-by: Jagoda Ślązak <jslazak@jslazak.com>
2026-01-22 14:49:55 +01:00
Jagoda Estera Ślązak b5a56a6a4e perf: Use governor for rate limiting (#20)
Fixes: #19

Signed-off-by: Jagoda Ślązak <jslazak@jslazak.com>
2026-01-22 14:49:26 +01:00
Jagoda Ślązak 06b7b0ca6d chore(release): prepare for 0.1.1
Signed-off-by: Jagoda Ślązak <jslazak@jslazak.com>
2026-01-21 17:22:19 +01:00
Jagoda Ślązak e214a74252 chore: Configure git-cliff
Signed-off-by: Jagoda Ślązak <jslazak@jslazak.com>
2026-01-21 17:22:19 +01:00
Jagoda Estera Ślązak 9eb86b23ce refactor: Apply more lints (#17)
Sets lint rules and applies required changes.

Fixes: #16

Signed-off-by: Jagoda Ślązak <jslazak@jslazak.com>
2026-01-21 16:28:24 +01:00
Jagoda Estera Ślązak aab39be662 feat: Improve logging (#13)
Improves logs and reduces verbosity.

Fixes: #8

Signed-off-by: Jagoda Ślązak <jslazak@jslazak.com>
2026-01-21 14:35:52 +01:00
Jagoda Estera Ślązak 2b4205a60a 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-01-21 14:27:21 +01:00
Jagoda Estera Ślązak 41e9e9f6d0 chore(dist): Configure cargo-dist (#10)
Signed-off-by: Jagoda Ślązak <jslazak@jslazak.com>
2026-01-21 14:26:37 +01:00
Jagoda Estera Ślązak c010d999f5 fix: Correct a typo in SMTP answer (#11)
Signed-off-by: Jagoda Ślązak <jslazak@jslazak.com>
2026-01-21 14:26:20 +01:00
l f2f7767b71 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-01-21 14:25:40 +01:00
Jagoda Estera Ślązak 353f1dc77d 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-01-21 14:06:20 +01:00
dependabot[bot] 33e975ade3 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-01-19 16:59:22 +01:00
dependabot[bot] 86f86515be 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-01-19 16:56:49 +01:00
dependabot[bot] c15f18685a 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-01-19 16:55:24 +01:00
dependabot[bot] 00fb3d8156 chore(deps): Bump actions/checkout from 5.0.0 to 6.0.1 (#6)
Bumps [actions/checkout](https://github.com/actions/checkout) from 5.0.0 to 6.0.1.
- [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/08c6903cd8c0fde910a37f88322edcfb5dd907a8...8e8c483db84b4bee98b60c0593521ed34d9990e8)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-01-19 16:53:52 +01:00
dependabot[bot] c78df0009b chore(deps): Bump taiki-e/install-action from 2.62.49 to 2.66.7 (#2)
Bumps [taiki-e/install-action](https://github.com/taiki-e/install-action) from 2.62.49 to 2.66.7.
- [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/44c6d64aa62cd779e873306675c7a58e86d6d532...542cebaaed782771e619bd5609d97659d109c492)

---
updated-dependencies:
- dependency-name: taiki-e/install-action
  dependency-version: 2.66.7
  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-01-19 16:53:01 +01:00
Jagoda Ślązak d2cca26b1c chore(cargo): Add metadata
Signed-off-by: Jagoda Ślązak <jslazak@jslazak.com>
2026-01-19 16:49:50 +01:00
Jagoda Ślązak d25faf4fdf docs(license): Add LICENSE
Signed-off-by: Jagoda Ślązak <jslazak@jslazak.com>
2026-01-19 16:49:50 +01:00
Jagoda Ślązak 392def1322 docs(readme): Add README.md
Signed-off-by: Jagoda Ślązak <jslazak@jslazak.com>
2026-01-19 16:49:50 +01:00
Jagoda Ślązak 401fd39ec0 chore(dependabot): Add github-actions to dependabot
Signed-off-by: Jagoda Ślązak <jslazak@jslazak.com>
2026-01-19 16:49:50 +01:00
Jagoda Ślązak f9abff0764 chore(ci): Setup CI
Signed-off-by: Jagoda Ślązak <jslazak@jslazak.com>
2026-01-19 16:49:50 +01:00
Jagoda Ślązak 5f4399f54d chore(dependabot): Setup dependabot
Signed-off-by: Jagoda Ślązak <jslazak@jslazak.com>
2026-01-19 16:49:50 +01:00
Jagoda Ślązak 6340f479ae feat: Initial implementation
Signed-off-by: Jagoda Ślązak <jslazak@jslazak.com>
2026-01-19 16:49:50 +01:00
Jagoda Ślązak 4185ebe3c5 chore: Init repository
Signed-off-by: Jagoda Ślązak <jslazak@jslazak.com>
2026-01-14 18:12:22 +01:00