Configure
Send and receive email
Configure outbound and inbound email on your self-hosted dimmi with SMTP, Amazon SES, Postmark, Mailgun, SendGrid, Resend, or Cloudflare.
Until you configure a mail driver, dimmi prints emails to its logs instead of delivering them.
Setting up Amazon SES (which also requires an S3 bucket, SNS topic, and IAM user)? Follow the dedicated SES guide.
Outbound email
Section titled “Outbound email”dimmi uses two mailers: system sends login links, invites, and alerts; customer sends support replies and broadcasts (and falls back to system if left unset).
dimmictl set <<'EOF'DIMMI_MAIL__FROM__NAME=Acme SupportDIMMI_MAIL__FROM__EMAIL=no-reply@mail.example.comDIMMI_MAIL__MAILERS__SYSTEM__DRIVER=smtpDIMMI_MAIL__MAILERS__SYSTEM__HOST=smtp.example.netDIMMI_MAIL__MAILERS__SYSTEM__USERNAME=<smtp_username>DIMMI_MAIL__MAILERS__SYSTEM__PASSWORD=<smtp_password>EOFAppend driver options to DIMMI_MAIL__MAILERS__SYSTEM__ or DIMMI_MAIL__MAILERS__CUSTOMER__:
DRIVER |
Required and optional keys |
|---|---|
smtp |
HOST, PORT (default 587), USERNAME, PASSWORD, TLS (true for port 465) |
ses |
REGION (default us-east-1), ACCESS_KEY_ID, SECRET_ACCESS_KEY, CONFIGURATION_SET |
postmark |
TOKEN, MESSAGE_STREAM (default outbound) |
mailgun |
API_KEY, DOMAIN, ENDPOINT (default https://api.mailgun.net; use https://api.eu.mailgun.net for EU) |
sendgrid |
API_KEY |
resend |
API_KEY |
Verify your sending domain at your mail provider, then diagnose any missing records with:
docker compose -f /opt/dimmi/compose.yaml exec web /dimmi email:doctor mail.example.comBounces and spam complaints
Section titled “Bounces and spam complaints”dimmi reads the bounce and spam reports that mailbox providers mail back to your inbound domain. Each one stops mail to that address, and the lasting ones count toward the bulk email pause.
Amazon SES reports bounces and complaints as events of its own instead. To count them, give your customer mail a configuration set that publishes Bounce and Complaint events to an SNS topic, then name both:
dimmictl set <<'EOF'DIMMI_CHANNELS__EMAIL__SENDING__SES__CONFIGURATION_SET=dimmi-customerDIMMI_CHANNELS__EMAIL__SENDING__SES__EVENTS_TOPIC_ARN=arn:aws:sns:us-east-1:<account>:dimmi-eventsEOFSubscribe the topic to https://<app_domain>/webhooks/ses/events after saving those settings. dimmi confirms the subscription itself and refuses posts from any other topic. The SES guide has the commands.
| SES event | Mail to the address | Counts toward the pause |
|---|---|---|
| Permanent bounce | Stops for good | Yes, as a bounce |
| Transient bounce | Stops for 72 hours | No |
| Complaint | Stops for good | Yes, as a spam report |
A report that reaches dimmi both by mail and as an event counts once. On the other providers, dimmi counts the reports that arrive by mail.
Inbound email
Section titled “Inbound email”Dedicate one domain solely to dimmi inbound mail (such as inbound.example.com). Point its MX records at your mail provider, then configure the inbound domain and driver:
dimmictl set <<'EOF'DIMMI_CHANNELS__EMAIL__INBOUND_DOMAIN=inbound.example.comDIMMI_CHANNELS__EMAIL__INBOUND__DRIVERS=postmarkDIMMI_MAILBOX__DEFAULT=postmarkDIMMI_MAILBOX__SOURCES__POSTMARK__DRIVER=postmarkDIMMI_MAILBOX__SOURCES__POSTMARK__USERNAME=<webhook_username>DIMMI_MAILBOX__SOURCES__POSTMARK__PASSWORD=<webhook_password>EOFFor another provider, swap postmark / POSTMARK for its driver name and set its options below (<app_domain> is your dimmi hostname):
| Driver | Environment options | Provider setup |
|---|---|---|
postmark |
USERNAME, PASSWORD (random values you choose) |
Inbound stream with raw email enabled, webhook URL https://<webhook_username>:<webhook_password>@<app_domain>/webhooks/postmark/inbound |
mailgun |
SIGNING_KEY (HTTP webhook signing key) |
Receiving route forwarding to https://<app_domain>/webhooks/mailgun/inbound/mime |
sendgrid |
PUBLIC_KEY (webhook verification key) |
Inbound Parse posting signed raw MIME to https://<app_domain>/webhooks/sendgrid/inbound |
resend |
WEBHOOK_SECRET, API_KEY |
Webhook for email.received pointing to https://<app_domain>/webhooks/resend/inbound |
cloudflare |
SECRET (random value you choose) |
Cloudflare Worker with that secret + catch-all Email Routing rule. Print the Worker code with /dimmi email:cloudflare-worker. |
Check your inbound pipeline anytime by running /dimmi email:inbound-doctor inside the web container. Once ready, workspaces can forward their support addresses to your inbound domain.