Channels

Email

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

  1. A user sends an email to your Postmark inbound address
  2. Postmark forwards it as a JSON POST to https://your-gateway/webhooks/email
  3. The agent replies via SMTP — in the same email thread

Setup

1. Postmark inbound

  1. Create a Postmark account and add an inbound domain
  2. Set the inbound webhook URL to https://your-gateway/webhooks/email (add ?secret=YOUR_EMAIL_WEBHOOK_SECRET for verification)
  3. Postmark will forward every inbound email as a JSON POST to that URL

2. Environment variables

VariableRequiredDescription
SMTP_HOSTYesSMTP server host (e.g. smtp.sendgrid.net)
SMTP_PORTNoSMTP port, default 587
SMTP_USERYesSMTP username (SendGrid uses literal "apikey")
SMTP_PASSWORDYesSMTP password or API key
SMTP_FROMYesFrom address for outgoing replies
SMTP_SECURENoUse TLS (true/false), default false
EMAIL_WEBHOOK_SECRETNoShared secret to verify Postmark webhook requests
bash
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-string

3. astra.yml (optional)

yaml
channels:
  email:
    enabled: true
    defaultAgent: assistant-agent

Session 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:

CommandDescription
/resetClear the current session
/memory <query>Search memory
/usageShow token and cost usage
/agentsList available agents
/switch <id>Switch to a different agent

Supported providers

iThe SMTP outbound leg works with any SMTP provider. The inbound leg requires Postmark (the webhook format is Postmark-specific). SendGrid, Mailgun, and Amazon SES all work as SMTP relay providers for outbound.