Repository navigation
mail 3/4: opensource-mail-helper milter, packaging, and dev stack - #504
Conversation
Split 3/4 of #495. Adds mail delivery glue: - opensource-mail-helper as its own component (Postfix milter): suppression checks, unsubscribe headers, null-sender rejection - Manager image packaging and container-creator init - Dev stack wiring in compose.yml and Makefile Merge after the manager backend PR. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🟡 Changes recommended
Mail provisioning fails when writing configuration to the read-only checkout, unsubscribe links point to localhost over HTTP, and package requirements permit unsupported Node.js runtimes.
3 open issues
1 file not reviewed
mail-helper/package-lock.json: Generated file
What changed in this PR
Adds the mail-delivery helper for #67 as part 3 of the mail-service rollout, complementing the Manager backend in #502 and agent integration in #503.
Changes:
- Introduces a Postfix milter for suppression checks, null-sender rejection, and one-click unsubscribe headers.
- Adds helper packaging, systemd integration, and Manager mail-stack initialization.
- Wires helper builds and mail ports into the development stack.
| File | Description |
|---|---|
Makefile |
Adds the helper to component builds. |
mail-helper/test/filter.test.js |
Tests suppression and unsubscribe-header decisions. |
mail-helper/src/index.js |
Implements milter event handling. |
mail-helper/src/filter.js |
Defines recipient checks and unsubscribe headers. |
mail-helper/src/db.js |
Queries read-only mail database views. |
mail-helper/src/config.js |
Loads defaults and local configuration overlays. |
mail-helper/README.md |
Documents helper layout, building, and deployment. |
mail-helper/package.json |
Declares dependencies and runtime commands. |
mail-helper/package-lock.json |
Locks helper dependencies. |
mail-helper/Makefile |
Builds, tests, installs, and packages the helper. |
mail-helper/contrib/systemd/opensource-mail-helper.service |
Defines the sandboxed helper service. |
mail-helper/contrib/postinstall.sh |
Creates mail service users and reloads systemd. |
mail-helper/config.json |
Supplies socket, database, and unsubscribe defaults. |
mail-helper/.gitignore |
Excludes local configuration and generated files. |
mail-helper/.fpm |
Defines package metadata and installation hooks. |
images/proxmox-ve/interfaces |
Forwards mail ports to the Manager. |
images/manager/Dockerfile |
Installs the mail stack and helper; configures peer authentication. |
images/manager/container-creator-init.service |
Grants the application database role CREATEROLE. |
compose.yml |
Builds the helper, publishes mail ports, and seeds relay settings. |
Review effort: Balanced
| - | | ||
| npm -C create-a-container ci --no-audit --no-fund | ||
| make -C agent build | ||
| make -C mail-helper build |
| # reports the `mail` service group and takes the mail-host claim. | ||
| ENV SITE_ID=1 | ||
| ENV MANAGER_URL=http://localhost:3000 | ||
| ENV AGENT_SERVICES=nginx,dnsmasq,mail |
| "pg": "^8.16.3" | ||
| }, | ||
| "engines": { | ||
| "node": ">=20.18.1" |
| post-up echo 1 > /proc/sys/net/ipv4/ip_forward | ||
| post-up iptables -t nat -A POSTROUTING -s 10.254.0.0/16 -o eth0 -j MASQUERADE | ||
| post-up iptables -t nat -A PREROUTING -i eth0 -p tcp -m multiport --dports 80,443,2000:2999 -j DNAT --to-destination 10.254.0.2 | ||
| post-up iptables -t nat -A PREROUTING -i eth0 -p tcp -m multiport --dports 80,443,2000:2999,25,143,465,587,993 -j DNAT --to-destination 10.254.0.2 |
There was a problem hiding this comment.
If its not in another PR, we need to make sure these ports are documented for administrators to forward to the agent.
There was a problem hiding this comment.
These are documented in #505 (the docs PR of this series): docs/admins/installation.md gains a "Mail Ports and PTR" section — forward TCP 25 (SMTP), 587/465 (submission), 993/143 (IMAP) to the manager container, plus the PTR requirement — and docs/admins/email.md covers repointing these forwards when the mail host moves to another agent.


Part 3 of 4 splitting #495 (feature issue: #67).
Adds mail delivery glue:
opensource-mail-helperas its own component (Postfix milter): suppression checks, unsubscribe headers, null-sender rejectioncompose.ymlandMakefileimages/proxmox-ve/interfacesupdateMerge order: after #502 (manager backend); independent of #503 (agent).