Skip to content

mail 3/4: opensource-mail-helper milter, packaging, and dev stack - #504

Merged
cmyers-mieweb merged 1 commit into
mainfrom
cmyers_mail-3-helper-packaging
Nov 3, 2026
Merged

cmyers-mieweb merged 1 commit into
mainfrom
cmyers_mail-3-helper-packaging

Conversation

@cmyers-mieweb

Copy link
Copy Markdown
Collaborator

Part 3 of 4 splitting #495 (feature issue: #67).

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
  • images/proxmox-ve/interfaces update

Merge order: after #502 (manager backend); independent of #503 (agent).

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>
Copilot AI balanced review requested due to automatic review settings October 28, 2026 23:18

Copilot AI 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 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

Comment thread compose.yml
- |
npm -C create-a-container ci --no-audit --no-fund
make -C agent build
make -C mail-helper build
Comment thread images/manager/Dockerfile
# 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
Comment thread mail-helper/package.json
"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

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

If its not in another PR, we need to make sure these ports are documented for administrators to forward to the agent.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

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.

@cmyers-mieweb
cmyers-mieweb merged commit 0edd5ae into main Nov 3, 2026
8 of 9 checks passed
@cmyers-mieweb
cmyers-mieweb deleted the cmyers_mail-3-helper-packaging branch November 3, 2026 16:35
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.

3 participants