feat: catch outgoing email with Mailpit (kiqr open mail)#29
Merged
Conversation
Add an agent-level Mailpit email catcher so outgoing mail from any kiqr project is captured instead of being sent for real. - Add a `mailpit` service (axllent/mailpit:v1.30.1) to the kiqr agent compose, on KIQR_NETWORK with container_name kiqr-mailpit. Traefik routes Host(`mail.lvh.me`) to the Mailpit web UI on port 8025. SMTP is served on 1025 for in-network clients. restart: unless-stopped, and the container is included in getAgentStatus via AGENT_CONTAINERS. - Route WordPress mail to Mailpit by adding a `phpmailer_init` hook to the per-project mu-plugin: SMTP to host kiqr-mailpit:1025, no auth, no encryption. Auto-login and LiveReload behavior are unchanged. - Add a `mail`/`mailpit` target to `kiqr open` that opens http://mail.lvh.me:5477. - Tests assert the compose mailpit service (image/labels/port), the mu-plugin SMTP routing hook, and existing agent-status coverage. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
kjellbergzoey
force-pushed
the
feat/mailpit-email-catcher
branch
from
June 8, 2026 20:00
a2d42a7 to
c2ab1a3
Compare
Contributor
Author
|
Rebased onto current main (resolved conflicts in Heads-up unrelated to this PR: |
The tunnel/share + Apache-conf work landed on main un-formatted, failing `npm run lint`. Formats up.tsx, restart.tsx, share.ts, BitnamiRuntimeProvider.ts, and share.test.ts. Pure formatting, no behavior changes. Folded into this PR so its CI lint check (and main, on merge) goes green. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds an agent-level Mailpit email catcher so outgoing mail from any kiqr project is captured locally instead of being delivered for real, plus a
kiqr open mailshortcut to view it.Agent compose (
src/lib/agent.ts)mailpitservice usingaxllent/mailpit:v1.30.1(tag verified to exist via the Docker Hub registry API),container_name: kiqr-mailpit, onKIQR_NETWORK,restart: unless-stopped.Host(\mail.lvh.me`)on entrypointweb, loadbalancer server port8025(Mailpit's web UI). Mailpit also listens for SMTP on1025` for in-network clients.kiqr-mailpitis added toAGENT_CONTAINERS, so it shows up inkiqr agent status.WordPress mail routing (
src/lib/mu-plugin.ts)phpmailer_inithook that points PHPMailer at SMTP hostkiqr-mailpit, port1025, no auth, no encryption. The WordPress container sharesKIQR_NETWORK, so it resolveskiqr-mailpitby name.kiqr open mail(src/commands/open.tsx)mail/mailpittarget that openshttp://mail.lvh.me:5477, following the existing open-target pattern.Applying the change
Because this touches both the agent stack and the per-project mu-plugin, after pulling this in you need to:
kiqr agent restart— to bring up the newkiqr-mailpitcontainer and Traefik route.kiqr restart(per project) — to re-write the mu-plugin so WordPress starts routing mail to Mailpit.Tests
mailpitservice image,kiqr-mailpitcontainer name, network, restart policy, and the Traefik Host/entrypoint/port labels.phpmailer_initSMTP routing hook (isSMTP, hostkiqr-mailpit, port1025,SMTPAuth=false).All four gates pass locally:
typecheck,test(210 passed),build,lint.Not verified
kiqr-mailpit, Traefik routing ofmail.lvh.me, PHPMailer delivery) was validated only by inspection.Docs
README documentation for
kiqr open mailand the mail catcher will follow — a separate README rewrite PR is currently open, so this PR intentionally leaves README.md untouched. cc @kjellberg🤖 Generated with Claude Code