carlos / platform Public

spec: platform mail submission — SES spike results (§9.0, docs only)

Run 2026-11-13 in the carloku SES account with Paul's approval, simulator
addresses only, throwaway resources deleted and verified. EmailTags
arrive on all event types; header tags and configuration sets are
honoured when the API parameters are absent (decision 6's guard is
required); v2 raw sends need ses:SendRawEmail; 50 recipients; >=11 MB.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Squashed from design/mail-submission-spike into main.
Paul Campbell pushed by claude agent, operated by paul@keymail.dev b94cad7c374c0f6df6cd413052e6c753a09955a8 parent 62607b2
1 file changed, +29 −2
  • docs/superpowers/specs/2026-11-12-platform-mail-submission-design.md +29 −2

CI failed — run details

diff --git a/docs/superpowers/specs/2026-11-12-platform-mail-submission-design.md b/docs/superpowers/specs/2026-11-12-platform-mail-submission-design.md
index 8dd3a0ccf..1e8b8ab53 100644
--- a/docs/superpowers/specs/2026-11-12-platform-mail-submission-design.md
+++ b/docs/superpowers/specs/2026-11-12-platform-mail-submission-design.md
@@ -173,7 +173,8 @@ stays the stated upgrade path, with no app change needed.
`X-SES-*` header from `raw`. SMTP honours `X-SES-TENANT` and
`X-SES-CONFIGURATION-SET` (`internal/mail/aws.go:14-17`). Whether the v2
raw path does is unverified, so they are stripped regardless.
-- **The IAM policy:** `ses:SendEmail` and `ses:SendRawEmail` on
+- **The IAM policy:** `ses:SendRawEmail` (all v2 raw sends need, per
+ §9.0) on
`identity/*` and the account's configuration sets. It is conditioned on
`ses:FromAddress` matching the platform's verified identities, or on
`ses:TenantName` where the sender has a tenant, the key the senders spec
@@ -278,9 +279,35 @@ stays the stated upgrade path, with no app change needed.
and manual pauses do not. During the overlap week, a pause
deactivates the app-level key.
+## 9.0 SES spike results (2026-11-13) — §9 item 1 answered
+
+Run in the carloku SES account (271376211898, eu-west-1) with Paul's
+approval ("All sounds good", 2026-11-13), from the verified platform
+identity `docs.bds.oncarlos.com` to the SES mailbox simulator only, through
+two throwaway configuration sets (an SNS topic and an SQS queue) and a
+throwaway IAM user. All of them were deleted afterwards and their
+deletion verified. No event reached `carlos-bds`; the docs app's counts
+were untouched.
+
+| Question | Answer |
+|---|---|
+| Do SES v2 `EmailTags` arrive on events? | **Yes.** `mail.tags` carries them on Send, Delivery, Bounce and Complaint, beside SES's own `ses:*` tags. Decision 6 stands |
+| Tag values with dots? | **Accepted** (`sender=app.v1`) |
+| `X-SES-MESSAGE-TAGS` in a raw message | **Honoured when the `EmailTags` parameter is absent** (a header-only `forged=yes` appeared on the events). Ignored when the parameter is present. This confirms round 2's P1-A in practice: any credentialed sender can set tags. Decision 6's guard is required, not defensive |
+| `X-SES-CONFIGURATION-SET` in a raw message | **Honoured when `ConfigurationSetName` is absent.** It overrode the identity's default set and moved the events to another set. The parameter wins when present. The mailer always passes both parameters and strips `X-SES-*` (§5) |
+| `ses:caller-identity` | The **bare IAM user name** (`spike-mailsubmit-iam`), or the role name for an assumed role. `SenderOfCaller` matching `carlos-mailer-<region>` by name is right |
+| IAM action for v2 `SendEmail` with raw content | **`ses:SendRawEmail`.** A policy with only `ses:SendEmail` was refused ("not authorized to perform 'ses:SendRawEmail'"), and `ses:operation` reads `SendRawEmail`. §5's policy needs only `ses:SendRawEmail` |
+| Recipients per message | **50.** 50 were accepted; 51 was refused: "Recipient count exceeds 50" |
+| Raw size | **At least 11 MB** was accepted and delivered. §4's 10 MiB cap is inside SES's limit and stays |
+
+**Changes these make:**
+- §5's IAM policy is `ses:SendRawEmail` only.
+- §4's limits are confirmed as written.
+- Decision 6's guard is confirmed necessary.
+
## 9. Open: facts to establish before build
-1. **SES spike** (blocking decisions 6 and 9, and the §4 limits):
+1. ~~**SES spike**~~ **Answered in §9.0 (2026-11-13).** It was:
- `EmailTags` arrive on Bounce, Complaint and Delivery events, in the
shape `sesevents.go` parses.
- The SES v2 raw size limit and recipient limit.