Default and Custom Mailboxes

Every account starts with Inbox, Sent, Drafts, Trash, and Junk. Create custom mailboxes to sort messages by test run, environment, or client.

A mailbox is a folder inside an account. An IMAP client shows it as a folder, and the API calls its name the path.

Default Mailboxes

Every new account starts with five mailboxes:

  • Inbox: incoming messages
  • Sent: copies of what you send
  • Drafts: unsent messages
  • Trash: deleted messages
  • Junk: spam

These can't be deleted.

All incoming emails go to the Inbox. The other folders exist for IMAP client compatibility.

Over the API and IMAP, the Inbox's path is INBOX in capitals. Message endpoints take a mailbox id, not a path, so a script looks the id up once:

curl "https://api.smtp.dev/accounts/{accountId}/mailboxes" \
  -H "X-API-KEY: $SMTP_DEV_API_KEY"

Each entry has id, path, totalMessages, and totalUnreadMessages. The unread count is the number next to the mailbox in the sidebar.

Custom Mailboxes

Create additional mailboxes to organize messages by test run, environment, or client.

To create a mailbox, open an account in the Mail section and use the mailbox sidebar, or through the API:

curl -X POST "https://api.smtp.dev/accounts/{accountId}/mailboxes" \
  -H "X-API-KEY: $SMTP_DEV_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"path": "failed-runs"}'

Moving Messages

In Mail, use the move action in the message toolbar. Over the API, move a message by sending the target mailbox's id:

curl -X PUT "https://api.smtp.dev/accounts/{accountId}/mailboxes/{mailboxId}/messages/{id}/move" \
  -H "X-API-KEY: $SMTP_DEV_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"mailbox": "{targetMailboxId}"}'

A test suite can use this to keep evidence. When a test fails, move its message into failed-runs before the cleanup step empties the Inbox, and the email is still there when someone investigates. It expires with your plan's retention window like any other message.

Renaming

Open a mailbox's context menu in the sidebar to rename it. The same menu deletes a mailbox you created. Over the API, renaming is a PATCH with the new path, sent as application/merge-patch+json.

Over IMAP and POP3

An IMAP client lists every mailbox as a folder. POP3 has no folders, so a POP3 client only ever sees the Inbox. IMAP and POP3 has the commands for both.