Test Email Addresses for QA with a Catch-All Inbox

One catch-all account receives mail for every address on your test domain. A fresh, real email address per test run, with no account to create for each one.

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, and everything else lands in the catch-all.

Catch-all accounts are on Pro and Max. On Lite, use plus aliases of one account instead.

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 on any plan. 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 with a different match.

List Messages returns 30 messages per page, newest first. A busy catch-all fills pages fast, so match on something unique and poll right after the action that triggers the email.