Mailboxes
Mailboxes let you receive emails on custom domains and use them in your automations. This is how Puppetflow handles email verification flows, OTP codes sent by email, and any scenario where your automation needs to read incoming mail.
How it works
- Configure a mailbox integration with a verified domain.
- Create a mailbox (e.g.
verify@yourdomain.com). - Set up a watcher on a flow to listen for matching emails.
- In your flow code, call
$waitForEmail('watcher-id')to pause until a matching email arrives.
Creating a mailbox
Go to Mailboxes and click New Mailbox:
| Field | Description |
|---|---|
| Mailbox address | Local part and verified domain. |
| Description (Optional) | Optional note. |
| Group | Optional organizational group. |
| Visibility | Owner, Team, or Workspace. |
| Owner | Workspace member who owns the mailbox. |
The full address is local-part@domain.
Browsing emails
The mailbox UI has three panels:
- Mailbox list - All your mailboxes with unread badges.
- Email list - Emails in the selected mailbox with search and sort.
- Email preview - Full email content with HTML rendering.
You can mark emails as read/unread and delete them individually.
Mailbox watchers
Watchers are attached to a flow and define rules for matching incoming emails. When a flow is running and calls $waitForEmail('watcher-id'), Puppetflow checks incoming emails against the watcher's rules.
Creating a watcher
In the flow editor, go to the Mailboxes tab:
- Select a mailbox to watch.
- Give the watcher a name (used in your code).
- Define matching rules.
- Optionally enable additional parsing.
Matching rules
Rules can inspect Body, Subject, To, From, Has Attachments, and Size.
Every field supports Contains, Not Contains, Equals, Greater Than, Less Than, and Regex.
Rules are grouped with AND/OR logic. All rules in a group must match (AND), and any group can match (OR).
Additional parsing
Enable Additional parsing and choose Regex or XPath Selector. The extracted result is available as parsed, with parsed_value as an alias.
Example: extract a 6-digit verification code:
/code[:\s]*(\d{6})/iUsing watchers in code
const email = await $waitForEmail('watcher-id', {
timeout: 300000 // milliseconds, default: watcher config or 300000
});
// email.parsed contains the extracted value (if regex enabled)
await $fillInput('#code', email.parsed);The method blocks until a matching email arrives or the timeout expires.
SMTP server
Puppetflow includes a built-in SMTP server that receives incoming emails. It runs as a separate service on port 2525 (configurable via MAILBOX_SMTP_PORT).
Your domain's MX record must point to the server's public IP for emails to be delivered.
