Werkmail Docs
Contents

Guides

Inbound mail

Werkmail can receive mail for a tenant. Receiving is opt-in and always uses a dedicated subdomain.

MX rule (non-negotiable)

Publish inbound MX only on in.<your-sending-domain>.

Never point the apex MX at Werkmail. Apex MX would capture every message for the domain, including the owner’s personal and office inboxes.

If your sending domain is praxis.example, people write to hello@in.praxis.example (or whatever local-part you choose). The dashboard Inbox lists those messages.

Enable receiving

bash
curl -sS -H "Authorization: Bearer $TOKEN" \
  "$BASE/api/practices/$PRACTICE_ID/inbound"

curl -sS -X POST -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" -d '{}' \
  "$BASE/api/practices/$PRACTICE_ID/inbound/enable"

Then publish the MX/TXT pair from GET …/dns-records (inbound section) or POST …/inbound/apply-dns when Cloudflare apply is enabled.

Related:

  • POST …/inbound/check — verify public DNS
  • POST …/inbound/disable
  • PATCH …/inbound — mailbox options
  • GET …/inbound/messages and GET …/inbound/messages/{messageID}

Inbound send hook

Automation tools can send as the tenant without a dashboard session. Create a hook; the secret (hooksec_…) is shown once.

bash
curl -sS -X POST -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"name":"Automation"}' \
  "$BASE/api/practices/$PRACTICE_ID/inbound-hooks"

Public send (no session token):

bash
curl -sS -X POST "$BASE/api/public/hooks/$PRACTICE_ID/send" \
  -H "Content-Type: application/json" \
  -H "X-Werkmail-Hook-Secret: $HOOK_SECRET" \
  -d '{
    "to": "you@example.com",
    "subject": "Hi",
    "text": "hello",
    "message_kind": "termin"
  }'

Rotate with POST …/inbound-hooks/{id}/rotate. Test with POST …/inbound-hooks/{id}/test.

The hook still runs the full send pipeline (suppressions, content gate, unsubscribe headers).

Reply forwarding

A workspace can print a branded reply address and never run its own inbox. The inbound MX is part of the Domain Connect template, so one click on the Cloudflare page publishes it together with DKIM, MAIL FROM, SPF and DMARC. Replies are caught on replies@in.<sending-domain> and forwarded to the mailbox the team already reads.

  1. POST /api/practices/{id}/reply-forwarding with {"destination": "you@example.com"}. Nothing is forwarded yet.
  2. A confirmation link goes to that mailbox. Opening it activates forwarding and makes the branded address the Reply-To on every send that does not name its own.
  3. GET /api/practices/{id}/reply-forwarding shows the state, the alias and the result of the last forward. DELETE turns it off and removes the alias as reply address; a custom reply address stays.

A forwarded reply is a normal transactional mail from the workspace. Its Reply-To is the original sender, so answering it still reaches the person who wrote it. Auto-replies, mail from the workspace domain and mail from the destination itself are never forwarded, which is what keeps a loop from starting. The full conversation stays visible in the inbox as well, and a failed forward is shown in the dashboard instead of being dropped. A workspace is also alerted: after three failed forwards in a row, and again if a failure is still unresolved after 48 hours, the alert sink receives reply_forward.failed with the destination, alias, streak and last error. The next successful forward clears the alert.

Attachments

Receiving attachments is currently disabled. A reply that carries one is stored with its text, forwarded without the file, and the recipient sees a notice in the forwarded mail. The sender gets one answer explaining that attachments cannot be accepted yet, with a reference id, unless the mail fails authentication; an unauthenticated sender never triggers a notice, so a forged From address cannot make the platform send mail.

The decision is part of the message, not hidden in a log. GET /api/practices/{id}/inbound/messages/{messageID} returns a forward object:

json
{
  "status": "forwarded_without_attachments",
  "attachments": [
    {"filename": "Rechnung.pdf", "content_type": "application/pdf", "size_bytes": 91234,
     "sha256": "...", "forwarded": false, "reason": "attachments_not_supported"}
  ],
  "notified_at": "2026-11-09T08:12:00Z"
}

Stable reasons are attachments_not_supported, attachment_too_large and attachment_type_blocked. status is one of forwarded, forwarded_without_attachments, forwarded_truncated, attachments_rejected (no forwarding configured), content_truncated or failed with an error. Attachment bytes are never stored, only name, type, size and hash.

The receiving path accepts about 150 KB of raw message in the default setup. Because attachments are base64 encoded, the practical attachment size is around 100 KB. A larger mail is rejected by the receiving service at SMTP with Message length exceeds limit set by recipient; it never reaches Werkmail, so no branded notice is sent. The sender still gets a delivery failure from their own mail provider. This is the deliberate limit until raw storage is added: no attachment content is stored, and the branded notice is only promised for messages the platform actually accepted.

For an accepted but truncated message the record carries truncated: true and status: content_truncated or forwarded_truncated. Those values matter for setups that add raw storage later; the forwarded mail carries a visible note and the sender gets the same one-time notice.

Reply matching

When you send from a domain whose inbound route we receive, a reply can be tied back to the exact message it answers. Every received mail keeps its In-Reply-To and References headers, and matching runs in three stages:

  1. exact: the id in In-Reply-To is a message id we sent from this workspace.
  2. reference: one of the ids in References is one of ours.
  3. window: nothing matched, but a message went to the same sender within the last 30 days.

The match is recorded on the received mail as reply_to_message_id and reply_match, and it is shown wherever a message is shown. A matched human reply fires the message.replied webhook. An out-of-office auto-reply is stored but never fires the event, and it never counts as a reply. Replies also appear in the report: replied per recipient and replies per campaign.

Nothing is guessed: with no match the fields stay empty. Matching is always scoped to one workspace, so a message id from another workspace never matches.

Feedback reports (ARF)

Mailbox providers can report a complaint directly to the sender as an abuse report (ARF, RFC 5965). Werkmail reads these reports on the receiving side and treats them exactly like a provider complaint: the reported recipient is suppressed with reason complaint, the message moves to SpamComplaint, and message.spam_complaint fires with the ISP reason in feedback_type (abuse, fraud, not-spam, virus, other). The reason is also stored on the event and shown in the message timeline.

The workspace is resolved by the original Message-ID first and by the reported sending domain second, so a report still lands when the message record is already gone. A report for a domain we do not host is acknowledged and dropped. Reports are machine mail: they are not stored as a customer reply and do not open an abuse ticket.

Abuse mailbox

Reports also land at abuse@werkmail.eu (and the inbound host on the brand). Public form: https://werkmail.eu/abuse. See Compliance.

View this page as Markdown · llms.txt · full corpus