Email Source
Email Source
Receive inbound emails in Outrun and store them as activities. The email source supports two setup methods: organization-wide MX record routing and per-user Gmail forwarding.
Inbound Only
This is a receive-only source. Emails are stored as activities for tracking and analysis. Sending or replying to emails is not supported.
Supported Objects
Email maps to a single standardized object type:
Activities (from Emails)
- Source Object:
emails - Primary ID: Message ID
- Key Fields: Subject, sender, recipients, body, attachments metadata
Messages
- Emails also map to the Messages object type, making email content available alongside chat and other messaging channels in a unified view.
Setup Methods
Method 1: MX Record (Organization-wide)
Route all inbound email for a domain through Outrun by pointing your DNS MX records at your source-specific subdomain.
Best for: Capturing all inbound email across your entire organization.
Setup:
- Create an Email source in Outrun
- Add an MX record in your domain's DNS:
- Type: MX
- Priority: 10
- Target:
{sourceId}.customer.getoutrun.com
Method 2: Gmail Forwarding (Single User)
Forward emails from an individual Gmail account to Outrun.
Best for: Tracking a specific mailbox without changing DNS.
Setup:
- Create an Email source in Outrun
- In Gmail, go to Settings > Forwarding and POP/IMAP
- Click Add a forwarding address
- Enter:
{sourceId}@customer.getoutrun.com - Confirm the forwarding via the verification email
- Select Forward a copy of incoming mail to and choose the address
Field Mappings
Activities (Emails)
| Outrun Field | Email Field | Type | Description |
|---|---|---|---|
type |
(literal message) |
String | Activity type, always "message" |
content |
StrippedTextReply |
String | Reply-only text content |
metadata.subject |
Subject |
String | Email subject line |
metadata.from |
From |
String | Sender email address |
metadata.fromName |
FromName |
String | Sender display name |
metadata.to |
To |
String | Recipient address |
metadata.cc |
Cc |
String | CC recipients |
metadata.htmlBody |
HtmlBody |
String | Full HTML body |
metadata.textBody |
TextBody |
String | Full plain text body |
metadata.replyTo |
ReplyTo |
String | Reply-to address |
metadata.date |
Date |
String | Email timestamp |
metadata.messageId |
MessageID |
String | Unique message identifier |
metadata.attachments |
Attachments |
Array | Attachment metadata (name, type, size) |
Attachment Handling
Attachment file content (base64 data) is not stored. Only metadata is retained:
| Field | Description |
|---|---|
Name |
Attachment filename |
ContentType |
MIME type (e.g., application/pdf) |
ContentLength |
File size in bytes |
Sync Behavior
Real-time Processing
- Delivery: Emails arrive via webhook in real time (no polling)
- Processing: Each email is immediately written to the
stream_datatable - Consolidation: The listener service picks up new records and consolidates them into activities
Data Pipeline
- Resend receives the inbound email
- Resend POSTs the webhook event to
/api/v1/webhook/email - The stream service extracts the source ID from the recipient address
- Raw email data (minus attachment content) is stored in the
stream_datatable - The listener triggers
consolidateRecordwhich normalizes the data - The
consolidateActivitiesjob creates the activity record
Deduplication
Emails are deduplicated using the MessageID field as the external ID. If the same email is delivered twice (e.g., via both MX and forwarding), only one activity is created.
System Nuances
Email-Specific Considerations
- Source ID in Address: Each email source gets a unique address using the source's ID
- Multiple Sources: A workspace can have multiple email sources, each with its own address
- No Authentication Required: Email sources don't use OAuth tokens -- they receive data via webhooks
- Attachment Limits: Attachment content is stripped to avoid storage bloat; only metadata is kept
- HTML Sanitization: HTML body content is stored as-is; sanitize before rendering in UI
Address Formats
| Method | Address Format |
|---|---|
| MX Record | *@{sourceId}.customer.getoutrun.com |
| Gmail Forwarding | {sourceId}@customer.getoutrun.com |
Best Practices
Setup Recommendations
- Choose the right method: Use MX records for organization-wide capture, Gmail forwarding for individual mailboxes
- Test first: Send a test email after setup to verify the pipeline works end-to-end
- DNS propagation: MX record changes can take up to 48 hours to propagate
- Gmail verification: Gmail requires you to confirm the forwarding address via a verification email
Monitoring
- Stream history: Check the
stream_historytable for delivery records - Webhook logs: Monitor the stream service logs for any delivery errors
- Activity count: Verify activities are being created in the workspace
Troubleshooting
Common Issues
Emails not arriving
- Verify DNS MX records are correctly configured and propagated
- Check that the Resend inbound webhook URL is accessible
- Confirm the stream route exists in the
stream_routestable
Source not found errors
- Verify the source ID in the recipient address matches an active source
- Check that the
streamRoutesdocument has the correctsourceIdandworkspaceId
Missing email content
- Text body may be empty for new (non-reply) emails -- check
TextBodyorHtmlBodyin metadata - Attachment content is intentionally stripped; only metadata is stored
Support Resources
- Resend Inbound Documentation: resend.com/docs/dashboard/webhooks/introduction
- Outrun Support: [email protected]
Ready to set up email tracking? Navigate to Sources > Add Source > Email in your workspace to get started.