Skip to content

feat(commandboard-api): AgentMail (agentbbs mailbox) routes#86

Merged
ralyodio merged 1 commit into
masterfrom
feat/agentmail-commandboard-api
Jun 27, 2026
Merged

feat(commandboard-api): AgentMail (agentbbs mailbox) routes#86
ralyodio merged 1 commit into
masterfrom
feat/agentmail-commandboard-api

Conversation

@ralyodio

Copy link
Copy Markdown
Contributor

Mounts the existing @logicsrc/plugin-agentmail package in the CommandBoard API so members can list / read / search / send mail over the existing agentbbs Mailu server — no new mail infra, no DNS.

What's added

  • apps/commandboard-api/src/agentmail.ts — supplies the IMAP/SMTP drivers the plugin leaves injectable (it ships no network libs by design): imapflow + mailparser (list/read/search/flag/delete) and nodemailer (send), mapped to the plugin's domain types. Env-driven builder: AGENTMAIL_BACKEND=mailu → real bbs Mailu, otherwise an in-memory singleton so the API boots/tests without a live server. Handles the STARTTLS cert-vs-loopback gotcha via AGENTMAIL_SMTP_TLS_SERVERNAME.
  • index.ts — registers agentMailPlugin and its 7 declared routes under /api/plugins/agentmail/:
    • GET /mailboxes · GET /mailboxes/:mailbox/messages · GET …/:uid · GET /search?q= · POST /messages · PATCH …/:uid (flags) · DELETE …/:uid
    • Acting member from the x-agentmail-member header (else AGENTMAIL_MEMBER, default chovy), paid-gated. MailAccessError→402, DraftError→422.
  • Tests — 6 new route tests (in-memory backend) + updated the contract test's plugin-id list. commandboard-api 20/20 green, builds clean.

Config for real bbs mail

AGENTMAIL_BACKEND=mailu, AGENTMAIL_USER/AGENTMAIL_PASS (mailbox creds), AGENTMAIL_IMAP_HOST/AGENTMAIL_SMTP_HOST=mail.profullstack.com, AGENTMAIL_SMTP_TLS_SERVERNAME=mail.profullstack.com. Plus-addressing (chovy+<tag>@…) needs RECIPIENT_DELIMITER=+ on the bbs Mailu.

Notes

  • Per-member auth (vs the single configured service account) is a follow-up.
  • Lockfile intentionally not included (it was entangled with other in-progress work); run npm install to pick up the 3 new deps.

🤖 Generated with Claude Code

Mount @logicsrc/plugin-agentmail in the CommandBoard API so members can
list/read/search/send mail over the existing agentbbs Mailu server.

- src/agentmail.ts: inject imapflow + nodemailer + mailparser drivers into
  the plugin's Mailu transport (kept out of the plugin by design); env-driven
  builder (AGENTMAIL_BACKEND=mailu → bbs Mailu, else in-memory singleton for
  dev/test). Handles STARTTLS cert-vs-loopback via AGENTMAIL_SMTP_TLS_SERVERNAME.
- index.ts: register agentMailPlugin + 7 routes under /api/plugins/agentmail/*
  (mailboxes, list, read, search, send, PATCH flags, delete). Acting member
  from x-agentmail-member header (else AGENTMAIL_MEMBER), paid-gated;
  MailAccessError->402, DraftError->422.
- 6 route tests (in-memory backend) + contract test plugin-id list updated.
  commandboard-api 20/20, builds clean.

Note: run `npm install` to refresh the lockfile for the 3 new deps.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

vu1nz Security Review

0 finding(s) in PR #?

No security issues found.

@socket-security

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updated@​logicsrc/​plugin-agentmail@​0.1.0 ⏵ 0.1.000000
Added@​types/​mailparser@​3.4.61001007380100
Added@​types/​nodemailer@​8.0.11001007693100
Addedmailparser@​3.9.12991008094100
Addednodemailer@​9.0.1991009794100
Addedimapflow@​1.4.3991009896100

View full report

@socket-security

Copy link
Copy Markdown

Warning

Review the following alerts detected in dependencies.

According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.

Action Severity Alert  (click "▶" to expand/collapse)
Warn High
License policy violation: npm @zone-eu/mailsplit under EUPL-1.2

License: EUPL-1.2 - The applicable license policy does not permit this license (5) (package/LICENSE.EUPL-1.2)

License: unrecognized license - This license was not allowed or given any lesser classification by the applicable policy (package/LICENSE.EUPL-1.2)

License: EUPL-1.1+ - This license classifier is not allowed by the applicable policy (package/package.json)

From: ?npm/mailparser@3.9.12npm/imapflow@1.4.3npm/@zone-eu/mailsplit@5.4.13

ℹ Read more on: This package | This alert | What is a license policy violation?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Find a package that does not violate your license policy or adjust your policy to allow this package's license.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/@zone-eu/mailsplit@5.4.13. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

View full report

@ralyodio ralyodio merged commit f27210a into master Jun 27, 2026
3 of 5 checks passed
@ralyodio ralyodio deleted the feat/agentmail-commandboard-api branch June 27, 2026 15:54
ralyodio added a commit that referenced this pull request Jun 27, 2026
PR #86 added imapflow, nodemailer, mailparser (+types) to commandboard-api
but did not refresh package-lock.json, so Railway's `npm ci` failed with
EUSAGE (lockfile out of sync). Regenerate the lockfile; no package.json change.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.

1 participant