Catch-All Inboxes for QA
Signup flows need a new email address every run. Instead of creating an account per test user, create one catch-all account: username *, your domain, one password.
Now any address on the domain is deliverable. Exact matches still win - mail for support@qa.example.com goes to the support account if it exists, everything else lands in the catch-all.
Generating Addresses
Derive the local part from the test, so every run is isolated and traceable:
const address = `qa-${crypto.randomUUID()}@qa.example.com`
Or keep one real account and use plus aliases - qa+run42@qa.example.com delivers to qa@qa.example.com, and the full alias stays in the To header.
Finding the Message
Everything arrives in the catch-all's INBOX, so filter by recipient. Get the account and mailbox ids once:
curl -G "https://api.smtp.dev/accounts" \
--data-urlencode "address=*@qa.example.com" \
-H "X-API-KEY: smtplabs_your_api_key_here"
curl "https://api.smtp.dev/accounts/{accountId}/mailboxes" \
-H "X-API-KEY: smtplabs_your_api_key_here"
Then match on the To header:
const { member } = await api(`/accounts/${accountId}/mailboxes/${inboxId}/messages`)
const message = member.find(m => m.to.some(t => t.address === address))
The polling helper from the CI guide works here too - pass a different match.