Forward Email
Forward Email is a privacy-focused email provider for custom domains. It offers SMTP, IMAP, POP3, CalDAV and CardDAV, a REST API, and an MCP server.
What you need
FORWARD_EMAIL_API_KEY, from https://forwardemail.net/my-account/security.- The API, outbound SMTP and mailbox storage require a paid plan (Enhanced Protection or Team).
- If the key is missing, ask for it and tell the user where to get it.
- Preferred: the
forwardemailMCP server, launched withnpx -y @forwardemail/mcp-server. It has 68 tools across domains, aliases, email, mailboxes, calendars and contacts; each tool calls one API endpoint. - Fallback: the REST API at
https://api.forwardemail.net.- Auth is HTTP Basic, with the API key as the username and an empty password:
curl -u "$FORWARD_EMAIL_API_KEY:". - Mailbox endpoints (messages, folders, contacts, calendars) use alias credentials instead, and the alias needs
has_imap: true. - Spec: https://forwardemail.net/api-spec.json.
- Auth is HTTP Basic, with the API key as the username and an empty password:
Keep secrets out of output, logs and git. Write them to .env, check that .env is in .gitignore, and add placeholders to .env.example.
Workflow
Follow these steps in order. Report progress after each step.
1. Domain
- Existing domain: call
getDomain(GET /v1/domains/:domain). - New domain: call
createDomain(POST /v1/domainswith{"domain":"example.com"}).- This also creates a catch-all alias (
*) that forwards to the account email. Send"catchall": falseif the user doesn't want it. - Send-only (the domain keeps its current mail host): also send
"ignore_mx_check": true. For an existing domain, set it withupdateDomain.
- This also creates a catch-all alias (
- Keep from the response:
id,verification_record,smtp_dns_records.{dkim,return_path,dmarc},has_smtp, and thehas_*_recordflags.
2. DNS records
| Purpose | Type | Name | Value |
|---|---|---|---|
| Inbound | MX | @ |
mx1.forwardemail.net (priority 0) |
| Inbound | MX | @ |
mx2.forwardemail.net (priority 0) |
| Ownership | TXT | @ |
forward-email-site-verification=<verification_record> |
| SPF | TXT | @ |
v=spf1 include:spf.forwardemail.net -all |
| DKIM | TXT | <smtp_dns_records.dkim.name> |
<smtp_dns_records.dkim.value> |
| Return-Path | CNAME | <smtp_dns_records.return_path.name> |
forwardemail.net |
| DMARC | TXT | <smtp_dns_records.dmarc.name> |
<smtp_dns_records.dmarc.value> |
Rules:
- Use the API response, not guesses. Always take names and values from the domain object.
- Subdomains: for
mail.example.com, the@records go on themailhost, and the API's DKIM, Return-Path and DMARC names are relative to the parent zone (for example_dmarc.mail). - SPF: keep exactly one SPF record. If one already exists, add
include:spf.forwardemail.netbefore its-allor~allinstead of creating a second one. - MX: if the domain already has MX records pointing somewhere else, the domain receives mail today. Stop and confirm before replacing them. If the user wants to keep them, skip the MX records and use
ignore_mx_check: true(step 1). - DMARC: the API suggests
p=reject. If other services send as this domain, or a DMARC record already exists, show the values and ask which policy to use.p=noneandp=quarantinealso pass verification. - Writing the records: do it automatically when a DNS provider API, CLI or MCP server is available; see references/dns.md. Otherwise show the table and wait for the user to add the records.
- Cloudflare: the Return-Path CNAME must be DNS-only (
proxied: false).
3. Verify
- Inbound: call
verifyDomainRecords(GET /v1/domains/:domain/verify-records). Success reads "Domain's DNS records have been verified." - Outbound: call
verifySmtpRecords(GET /v1/domains/:domain/verify-smtp). It checks DKIM, Return-Path and DMARC. Success reads "You have successfully configured and verified DNS records for outbound SMTP." - Run both checks. Don't make verify-smtp wait for verify-records.
- On failure: the error text names the missing or wrong record. Fix it, then retry with backoff: 15 s, 30 s, 60 s, then every 2 minutes for about 15 minutes. DNS propagation often takes a few minutes.
- Outbound SMTP approval: when verify-smtp passes, domains that pass Forward Email's automatic checks get outbound SMTP right away (
has_smtpbecomestrue). Others get a manual review: most within 1–2 hours, typically under 24. The domain admins get an email, and Forward Email may ask for details. Keep building meanwhile; only live sending waits.
4. Sender alias and password
- Create the alias: call
createAlias(POST /v1/domains/:domain/aliases) with{"name":"hello","recipients":"<where replies should go>"}.- Add
"has_imap": trueif the alias should also keep a mailbox, or if its credentials will be used for IMAP, POP3, CalDAV, CardDAV or the API.
- Add
- Get SMTP credentials: call
generateAliasPassword(POST /v1/domains/:domain/aliases/:alias_id/generate-password) with the aliasid. It returnsusernameandpassword.- Store them as
SMTP_USERandSMTP_PASS. - They are shown once, so never echo the password back.
- If the alias already has a password, send the current one as
passwordto rotate it.is_override: truepermanently deletes the alias's mailbox, so never use it without asking.
- Store them as
5. Wire the app
Use the project's existing mail layer if there is one; otherwise add the standard mailer for the stack. Snippets for Node, Next.js, Python, Django, Rails, Laravel, Go and plain HTTP are in references/app-setup.md.
- SMTP: host
smtp.forwardemail.net.- Ports: 465 with implicit TLS (recommended), or 587 with STARTTLS (2465, 2587 and 2525 also work).
- User is the alias address; password is the generated one.
- HTTP:
POST /v1/emailswith the API key and a JSON body.- The body uses Nodemailer message fields:
from,to,cc,bcc,subject,text,html,attachments,replyTo,headers. frommust be an alias on the verified domain.- Alias credentials also work here, but only when the alias has
has_imap: true.
- The body uses Nodemailer message fields:
- Env vars to add:
SMTP_HOST,SMTP_PORT,SMTP_USER,SMTP_PASSandMAIL_FROM, orFORWARD_EMAIL_API_KEYfor HTTP.
6. Test and report
- Send one test:
sendEmail, or run the app's own code path, to the user's address. - Confirm delivery: check
listEmails/GET /v1/emailsfor the status. - Check the limit:
getEmailLimit(GET /v1/emails/limit). The default is 300 emails per day, per domain and per user. More can be requested. - Summarize:
- the records that were created and whether they verified;
- the SMTP approval state;
- the sender address;
- the files changed and the env vars added;
- anything the user still has to do.
Other tasks
- Forwarding only: MX plus the verification TXT is enough. Create aliases whose
recipientsare the destination addresses. - Mailbox access: IMAP
imap.forwardemail.net:993, POP3pop3.forwardemail.net:995, CalDAVhttps://caldav.forwardemail.net, CardDAVhttps://carddav.forwardemail.net. Log in with the alias address and its generated password. The alias needshas_imap: true.- For the MCP mailbox tools, set
FORWARD_EMAIL_ALIAS_USERandFORWARD_EMAIL_ALIAS_PASSWORD.
- For the MCP mailbox tools, set
- Bounces: set
bounce_webhookon the domain (updateDomain) to receive bounce notifications.
Troubleshooting
- 401: wrong API key. Check that the colon comes after the key, with an empty password.
- 402 Payment Required: the account needs a paid plan (Enhanced Protection or Team).
- 403 "Domain is not approved for outbound SMTP access" (HTTP API): outbound SMTP isn't on yet. Run
verifySmtpRecords, fix what it reports, or wait for the review. - 429 (HTTP API) or SMTP
421: a rate or daily limit. Retry later, and checkgetEmailLimit. - SMTP
535naming the domain approval or setup ("pending admin approval" or "not configured for outbound SMTP"): same as the 403 above. - Any other
535: read the message; it names the cause, such as a missing verification TXT record, no generated password yet, a wrong password, or IMAP not enabled on the alias. Fix that cause. Rotate a password only by sending the current one (see step 4). - Mail lands in spam: confirm that SPF, DKIM and DMARC pass (verify-smtp), and use a real
fromalias on the same domain.
Docs: https://forwardemail.net/en/email-api, https://forwardemail.net/en/faq, https://forwardemail.net/llms.txt