Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
169 commits
Select commit Hold shift + click to select a range
4185ebe
chore: Init repository
j-g00da Jan 14, 2026
6340f47
feat: Initial implementation
j-g00da Jan 14, 2026
5f4399f
chore(dependabot): Setup dependabot
j-g00da Jan 16, 2026
f9abff0
chore(ci): Setup CI
j-g00da Jan 16, 2026
401fd39
chore(dependabot): Add github-actions to dependabot
j-g00da Jan 16, 2026
392def1
docs(readme): Add README.md
j-g00da Jan 16, 2026
d25faf4
docs(license): Add LICENSE
j-g00da Jan 16, 2026
d2cca26
chore(cargo): Add metadata
j-g00da Jan 16, 2026
c78df00
chore(deps): Bump taiki-e/install-action from 2.62.49 to 2.66.7 (#2)
dependabot[bot] Jan 19, 2026
00fb3d8
chore(deps): Bump actions/checkout from 5.0.0 to 6.0.1 (#6)
dependabot[bot] Jan 19, 2026
c15f186
chore(deps): Bump thiserror from 2.0.17 to 2.0.18 (#3)
dependabot[bot] Jan 19, 2026
86f8651
chore(deps): Bump Swatinem/rust-cache from 2.8.1 to 2.8.2 (#5)
dependabot[bot] Jan 19, 2026
33e975a
chore(deps): Bump dtolnay/rust-toolchain (#4)
dependabot[bot] Jan 19, 2026
353f1dc
fix: Improve address extraction from SMTP commands (#14)
j-g00da Jan 21, 2026
f2f7767
refactor: get rid of indexing and slicing in check_armored_payload() …
link2xt Jan 21, 2026
c010d99
fix: Correct a typo in SMTP answer (#11)
j-g00da Jan 21, 2026
41e9e9f
chore(dist): Configure cargo-dist (#10)
j-g00da Jan 21, 2026
2b4205a
fix(config): Set default values for internal SMTP ports and max messa…
j-g00da Jan 21, 2026
aab39be
feat: Improve logging (#13)
j-g00da Jan 21, 2026
9eb86b2
refactor: Apply more lints (#17)
j-g00da Jan 21, 2026
e214a74
chore: Configure git-cliff
j-g00da Jan 21, 2026
06b7b0c
chore(release): prepare for 0.1.1
j-g00da Jan 21, 2026
b5a56a6
perf: Use governor for rate limiting (#20)
j-g00da Jan 22, 2026
ca6ccd9
fix: Set logs required by grafana to INFO (#21)
j-g00da Jan 22, 2026
cab16fc
fix: Make inbound/outbound log messages consistent (#23)
j-g00da Jan 22, 2026
0990a23
chore(release): prepare for 0.1.2 (#22)
j-g00da Jan 22, 2026
3be4c4d
perf: disable Nagle's algorithm and do own buffering on server connec…
link2xt Jan 26, 2026
aa5999c
refactor: remove Mutex around rate limiter
link2xt Jan 26, 2026
c010415
chore(deps): Bump actions/checkout from 6.0.1 to 6.0.2 (#25)
dependabot[bot] Jan 27, 2026
9a8e4fe
chore(deps): Bump taiki-e/install-action from 2.66.7 to 2.67.6 (#24)
dependabot[bot] Jan 27, 2026
23231d4
feat: Configurable rate limiter max burst size (#28)
j-g00da Jan 28, 2026
95fd106
chore(release): prepare for 0.2.0 (#30)
j-g00da Jan 28, 2026
7be2004
chore(dist): Switch to musl targets (#31)
j-g00da Jan 28, 2026
47f1636
chore(deps): Bump taiki-e/install-action from 2.67.6 to 2.67.16 (#34)
dependabot[bot] Feb 2, 2026
8d18b73
refactor: Remove unnecessary Arc (#36)
j-g00da Feb 5, 2026
0ee1e99
refactor: Use a custom, minimal SMTP client instead of lettre (#33)
j-g00da Feb 6, 2026
c1f7285
chore(deps): Bump taiki-e/install-action from 2.67.16 to 2.67.24 (#37)
dependabot[bot] Feb 10, 2026
cc1604b
feat: Support legacy, pre-OpenPGP packet format (#44)
j-g00da Feb 13, 2026
10fd148
chore(deps): Bump env_logger from 0.11.8 to 0.11.9 (#47)
dependabot[bot] Feb 14, 2026
21f0614
chore(deps): Bump taiki-e/install-action from 2.67.24 to 2.67.30 (#48)
dependabot[bot] Feb 14, 2026
85d6c38
chore(deps): Bump dtolnay/rust-toolchain (#46)
dependabot[bot] Feb 14, 2026
3bf8395
chore(release): prepare for 0.3.0 (#45)
j-g00da Feb 14, 2026
a096d05
feat!: DKIM verifier (#35)
j-g00da Feb 16, 2026
4837754
feat: Support addresses using domain literals (#42)
j-g00da Feb 16, 2026
4eb7e9f
chore(release): prepare for 0.4.0 (#49)
j-g00da Feb 17, 2026
6e2a379
chore(tests): Add a way to disable DKIM for tests (#50)
j-g00da Feb 17, 2026
083ec1a
chore(release): prepare for 0.4.1 (#51)
j-g00da Feb 17, 2026
7d4fac6
fix(dkim): Make simple header canonicalization work properly (#53)
j-g00da Feb 19, 2026
94f1b29
refactor: do not copy the mail in memory for DKIM verification (#54)
link2xt Feb 19, 2026
54982b1
feat: Save rejected messages to `/tmp` (#55)
j-g00da Feb 20, 2026
288afa3
chore(release): prepare for 0.5.0 (#56)
j-g00da Feb 20, 2026
6145be4
fix(dkim): Accept TXT records with no `v=` tag (#62)
j-g00da Feb 23, 2026
38627bf
chore(deps): Bump taiki-e/install-action from 2.67.30 to 2.68.5 (#57)
dependabot[bot] Feb 23, 2026
8a1684d
fix(smtp): Properly handle bounce messages (#63)
j-g00da Feb 23, 2026
52208c4
fix(dkim): Accept TXT records with escaped quotes (#61)
j-g00da Feb 24, 2026
e1841cb
fix(logs): Log `From` address instead of envelope `MAIL FROM`. (#66)
j-g00da Feb 24, 2026
ff3ffd5
chore(release): prepare for 0.5.1 (#65)
j-g00da Feb 24, 2026
2e1c384
fix(logs): Log correct address for outbound messages (#70)
j-g00da Feb 25, 2026
a5c6880
refactor: Check if email is encrypted before verifying DKIM (#71)
j-g00da Feb 25, 2026
82618de
feat: Check incoming email return address (#72)
j-g00da Feb 25, 2026
e62b161
chore: Bump cargo-dist (#73)
j-g00da Feb 25, 2026
6bb90f8
chore(ci): Build and upload binaries in CI (#76)
j-g00da Feb 26, 2026
edca7cb
chore(ci): Add missing Zig dependency (#77)
j-g00da Feb 27, 2026
3054b31
chore(release): prepare for 0.5.2 (#78)
j-g00da Feb 27, 2026
f149797
chore(ci): Fix binary publish job (#79)
j-g00da Feb 28, 2026
954d950
chore(deps): Bump actions/upload-artifact from 6.0.0 to 7.0.0 (#80)
dependabot[bot] Mar 3, 2026
962de09
chore(deps): Bump taiki-e/install-action from 2.68.5 to 2.68.13 (#82)
dependabot[bot] Mar 3, 2026
3a571b7
chore(deps): Bump actions/download-artifact from 7.0.0 to 8.0.0 (#81)
dependabot[bot] Mar 3, 2026
c088cbf
refactor: use enum for mode cli arg (#83)
DarkCat09 Mar 5, 2026
a8033b1
chore(deps): Bump taiki-e/install-action from 2.68.13 to 2.68.20 (#87)
dependabot[bot] Mar 11, 2026
07496ab
chore(deps): Bump tokio from 1.49.0 to 1.50.0 (#86)
dependabot[bot] Mar 11, 2026
0d7f5d7
docs(readme): Fix license link
j-g00da Mar 11, 2026
779e7ca
docs(readme): Clarify licensing of the binaries
j-g00da Mar 11, 2026
82a9850
docs(readme): Improve README.md (#88)
j-g00da Mar 12, 2026
8dd9436
feat!: Remove IP verification for domain-literals (#90)
j-g00da Mar 13, 2026
b31e13a
chore(release): prepare for 0.6.0 (#92)
j-g00da Mar 13, 2026
49df79b
feat: configurable hosts for listen and reinject (#84)
DarkCat09 Mar 13, 2026
b47b859
chore(deps): Bump actions/download-artifact from 8.0.0 to 8.0.1 (#95)
dependabot[bot] Mar 14, 2026
23b28bc
chore(deps): Bump Swatinem/rust-cache from 2.8.2 to 2.9.1 (#96)
dependabot[bot] Mar 14, 2026
2aa894f
docs(readme): fix typo (#99)
DarkCat09 Mar 16, 2026
9a4a54c
refactor: derive Default for Envelope (#100)
DarkCat09 Mar 16, 2026
7da0c34
chore(deps): Bump taiki-e/install-action from 2.68.20 to 2.69.4 (#102)
dependabot[bot] Mar 23, 2026
fb77c5b
feat(resolver): Enable DNSSEC (#94)
j-g00da Mar 24, 2026
a4497bc
chore(deps): Bump dtolnay/rust-toolchain (#105)
dependabot[bot] Mar 30, 2026
ca3393c
chore(deps): Bump env_logger from 0.11.9 to 0.11.10 (#106)
dependabot[bot] Mar 30, 2026
621eaee
chore(deps): Bump taiki-e/install-action from 2.69.4 to 2.69.13 (#107)
dependabot[bot] Mar 30, 2026
05cbf29
feat: Add experimental option to disable mailboxes (#108)
j-g00da Apr 1, 2026
0f58942
chore(release): prepare for 0.6.1 (#109)
j-g00da Apr 1, 2026
5575df7
chore(deps): Bump taiki-e/install-action from 2.69.13 to 2.71.2 (#112)
dependabot[bot] Apr 7, 2026
8ad6592
chore(deps): Bump tokio from 1.50.0 to 1.51.0 (#111)
dependabot[bot] Apr 7, 2026
0feb137
chore(dependabot): Update configuration (#114)
j-g00da Apr 7, 2026
2450d1d
docs(readme): Reformat README.md (#115)
j-g00da Apr 9, 2026
ec0413b
feat: Log disabled recipients (#113)
j-g00da Apr 15, 2026
cf64778
feat(transport): Remote delivery over SMTP (#104)
j-g00da Apr 15, 2026
45eaa2f
chore(release): prepare for 0.6.2 (#116)
j-g00da Apr 16, 2026
dee00eb
perf(smtp-client): Cache connections (#117)
j-g00da Apr 17, 2026
e156ce9
chore(deps): Bump taiki-e/install-action from 2.71.2 to 2.75.5 (#120)
dependabot[bot] Apr 20, 2026
0e1b717
chore(deps): Bump actions/upload-artifact from 7.0.0 to 7.0.1 (#119)
dependabot[bot] Apr 20, 2026
1e35631
feat(smtp-server): Log malformed SMTP commands (#118)
j-g00da Apr 20, 2026
3eb3b86
chore(release): prepare for 0.6.3 (#121)
j-g00da Apr 20, 2026
17ccd3e
chore(deps): Bump bnjbvr/cargo-machete from 0.9.1 to 0.9.2 (#124)
dependabot[bot] Apr 27, 2026
c1a4d99
chore(deps): Bump taiki-e/install-action from 2.75.5 to 2.75.17 (#125)
dependabot[bot] Apr 27, 2026
21aaea0
fix: Implement missing "implicit MX" rule
j-g00da Apr 27, 2026
1b1585e
refactor(transport): Explicitly handle RFC7505 null MX
j-g00da Apr 28, 2026
0a652e6
feat: https transport channel (#122)
j-g00da May 1, 2026
5b79d2d
chore(release): prepare for 0.6.4 (#130)
j-g00da May 1, 2026
36ff21f
ci: build and deploy relays with filtermail binary and run interop te…
hpk42 May 1, 2026
94dcd6c
chore(deps): Bump taiki-e/install-action from 2.75.17 to 2.75.22 (#132)
dependabot[bot] May 4, 2026
457461b
chore(deps): Bump lru from 0.16.3 to 0.17.0 (#133)
dependabot[bot] May 4, 2026
59944a4
chore(deps): Bump tokio from 1.51.1 to 1.52.1 (#135)
dependabot[bot] May 4, 2026
bc769e0
chore(deps): Bump webpki-roots from 1.0.6 to 1.0.7 (#136)
dependabot[bot] May 4, 2026
d29cbaf
chore(deps): Upgrade hickory-resolver (#138)
j-g00da May 5, 2026
1011903
fix(smtp-client): Handle 421 on reused connection (#145)
j-g00da May 7, 2026
5295d17
perf(smtp-client): Use pipelining if server advertises support (#146)
j-g00da May 7, 2026
36921dd
fix: advertise 8BITMIME to prevent conversion after DKIM signing (#149)
hpk42 May 12, 2026
a65e7a1
fix: Validate mail data (#150)
link2xt May 12, 2026
2727441
chore(deps): Bump taiki-e/install-action from 2.75.22 to 2.75.28 (#148)
dependabot[bot] May 12, 2026
e26cca0
chore(release): prepare for 0.6.5 (#152)
j-g00da May 12, 2026
3896044
fix: return HTTP 200 because madmail expects it, and make sure https …
hpk42 May 12, 2026
b7a213f
ci: Remove mac and windows from matrix tests (#154)
j-g00da May 12, 2026
d74e5b8
feat: Improved SMTP error responses (#147)
j-g00da May 12, 2026
e2be5dc
ci: run cmlxc tests in all classic/classic-ipv4/madmail combinations
hpk42 May 12, 2026
91d09ab
chore(release): prepare for 0.6.6 (#156)
j-g00da May 12, 2026
664ad57
feat!: remove passthrough options that allowed unencrypted mail to pass
hpk42 May 14, 2026
847e195
fix: do not crash if accepting new connection fails
link2xt May 14, 2026
c84a96a
docs(readme): Remove docs for options removed in 664ad57 (#162)
j-g00da May 25, 2026
febfb90
chore(release): prepare for 0.7.0 (#163)
j-g00da May 26, 2026
a6361a2
fix: switch ratelimiter to MonotonicClock (#167)
link2xt Jun 1, 2026
893ceab
chore(deps): Bump taiki-e/install-action from 2.75.28 to 2.79.6 (#164)
dependabot[bot] Jun 1, 2026
e9a6322
fix(smtp-server): Correct error when EOF while reading DATA (#168)
j-g00da Jun 1, 2026
6d6517f
chore: add filtermail.mtail so filtermail failures can be monitored (…
j4n Jun 1, 2026
8a60245
fix(resolver): disable negative caching (#170)
DarkCat09 Jun 2, 2026
f82f34d
chore(deps): Bump tokio from 1.52.1 to 1.52.3 (#172)
dependabot[bot] Jun 3, 2026
2538caa
chore(deps): Bump lru from 0.17.0 to 0.18.0 (#171)
dependabot[bot] Jun 3, 2026
b0214a7
chore(deps): Bump memchr from 2.8.0 to 2.8.1
dependabot[bot] Jun 3, 2026
939e536
chore(deps): Bump taiki-e/install-action from 2.79.6 to 2.79.14
dependabot[bot] Jun 5, 2026
fb5a259
fix: ignore CNAME records when resolving TXT records (#177)
link2xt Jun 6, 2026
73b684f
chore(deps): Bump log from 0.4.29 to 0.4.30 (#173)
dependabot[bot] Jun 6, 2026
d3f5412
feat: switch to aws-lc-rs cryptography provider (#178)
j-g00da Jun 6, 2026
81aac3c
chore(release): prepare for 0.7.1 (#179)
j-g00da Jun 9, 2026
488bbcb
docs(readme): Disable colors in mermaid diagrams (#180)
j-g00da Jun 10, 2026
a66887b
chore(deps): Bump actions/checkout from 6.0.2 to 6.0.3 (#181)
dependabot[bot] Jun 15, 2026
b36856a
chore(deps): Bump taiki-e/install-action from 2.79.14 to 2.81.6 (#182)
dependabot[bot] Jun 15, 2026
7d0db2c
chore(deps): Bump taiki-e/install-action from 2.81.6 to 2.81.10 (#183)
dependabot[bot] Jun 22, 2026
7ea7904
feat(transport): Destination worker pool
j-g00da May 12, 2026
c745252
test: Test filtermail-transport
j-g00da Jun 22, 2026
db86cfc
refactor: Implement Display for AddressDomain
j-g00da Jun 26, 2026
03ca4a0
docs(readme): Update Transport mode doc
j-g00da Jun 26, 2026
ac9df36
chore(release): prepare for 0.7.2 (#184)
j-g00da Jun 26, 2026
d5ac67e
feat(transport): Worker eviction (#185)
j-g00da Jun 27, 2026
222bf36
chore(release): prepare for 0.7.3 (#189)
j-g00da Jun 27, 2026
4d7bcf5
chore: update filtermail.mtail (#190)
j-g00da Jun 30, 2026
0fce0a2
chore(deps): Bump actions/checkout from 6.0.3 to 7.0.0 (#186)
dependabot[bot] Jun 30, 2026
7f14693
feat(logs): Log incoming mailer-daemon message sources (#191)
j-g00da Jun 30, 2026
d00d2b8
chore(deps): Bump taiki-e/install-action from 2.81.10 to 2.82.2 (#187)
dependabot[bot] Jun 30, 2026
5cdae22
chore(deps): Bump dtolnay/rust-toolchain (#188)
dependabot[bot] Jul 1, 2026
ed5dfbe
test: place #[tokio::test] after rstest case macros (#192)
link2xt Jul 1, 2026
5717940
chore(release): prepare for 0.7.4 (#193)
j-g00da Jul 1, 2026
88e2124
chore(deps): Bump hyper from 1.9.0 to 1.10.1 (#197)
dependabot[bot] Jul 2, 2026
df6c9d7
chore(deps): Bump log from 0.4.30 to 0.4.33 (#194)
dependabot[bot] Jul 4, 2026
2bba729
chore(deps): Bump memchr from 2.8.1 to 2.8.2 (#195)
dependabot[bot] Jul 4, 2026
9613b2f
chore(deps): Bump webpki-roots from 1.0.7 to 1.0.8 (#196)
dependabot[bot] Jul 4, 2026
678bf2a
chore(deps): Bump taiki-e/install-action from 2.82.2 to 2.82.5 (#198)
dependabot[bot] Jul 4, 2026
e47740f
refactor: do not evaluate smtp_write! argument twice
link2xt Jul 9, 2026
a0fe9c4
chore(deps): Bump taiki-e/install-action from 2.82.5 to 2.83.1 (#202)
dependabot[bot] Jul 20, 2026
6b3d475
chore(deps): Bump dtolnay/rust-toolchain (#203)
dependabot[bot] Jul 20, 2026
827bd5f
Merging chatmail/filtermail repository into chatmail/relay
missytake Jul 26, 2026
3fd3098
chore: integrate filtermail's .github directory into relay's
missytake Jul 26, 2026
a9ce34c
chore(release): configure relay's git-cliff to not use filtermail-onl…
missytake Aug 12, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
version: 2
updates:
- package-ecosystem: "cargo"
directory: "/filtermail"
schedule:
interval: "monthly"
cooldown:
default-days: 7

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
cooldown:
default-days: 7
35 changes: 35 additions & 0 deletions .github/workflows/chatmaild-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: chatmaild CI

on:
# Triggers when a PR is merged into main or a direct push occurs
push:
branches: [ "main" ]

# Triggers for any PR (and its subsequent commits) targeting the main branch
pull_request:
branches: [ "main" ]

permissions: {}

# Newest push wins: Prevents multiple runs from clashing and wasting runner efforts
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
tox:
name: isolated chatmaild tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
# Checkout pull request HEAD commit instead of merge commit
# Otherwise `test_deployed_state` will be unhappy.
with:
ref: ${{ github.event.pull_request.head.sha }}
persist-credentials: false
- name: download filtermail
run: curl -L https://github.com/chatmail/filtermail/releases/download/v0.7.4/filtermail-x86_64 -o /usr/local/bin/filtermail && chmod +x /usr/local/bin/filtermail

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
run: curl -L https://github.com/chatmail/filtermail/releases/download/v0.7.4/filtermail-x86_64 -o /usr/local/bin/filtermail && chmod +x /usr/local/bin/filtermail
run: curl -f -L https://github.com/chatmail/filtermail/releases/download/v0.7.4/filtermail-x86_64 -o /usr/local/bin/filtermail && chmod +x /usr/local/bin/filtermail

-f means failing on 404 instead of downloading the error page to filtermail binary location. Maybe we should consider always building and using https://github.com/Swatinem/rust-cache as in filtermail-ci.yaml.

- name: run chatmaild tests
working-directory: chatmaild
run: pipx run tox

26 changes: 7 additions & 19 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: CI
name: cmdeploy CI

on:
# Triggers when a PR is merged into main or a direct push occurs
Expand All @@ -18,24 +18,8 @@ concurrency:


jobs:
tox:
name: isolated chatmaild tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
# Checkout pull request HEAD commit instead of merge commit
# Otherwise `test_deployed_state` will be unhappy.
with:
ref: ${{ github.event.pull_request.head.sha }}
persist-credentials: false
- name: download filtermail
run: curl -L https://github.com/chatmail/filtermail/releases/download/v0.7.4/filtermail-x86_64 -o /usr/local/bin/filtermail && chmod +x /usr/local/bin/filtermail
- name: run chatmaild tests
working-directory: chatmaild
run: pipx run tox

scripts:
name: deploy-chatmail tests
cmdeploy:
name: cmdeploy tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
Expand All @@ -61,6 +45,10 @@ jobs:
with:
cmlxc_version: main
cmlxc_commands: |
sudo apt-get update && sudo apt-get install -y musl-tools
rustup target add x86_64-unknown-linux-musl
export CARGO_TARGET_X86_64_UNKNOWN_LINUX_MUSL_LINKER=musl-gcc

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
export CARGO_TARGET_X86_64_UNKNOWN_LINUX_MUSL_LINKER=musl-gcc

Looking at the job log, does not reach the next step as each line runs in its own environment and thus is a noop.

cd repo/filtermail && RUSTFLAGS="-Ctarget-feature=+crt-static -Clink-self-contained=yes" cargo build --release --target x86_64-unknown-linux-musl
cmlxc init
# single cmdeploy relay test
cmlxc -v deploy-cmdeploy --source ./repo cm0

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
cmlxc -v deploy-cmdeploy --source ./repo cm0
cmlxc -v deploy-cmdeploy --source ./repo --filtermail repo/filtermail/target/x86_64-unknown-linux-musl/release/filtermail cm0

if we do build filtermail at all times, we should probably also use it in the test, otherwise we dont need to build it; though we will have a path clash here that will need fixing in cmlxc.

Expand Down
79 changes: 79 additions & 0 deletions .github/workflows/filtermail-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: filtermail CI

permissions: {}

on:
workflow_dispatch:
push:
branches:
- main
pull_request:
branches:
- main
Comment thread
missytake marked this conversation as resolved.
paths:
- "filtermail/**"
Comment on lines +10 to +14

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
pull_request:
branches:
- main
paths:
- "filtermail/**"
paths:
- "filtermail/**"
- ".github/workflows/filtermail-ci.yml"
pull_request:
branches:
- main
paths:
- "filtermail/**"
- ".github/workflows/filtermail-ci.yml"

push otherwise runs the full rust matrix for nothing on pushes to main; and add the workflow file.


concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
fmt:
name: Check Formatting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@2c7215f132e9ebf062739d9130488b56d53c060c # master
with:
toolchain: nightly
components: rustfmt
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
- uses: taiki-e/install-action@2ca9b94c269419b7b0c711c09d0b21c4e1d51145 # v2.83.1
with:
tool: taplo-cli
- run: cd filtermail && taplo format --check && cargo fmt --check

cargo-machete:
name: Check Unused Dependencies
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- uses: bnjbvr/cargo-machete@ac30a525c0a8d163a92d727b3ff079ee3f6ecb08 # v0.9.2

lint-clippy:
name: Check Clippy
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
toolchain: ["stable", "beta"]
continue-on-error: ${{ matrix.toolchain == 'beta' }}
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@2c7215f132e9ebf062739d9130488b56d53c060c # master
with:
toolchain: ${{ matrix.toolchain }}
components: clippy
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
- run: cd filtermail && cargo clippy
env:
RUSTUP_TOOLCHAIN: ${{ matrix.toolchain }}

rust-test:
name: Run rust tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@2c7215f132e9ebf062739d9130488b56d53c060c # master
with:
toolchain: stable
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
- run: cd filtermail && cargo test
75 changes: 75 additions & 0 deletions .github/workflows/filtermail-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
on:
push:
tags:
- 'filtermail-*'
Comment on lines +2 to +4

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
push:
tags:
- 'filtermail-*'
release:
types: [published]

see filter on line 10


permissions: {}

jobs:
build:
name: Build binaries.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
name: Build binaries.
name: Build binaries.
if: startsWith(github.event.release.tag_name, 'filtermail-')

Guard here..

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@2c7215f132e9ebf062739d9130488b56d53c060c # master
with:
toolchain: stable
targets: aarch64-unknown-linux-musl,x86_64-unknown-linux-musl
- uses: mlugg/setup-zig@d1434d08867e3ee9daa34448df10607b98908d29 # v2.2.1
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed
with:
use-cache: false
- uses: taiki-e/install-action@2ca9b94c269419b7b0c711c09d0b21c4e1d51145 # v2.83.1
with:
tool: cargo-zigbuild
- name: Build
run: |
cd filtermail
RUSTFLAGS="-Ctarget-feature=+crt-static -Clink-self-contained=yes" \
cargo zigbuild \
--release \
--target x86_64-unknown-linux-musl \
--target aarch64-unknown-linux-musl
Comment thread
missytake marked this conversation as resolved.
- name: Upload x86_64 binary
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: filtermail-x86_64
path: filtermail/target/x86_64-unknown-linux-musl/release/filtermail
if-no-files-found: error
- name: Upload aarch64 binary
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: filtermail-aarch64
path: filtermail/target/aarch64-unknown-linux-musl/release/filtermail
if-no-files-found: error
Comment thread
missytake marked this conversation as resolved.

publish:
name: Upload binaries to the release
needs: ["build"]
permissions:
contents: write
runs-on: ubuntu-latest
steps:
Comment thread
missytake marked this conversation as resolved.
- name: Download x86_64 binary
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: filtermail-x86_64
path: filtermail-x86_64
- name: Download aarch64 binary
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: filtermail-aarch64
path: filtermail-aarch64
- name: Upload binaries to the GitHub release
if: github.event_name == 'release'
Comment thread
missytake marked this conversation as resolved.
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
REF_NAME: ${{ github.ref_name }}
run: |
mkdir dist
mv filtermail-x86_64/filtermail dist/filtermail-x86_64
mv filtermail-aarch64/filtermail dist/filtermail-aarch64
gh release upload "$REF_NAME" \
--repo ${{ github.repository }} \
dist/*
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ docs/_build/
# PyBuilder
.pybuilder/
target/
filtermail/target/

# Jupyter Notebook
.ipynb_checkpoints
Expand Down
1 change: 1 addition & 0 deletions cliff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -92,3 +92,4 @@ topo_order_commits = true
sort_commits = "oldest"
# Process submodules commits
recurse_submodules = false
exclude_paths = ["filtermail/"]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
exclude_paths = ["filtermail/"]
exclude_paths = ["filtermail/"]
tag_pattern = '^[0-9]+\.[0-9]+\.[0-9]+$'

Exclude filtermail tags and match only relay tags.

101 changes: 101 additions & 0 deletions cmdeploy/src/cmdeploy/mtail/filtermail.mtail
Comment thread
missytake marked this conversation as resolved.
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
# filtermail.mtail: filtermail process event counters

#
# Counters
#

# Connection errors in the transport path
# Error::Io / Error::ConnectionFailed / Error::Tls: the reason string filtermail strips
counter filtermail_transport_error_total by reason

# Unexpected transport errors: DNS failure, HTTP error, config error.
counter filtermail_transport_unexpected_total

# Silent drops: inbound
# "unencrypted" overlaps with rejected_unencrypted_mail_count in delivered_mail.mtail.
counter filtermail_inbound_drop_total by reason

# Silent drops: outbound
# "unencrypted" overlaps with rejected_unencrypted_mail_count in delivered_mail.mtail;
# "sender_disabled" and "all_recipients_disabled" are new.
counter filtermail_outbound_drop_total by reason

# Reinject failures
counter filtermail_reinject_error_total by direction

# SMTP-level connection errors (client dropped mid-session)
counter filtermail_smtp_error_total by reason

#
# filtermail::transport
#

/filtermail\[\d+\]: \[WARN\s+filtermail::transport::worker\] Connection error relaying to mail server \S+: / {
/timed out/ {
filtermail_transport_error_total["connection_timeout"]++
} otherwise {
/Failed to connect to any of the following addresses/ {
filtermail_transport_error_total["connection_refused"]++
} otherwise {
/Connection refused/ {
filtermail_transport_error_total["connection_refused"]++
} otherwise {
/invalid certificate/ {
filtermail_transport_error_total["tls_cert_not_verified"]++
} otherwise {
/peer sent fatal alert|handshake/ {
filtermail_transport_error_total["tls_handshake"]++
} otherwise {
/close_notify|connection closed/ {
filtermail_transport_error_total["lost_connection"]++
} otherwise {
filtermail_transport_error_total["other"]++
}}}}}}}

/filtermail\[\d+\]: \[WARN\s+filtermail::transport::worker\] Unexpected error while delivering/ {
filtermail_transport_unexpected_total++
}

#
# filtermail::smtp_server
#

/filtermail(?:-incoming)?\[\d+\]: \[WARN\s+filtermail::smtp_server\] Unexpected EoF while receiving DATA/ {
filtermail_smtp_error_total["unexpected_eof"]++
}

/filtermail(?:-incoming)?\[\d+\]: \[WARN\s+filtermail::smtp_server\] Malformed DATA line without CRLF/ {
filtermail_smtp_error_total["malformed_data_line"]++
}

#
# filtermail::outbound
#

/filtermail\[\d+\]: \[WARN\s+filtermail::outbound\] Rejected unencrypted mail/ {
filtermail_outbound_drop_total["unencrypted"]++
}

/filtermail\[\d+\]: \[WARN\s+filtermail::outbound\] Dropping mail; Sender .* is disabled/ {
filtermail_outbound_drop_total["sender_disabled"]++
}

/filtermail\[\d+\]: \[WARN\s+filtermail::outbound\] Dropping mail; All recipients disabled/ {
filtermail_outbound_drop_total["all_recipients_disabled"]++
}

/filtermail\[\d+\]: \[WARN\s+filtermail::outbound\] Failed to re.inject mail/ {
filtermail_reinject_error_total["outbound"]++
}

#
# filtermail::inbound
#

/filtermail(?:-incoming)?\[\d+\]: \[WARN\s+filtermail::inbound\] Rejected unencrypted mail/ {
filtermail_inbound_drop_total["unencrypted"]++
}

/filtermail(?:-incoming)?\[\d+\]: \[WARN\s+filtermail::inbound\] Failed to re.inject mail/ {
filtermail_reinject_error_total["inbound"]++
}
Loading