Skip to content

chore: merge chatmail/filtermail into chatmail/relay to have a monorepo - #1023

Open
missytake wants to merge 169 commits into
mainfrom
merge-filtermail
Open

chore: merge chatmail/filtermail into chatmail/relay to have a monorepo#1023
missytake wants to merge 169 commits into
mainfrom
merge-filtermail

Conversation

@missytake

@missytake missytake commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

This is a proposal to merge chatmail/filtermail and chatmail/relay into one monorepo, so we can change filtermail with only one PR in the future.

The paths in the filtermail commits have been rewritten so that they were always in the filtermail/ subdirectory, so the commit history of each file is preserved. What I did to merge the repositories, in case it needs to be repeated slightly differently:

cd $USER/code/relay/..
git clone https://github.com/chatmail/filtermail
cd filtermail
git filter-repo --to-subdirectory filtermail --tag-rename v:filtermail-
cd ../relay
git checkout main
git pull --rebase
git checkout -b merge-filtermail
git remote add filtermail-merge ../filtermail
git fetch filtermail-merge
git merge --allow-unrelated-histories filtermail-merge/main

Then I did 3cf3937 on top of it to integrate filtermail's .github/ and .gitignore into chatmail/relay.

open questions:

  • how should we distinguish tags? does filtermail still need its own software versions? Other projects import filtermail, afaik. I renamed the filtermail tags from v1.2.3 to filtermail-1.2.3 for now, but didn't push them so far.
  • should we rename the relay tags as well, from 1.2.3 to relay-1.2.3?

j-g00da and others added 30 commits January 14, 2026 18:12
Signed-off-by: Jagoda Ślązak <jslazak@jslazak.com>
Signed-off-by: Jagoda Ślązak <jslazak@jslazak.com>
Signed-off-by: Jagoda Ślązak <jslazak@jslazak.com>
Signed-off-by: Jagoda Ślązak <jslazak@jslazak.com>
Signed-off-by: Jagoda Ślązak <jslazak@jslazak.com>
Signed-off-by: Jagoda Ślązak <jslazak@jslazak.com>
Signed-off-by: Jagoda Ślązak <jslazak@jslazak.com>
Signed-off-by: Jagoda Ślązak <jslazak@jslazak.com>
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](taiki-e/install-action@44c6d64...542ceba)

---
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>
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](actions/checkout@08c6903...8e8c483)

