Skip to content

Scan Inbox Emails

Escape assigns a dedicated inbox email address to each scan profile, allowing your application to send emails during security tests. The emails commands let you list, read, and wait for emails received at those scan inbox addresses.

Beta Feature

Scan inbox emails are currently in beta. The API and CLI interface may evolve.

Listing Inbox Emails

List emails received at a scan inbox address.

escape-cli emails list --email <inbox-address> [flags]

Aliases: list, ls

Options

Flag Description Format
--email Target inbox email address (required) Scan inbox address
--before Only include emails created before this timestamp RFC3339 (e.g., 2026-01-15T09:00:00Z)
--after Only include emails created after this timestamp RFC3339
--limit Maximum number of emails to return Positive integer

Examples

# List all emails for a scan inbox
escape-cli emails list --email test.00000000-0000-0000-0000-000000000000@scan.escape.tech

# Limit to 10 results
escape-cli emails list --email test.00000000-0000-0000-0000-000000000000@scan.escape.tech --limit 10

# Filter by date
escape-cli emails list --email test.00000000-0000-0000-0000-000000000000@scan.escape.tech \
  --after 2026-04-15T16:47:32Z

# Export to JSON
escape-cli emails list --email test.00000000-0000-0000-0000-000000000000@scan.escape.tech -o json

Example Output:

ID                                    CREATED AT                FROM                      SUBJECT
1126f550-e77b-49e8-9952-e74ac3014825  2026-04-16T12:30:00Z      noreply@example.com       Password Reset
a3b2c1d0-1234-5678-abcd-ef0123456789  2026-04-16T12:25:00Z      alerts@example.com        Verification Code

Reading an Email

Fetch the full content of a specific inbox email by ID.

escape-cli emails read <email-id>

Aliases: read, get, show

Examples

# Read an email
escape-cli emails read 1126f550-e77b-49e8-9952-e74ac3014825

# Read in JSON format
escape-cli emails read 1126f550-e77b-49e8-9952-e74ac3014825 -o json

Example Output:

ID: 1126f550-e77b-49e8-9952-e74ac3014825
CREATED AT: 2026-04-16T12:30:00Z
FROM: noreply@example.com
SUBJECT: Password Reset

BODY:
Click the link below to reset your password...

Waiting for a New Email

Block until the next new email is received at a scan inbox address. This is useful for automated test flows that trigger an email and need to consume the result.

escape-cli emails wait --email <inbox-address> [flags]

Options

Flag Description Default
--email Target inbox email address (required)
--timeout Maximum time to wait before failing (e.g. 30s, 2m) No timeout
--poll-interval Delay between inbox polls 2s

Examples

# Wait indefinitely for the next email
escape-cli emails wait --email test.00000000-0000-0000-0000-000000000000@scan.escape.tech

# Wait with a 2-minute timeout
escape-cli emails wait --email test.00000000-0000-0000-0000-000000000000@scan.escape.tech --timeout 2m

# Poll every second instead of every 2 seconds
escape-cli emails wait --email test.00000000-0000-0000-0000-000000000000@scan.escape.tech --poll-interval 1s

# Capture the result as JSON
escape-cli emails wait --email test.00000000-0000-0000-0000-000000000000@scan.escape.tech -o json

The wait command snapshots the current inbox state, then polls for any new email that was not present at the time the command started. Once a new email arrives, its full content is printed and the command exits.

Automation Example

Use emails wait inside a scan workflow to verify that your application sends the expected email:

#!/bin/bash
set -e

INBOX="test.00000000-0000-0000-0000-000000000000@scan.escape.tech"

# Start the scan that triggers an email
SCAN_ID=$(escape-cli scans start "${PROFILE_ID}" -o json | jq -r '.id')

# Wait for the triggered email (timeout after 60 seconds)
EMAIL=$(escape-cli emails wait --email "$INBOX" --timeout 60s -o json)

# Extract and verify the email subject
SUBJECT=$(echo "$EMAIL" | jq -r '.subject')
echo "Received email: $SUBJECT"