[Go to site: main page, start]

Skip to content

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 ​

  1. Configure a mailbox integration with a verified domain.
  2. Create a mailbox (e.g. verify@yourdomain.com).
  3. Set up a watcher on a flow to listen for matching emails.
  4. 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:

FieldDescription
Mailbox addressLocal part and verified domain.
Description (Optional)Optional note.
GroupOptional organizational group.
VisibilityOwner, Team, or Workspace.
OwnerWorkspace member who owns the mailbox.

The full address is local-part@domain.

Browsing emails ​

The mailbox UI has three panels:

  1. Mailbox list - All your mailboxes with unread badges.
  2. Email list - Emails in the selected mailbox with search and sort.
  3. 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:

  1. Select a mailbox to watch.
  2. Give the watcher a name (used in your code).
  3. Define matching rules.
  4. 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})/i

Using watchers in code ​

js
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.