Overview
Inbound routes allow you to receive emails and process them programmatically via webhooks. Every inbound route gets a unique email address, and you can optionally configure custom domains for branded receiving addresses.Inbound routes are available on Starter plans and above. Check your plan’s feature availability in the dashboard.
How Inbound Mail Works
- Email arrives at your inbound route address
- Spam filtering checks the message against your configured threshold
- Email parsing extracts headers, body, attachments, and metadata
- Webhook delivery sends the complete email data to your endpoint
- Your application processes the email and takes action
Getting Started
Step 1: Create an Inbound Route
- Navigate to your project in the dashboard
- Go to Routes → Create Route
- Select Inbound as the route type
- Configure your spam filtering preferences
- Save the route
Step 2: Get Your Inbound Address
Once created, your route receives a unique email address:a1b2c3d4e5f67890abcdef1234567890@inbound.lettermint.co
You can find your inbound address on the route details page in your dashboard. Copy it to start receiving emails immediately.
Step 3: Configure Webhooks
To process received emails, set up a webhook endpoint:- In your route settings, go to Webhooks
- Create a new webhook
- Enter your endpoint URL
- Save and test the webhook
Custom Domains
Use your own domain for inbound email addresses instead of the default@inbound.lettermint.co
domain.
Setting Up a Custom Domain
1
Configure custom domain
In your inbound route settings, enter your desired custom domain (e.g.,
support.acme.com
)2
Add MX record
Add an MX record to your DNS pointing to Lettermint’s inbound servers:
Type | Hostname | Priority | Value |
---|---|---|---|
MX | support.acme.com | 10 | inbound.lettermint.co |
3
Verify domain
Return to your route settings and click Verify MX Record. Verification typically completes within minutes.
4
Start receiving
Once verified, emails sent to
anything@support.acme.com
will be routed to your webhook.Custom domain MX records must point exclusively to Lettermint. If you need to receive emails at the same domain through multiple providers, use a subdomain like
inbound.yourdomain.com
.DNS Propagation
DNS changes can take time to propagate globally:- DNS changes typically propagate in 5-60 minutes
- Some DNS providers cache records for up to 24 hours
- Ensure your MX record points to
inbound.lettermint.co
- Check that the hostname is correct (not doubled like
support.acme.com.acme.com
)
Spam Filtering
Lettermint automatically scans all inbound emails using Rspamd spam filtering. You can configure how strictly emails are filtered.Spam Threshold
The spam threshold determines what happens to messages based on their spam score:Spam score threshold. Messages with a higher score are marked as spam.
- 5.0 (default): Standard filtering, rejects obvious spam
- 10.0: Lenient, allows most emails through
- 2.0: Strict, may flag legitimate emails as spam
- null: Spam filtering OFF, accepts all emails, but will still scan and report spam scores
Setting the threshold to
null
(OFF) will accept all emails including obvious spam. Only use this for testing or when you implement your own spam filtering.Spam Detection Results
Every inbound webhook includes spam scoring information:Subaddress Support
Lettermint supports email subaddressing (also known as plus addressing) for routing and filtering:Use Cases
Support ticket categorization:Webhook Payload
Subaddresses are parsed and included in the webhook payload:Webhook Payload
When an email is received, Lettermint sends amessage.inbound
webhook with complete email data.
Example Payload
Payload Fields
Field | Type | Description |
---|---|---|
route | string | Route slug/identifier |
message_id | string | Unique message identifier |
from.email | string | Sender email address |
from.name | string|null | Sender display name |
from.subaddress | string|null | Parsed subaddress from sender |
to | array | List of TO recipients |
cc | array | List of CC recipients |
recipient | string | Primary recipient (envelope TO) |
subaddress | string|null | Parsed subaddress from recipient |
reply_to | string|null | Reply-To address |
subject | string | Email subject |
date | string | ISO 8601 timestamp |
body.text | string|null | Plain text body |
body.html | string|null | HTML body |
tag | string|null | Custom tag from X-LM-Tag header |
headers | array | All email headers (excluding standard ones) |
attachments | array | File attachments with base64 content |
is_spam | boolean | Whether message exceeded spam threshold |
spam_score | number | Calculated spam score |
spam_symbols | array | Array of spam rule objects with name , score , options , and description |
Attachment content is base64-encoded. Decode it before saving or processing files.
Processing Attachments
Attachments are included in the webhook payload with their content base64-encoded:Best Practices
Security
- Validate webhook signatures: Always verify webhook authenticity using signed webhooks
- Sanitize email content: Email bodies can contain malicious HTML or scripts
- Scan attachments: Run virus scans on attachments before processing
- Rate limiting: Implement rate limits to prevent abuse
Performance
- Async processing: Process emails in background jobs, not during webhook request
- Return 200 quickly: Acknowledge webhook receipt within 5 seconds
- Handle retries: Lettermint retries failed webhooks, design idempotent handlers
Use Cases
Support Ticket System
Receive support emails and automatically create tickets:Email to Task Converter
Parse emails and create tasks in your project management system:Reply Tracking
Track replies to your outbound emails:Limitations
- Maximum email size: 25 MB (including attachments)
- Webhook timeout: 30 seconds
- Delivery attempts: Up to 3 retries on failure
- Custom domains: Requires exclusive MX record pointing to Lettermint
Next Steps
- Webhook Events - Complete
message.inbound
payload reference - Signed Webhooks - Verify webhook authenticity
- Routes Overview - Learn about other route types