---
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>
Bumps [thiserror](https://github.com/dtolnay/thiserror) from 2.0.17 to 2.0.18.
- [Release notes](https://github.com/dtolnay/thiserror/releases)
- [Commits](dtolnay/thiserror@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>
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](Swatinem/rust-cache@f13886b...779680d)

---
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>
Bumps [dtolnay/rust-toolchain](https://github.com/dtolnay/rust-toolchain) from 6d653acede28d24f02e3cd41383119e8b1b35921 to f7ccc83f9ed1e5b9c81d8a67d7ad1a747e22a561.
- [Release notes](https://github.com/dtolnay/rust-toolchain/releases)
- [Commits](dtolnay/rust-toolchain@6d653ac...f7ccc83)

---
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>
Prevents extraction failing on SRS.

Fixes: #9

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

Indexing can potentially panic, without indexing
it is easier to make sure there will be no crash.
Signed-off-by: Jagoda Ślązak <jslazak@jslazak.com>
Signed-off-by: Jagoda Ślązak <jslazak@jslazak.com>
…ge size (#12)

Fixes: #7

Signed-off-by: Jagoda Ślązak <jslazak@jslazak.com>
Improves logs and reduces verbosity.

Fixes: #8

Signed-off-by: Jagoda Ślązak <jslazak@jslazak.com>
Sets lint rules and applies required changes.

Fixes: #16

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

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

I don't know if Postfix as the client disables delayed ACKs,
but if delayed ACKs are enabled, Nagle's algorithm introduces unnecessary delays.
Rate limiter handles all the necessary locking internally.
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](actions/checkout@8e8c483...de0fac2)

---
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>
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](taiki-e/install-action@542ceba...8444b4f)

---
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>
dependabot Bot and others added 13 commits June 30, 2026 19:01
Bumps [taiki-e/install-action](https://github.com/taiki-e/install-action) from 2.81.10 to 2.82.2.
- [Release notes](https://github.com/taiki-e/install-action/releases)
- [Changelog](https://github.com/taiki-e/install-action/blob/main/CHANGELOG.md)
- [Commits](taiki-e/install-action@7a79fe8...9e1e580)

---
updated-dependencies:
- dependency-name: taiki-e/install-action
  dependency-version: 2.82.0
  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>
Bumps [dtolnay/rust-toolchain](https://github.com/dtolnay/rust-toolchain) from 3c5f7ea28cd621ae0bf5283f0e981fb97b8a7af9 to fa04a1451ff1842e2626ccb99004d0195b455a88.
- [Release notes](https://github.com/dtolnay/rust-toolchain/releases)
- [Commits](dtolnay/rust-toolchain@3c5f7ea...fa04a14)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Otherwise only the first case is built.
Signed-off-by: Jagoda Ślązak <jslazak@jslazak.com>
Bumps [hyper](https://github.com/hyperium/hyper) from 1.9.0 to 1.10.1.
- [Release notes](https://github.com/hyperium/hyper/releases)
- [Changelog](https://github.com/hyperium/hyper/blob/master/CHANGELOG.md)
- [Commits](hyperium/hyper@v1.9.0...v1.10.1)

---
updated-dependencies:
- dependency-name: hyper
  dependency-version: 1.10.1
  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>
Bumps [taiki-e/install-action](https://github.com/taiki-e/install-action) from 2.82.5 to 2.83.1.
- [Release notes](https://github.com/taiki-e/install-action/releases)
- [Changelog](https://github.com/taiki-e/install-action/blob/main/CHANGELOG.md)
- [Commits](taiki-e/install-action@bffeee2...2ca9b94)

---
updated-dependencies:
- dependency-name: taiki-e/install-action
  dependency-version: 2.83.1
  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>
Bumps [dtolnay/rust-toolchain](https://github.com/dtolnay/rust-toolchain) from fa04a1451ff1842e2626ccb99004d0195b455a88 to 2c7215f132e9ebf062739d9130488b56d53c060c.
- [Release notes](https://github.com/dtolnay/rust-toolchain/releases)
- [Commits](dtolnay/rust-toolchain@fa04a14...2c7215f)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
@j-g00da

j-g00da commented Jul 26, 2026

Copy link
Copy Markdown
Collaborator

does filtermail still need its own software versions?

In theory it does not, but then we probably want to tag relay more often, as it won't be possible to deploy relay from main if filtermail changed without compiling it locally.

Comment thread .github/workflows/filtermail-ci.yml Fixed
Comment thread .github/workflows/filtermail-ci.yml Fixed
Comment thread .github/workflows/filtermail-ci.yml Fixed
Comment thread .github/workflows/filtermail-ci.yml Fixed
Comment thread .github/workflows/filtermail-release.yml Fixed
Comment thread .github/workflows/filtermail-release.yml Fixed
@missytake
missytake force-pushed the merge-filtermail branch 3 times, most recently from f6fb60e to b8ff1b1 Compare July 29, 2026 12:48

@j4n j4n left a comment

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.

Thanks for tackling this, two non-inline comments:

  • ci.yaml still polls the old filtermail release, adapt that to the build pattern from filtermail-ci.yaml.
  • Changelog: There are now two and two cliff.toml; needs some --include-path work so this won't clobber.

Re versioning: prefixed filtermail-X.Y.Z tags, with relay staying unprefixed, seems the conventional shape; I would not retroactively rename relay's tags to relay-X.Y.Z as it breaks existing release-download URLs.

Comment thread .github/workflows/filtermail-release.yml Outdated
Comment thread .github/workflows/filtermail-release.yml Outdated
Comment thread .github/workflows/filtermail-release.yml
Comment thread .github/workflows/filtermail-release.yml
Comment thread .github/workflows/filtermail-release.yml
Comment thread .github/workflows/filtermail-release.yml Outdated
Comment thread .github/workflows/filtermail-release.yml
Comment thread .github/workflows/filtermail-ci.yml Outdated
Comment thread .github/workflows/filtermail-ci.yml
Comment thread filtermail/Cargo.toml Outdated
Comment thread cmdeploy/src/cmdeploy/mtail/filtermail.mtail
Comment thread .github/workflows/filtermail-release.yml Fixed
@missytake

missytake commented Aug 12, 2026

Copy link
Copy Markdown
Contributor Author

CI requires chatmail/cmlxc#31 I think - edit: apparently not, it's green :)

@missytake
missytake requested a review from j4n August 12, 2026 11:40

@j4n j4n left a comment

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.

Changes looks good. Some more comments inline.

One thing for a followup-PR: RELEASE.md is currently relay-only and should have a filtermail section, something like:

# Releasing chatmail relay
...

# Releasing filtermail

filtermail is versioned independently and released from the same repo,
using `filtermail-` prefixed tags. To release filtermail 0.7.5:

1. Update the changelog:
   `git cliff --config filtermail/cliff.toml -u -t filtermail-0.7.5 -p filtermail/CHANGELOG.md`
2. Bump `version` in `filtermail/Cargo.toml` and commit `filtermail/Cargo.lock`.
3. Commit with the message `feat(release): prepare filtermail for 0.7.5`;  or chore() if it should be excluded from relay changelog.
4. Open a PR with the new commit, merge it to main after review.
5. In the web interface, create a GitHub release, tell it to create a new tag `filtermail-0.7.5`. Do not push the tag by hand: the release must exist before the upload job runs.
6. Bump the pinned version and sha256sums in`cmdeploy/src/cmdeploy/filtermail/deployer.py`.

Comment thread .github/workflows/ci.yaml
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.

Comment thread .github/workflows/ci.yaml
cmlxc -v test-cmdeploy cm0

# cross cmdeploy relay test
cmlxc -v deploy-cmdeploy --source ./repo --ipv4-only cm1

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 --ipv4-only --filtermail repo/filtermail/target/x86_64-unknown-linux-musl/release/filtermail cm1

same as above

Comment thread .github/workflows/ci.yaml
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.

Comment thread cliff.toml
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.

Comment thread filtermail/cliff.toml
# Allowed values: newest, oldest
sort_commits = "oldest"
# Process submodules commits
recurse_submodules = false

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
recurse_submodules = false
recurse_submodules = false
include_paths = ["filtermail/"]
tag_pattern = "^filtermail-"

match only filtermail

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.

Comment on lines +10 to +14
pull_request:
branches:
- main
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
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.

Comment thread filtermail/README.md
Filtermail is distributed as a statically linked linux binary,
available for `x86_64` and `aarch64` architectures.

Binaries are available on the [releases page](https://github.com/chatmail/filtermail/releases).

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.

This needs to be updated.


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..

Comment on lines +2 to +4
push:
tags:
- '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
push:
tags:
- 'filtermail-*'
release:
types: [published]

see filter on line 10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants