The Email channel receives inbound emails via a Postmark webhook (JSON POST) and sends replies via nodemailer over SMTP. It works with any SMTP provider — SendGrid, Mailgun, Gmail, or your own server. Each sender's email address becomes their session identity, giving them persistent memory across every message they send.
How it works
- A user sends an email to your Postmark inbound address
- Postmark forwards it as a JSON POST to
https://your-gateway/webhooks/email - The agent replies via SMTP — in the same email thread
Setup
1. Postmark inbound
- Create a Postmark account and add an inbound domain
- Set the inbound webhook URL to
https://your-gateway/webhooks/email(add?secret=YOUR_EMAIL_WEBHOOK_SECRETfor verification) - Postmark will forward every inbound email as a JSON POST to that URL
2. Environment variables
| Variable | Required | Description |
|---|---|---|
SMTP_HOST | Yes | SMTP server host (e.g. smtp.sendgrid.net) |
SMTP_PORT | No | SMTP port, default 587 |
SMTP_USER | Yes | SMTP username (SendGrid uses literal "apikey") |
SMTP_PASSWORD | Yes | SMTP password or API key |
SMTP_FROM | Yes | From address for outgoing replies |
SMTP_SECURE | No | Use TLS (true/false), default false |
EMAIL_WEBHOOK_SECRET | No | Shared secret to verify Postmark webhook requests |
SMTP_HOST=smtp.sendgrid.net
SMTP_PORT=587
SMTP_USER=apikey
SMTP_PASSWORD=SG.xxxxxxxxxxxx
SMTP_FROM=astra@yourdomain.com
EMAIL_WEBHOOK_SECRET=any-random-string3. astra.yml (optional)
channels:
email:
enabled: true
defaultAgent: assistant-agentSession identity
The sender's email address is used as the chatId — the same session and memory system that powers Telegram and Slack conversations. A user who emails from alice@example.com will have persistent memory across every message they send, regardless of subject line.
Email threading
Replies are sent with the correct In-Reply-To and References headers so they appear in the same thread as the user's original message in any email client.
Slash commands
All standard slash commands work in email — sent as the first line of the email body:
| Command | Description |
|---|---|
/reset | Clear the current session |
/memory <query> | Search memory |
/usage | Show token and cost usage |
/agents | List available agents |
/switch <id> | Switch to a different agent |