Fastmail to Webhook

Forward every Fastmail email to your endpoint as structured JSON — headers, body, and attachments included. No polling, no MIME parsing, no infrastructure to maintain.

Table of Contents
  1. Why Route Fastmail Emails to a Webhook?
  2. How to Forward Fastmail to JsonHook
  3. Fastmail vs Fastmail JMAP API
  4. JSON Payload Example
  5. Common Fastmail to Webhook Use Cases

Why Route Fastmail Emails to a Webhook?

Fastmail is an independent, privacy-focused email provider popular among developers and professionals who value speed, reliability, and clean interfaces. While Fastmail is a capable email platform, its native tooling for programmatic automation was not built for developers who need structured, reliable data delivery to backend systems.

The native approach — Fastmail JMAP API — introduces significant operational overhead. You need to manage credentials, poll or maintain persistent connections, and write custom parsing logic for every message field you care about. When your team is moving fast, that friction adds up to hours of maintenance per integration.

JsonHook eliminates that overhead by accepting inbound mail on your behalf and immediately firing a structured JSON payload to any HTTPS endpoint you specify. The email is parsed, attachments are base64-encoded, and headers are normalised — so your webhook handler can focus entirely on business logic rather than MIME parsing.

Below are the core benefits of routing your Fastmail messages through JsonHook instead of relying on the native alternative:

  • Limitation avoided: Fastmail's JMAP API is excellent for building email clients, but setting up a JMAP push subscription for inbound message events requires persistent EventSource connections and custom event parsing.
  • Limitation avoided: JMAP push subscriptions close after 30 minutes of inactivity and must be re-established, creating reconnection logic overhead.
  • Limitation avoided: Fastmail does not provide a webhook-based notification system natively; all real-time integrations must go through JMAP's push mechanism.
  • Zero-polling architecture: JsonHook pushes to your endpoint the moment mail arrives — no long-running background jobs needed.
  • Automatic attachment handling: PDFs, images, and other file types are extracted, base64-encoded, and included in the JSON payload with their original MIME type.
  • Retry with exponential back-off: If your endpoint is temporarily unavailable, JsonHook retries automatically — something the Fastmail JMAP API does not do natively.
  • Webhook signatures for security: Every delivery includes an HMAC-SHA256 signature header so you can verify the payload originated from JsonHook.

Whether you are building a support-ticket ingestion pipeline, a lead-capture workflow, or an automated document processor, JsonHook gives you a consistent, typed interface to Fastmail messages without the fragility of raw SMTP or polling-based API integrations.

How to Forward Fastmail to JsonHook

Getting Fastmail emails delivered to your webhook takes about five minutes. The process has two parts: creating a JsonHook address via the API, and configuring Fastmail to forward a copy of each incoming message to that address.

  1. Log in to Fastmail and go to Settings › Filters & rules.
  2. Click Create rule and set your matching conditions (e.g. all incoming mail, or messages from a specific sender or with a specific subject prefix).
  3. Set the action to Forward to and enter your JsonHook inbound address.
  4. Save the rule. Fastmail applies rules before delivering to your inbox, so the forward fires as soon as each matching message arrives.

Once forwarding is active, every email that arrives in your Fastmail inbox (or matches your filter) will be relayed to your JsonHook address, parsed, and delivered to your endpoint as a JSON payload within seconds.

You can create your JsonHook inbound address with a single curl command. Replace YOUR_API_KEY with the key from your dashboard and set webhookUrl to your endpoint:

curl -X POST https://jsonhook.com/api/addresses \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "label": "Fastmail inbound",
    "webhookUrl": "https://your-app.example.com/webhooks/email",
    "secret": "a-random-signing-secret"
  }'

The response includes your unique @in.jsonhook.com address. Copy that address and paste it into the forwarding field in your Fastmail settings. That is all the infrastructure you need to stand up.

Start Receiving Fastmail Webhooks in 5 Minutes

Free tier: 100 emails/month, 1 address. No credit card required.

Get Free API Key

Fastmail vs Fastmail JMAP API

When developers first explore email-to-webhook automation they typically discover Fastmail JMAP API — the official programmatic route provided by Fastmail Pty Ltd. The table below shows how it compares to using JsonHook as an intermediary.

Feature Fastmail Native (Fastmail JMAP API) JsonHook
Structured JSON payload
Attachment parsing
Retry logic
Webhook signatures
Setup time Hours to days Under 5 minutes

The native approach through Fastmail JMAP API requires you to set up OAuth credentials or API keys, maintain a long-running listener or polling job, write your own MIME parser, and implement your own retry queue. Any one of those steps can become a reliability bottleneck in production.

JsonHook handles all of that infrastructure on your behalf. You get a single HTTPS webhook call with a predictable JSON schema every time a Fastmail email arrives — no polling, no credential rotation, no MIME parsing, and no bespoke retry code to maintain.

JSON Payload Example

When a Fastmail email is forwarded to your JsonHook address and delivered to your endpoint, the request body looks like the following. All fields are consistently present; optional fields such as htmlBody and attachments are included when the source message contains them.

{
  "id": "msg_01j8xkr4p2vn3q7w",
  "receivedAt": "2026-03-15T14:32:07.412Z",
  "from": {
    "name": "Alice Smith",
    "address": "[email protected]"
  },
  "to": [
    {
      "name": "",
      "address": "[email protected]"
    }
  ],
  "subject": "Your Fastmail message subject here",
  "textBody": "Plain-text content of the email body.",
  "htmlBody": "<div>HTML version of the email body.</div>",
  "headers": {
    "message-id": "<[email protected]>",
    "x-mailer": "Fastmail Pty Ltd",
    "mime-version": "1.0"
  },
  "attachments": [
    {
      "filename": "document.pdf",
      "contentType": "application/pdf",
      "size": 84234,
      "content": "JVBERi0xLjQK..."
    }
  ],
  "spf": "pass",
  "dkim": "pass"
}

The id field is a unique, stable identifier you can use for idempotent processing. The spf and dkim fields reflect the authentication results JsonHook observed when receiving the message, which you can use to enforce additional trust policies in your handler.

Attachment content is standard base64. Decode it with a single call in any language — Buffer.from(att.content, 'base64') in Node.js, base64.b64decode(att.content) in Python, and so on.

Rust handler for Fastmail messages forwarded through JsonHook:

use axum::{extract::State, http::{HeaderMap, StatusCode}, routing::post, Json, Router};
use hmac::{Hmac, Mac};
use sha2::Sha256;
use serde_json::Value;

async fn handle_email(
    headers: HeaderMap,
    State(secret): State,
    body: axum::body::Bytes,
) -> StatusCode {
    let sig = headers.get("x-jsonhook-signature")
        .and_then(|v| v.to_str().ok()).unwrap_or("");
    let mut mac = Hmac::::new_from_slice(secret.as_bytes()).unwrap();
    mac.update(&body);
    let expected = hex::encode(mac.finalize().into_bytes());
    if sig != expected { return StatusCode::UNAUTHORIZED; }

    let msg: Value = serde_json::from_slice(&body).unwrap_or_default();
    println!("Fastmail: {} → {}", msg["from"]["address"], msg["subject"]);
    StatusCode::OK
}

Common Fastmail to Webhook Use Cases

Fastmail is a popular choice among developers, privacy-conscious professionals, and small teams that want a reliable, well-engineered email service without the complexity of self-hosting. Its forwarding rules are clean and reliable, making it a low-friction source for JsonHook webhook integrations.

  • Developer notification aggregation: Developers who receive build alerts, error reports, and monitoring notifications at a Fastmail address can forward all of them to a single webhook endpoint that consolidates alerts into one dashboard or chat channel.
  • Newsletter digest processing: Fastmail's rules engine makes it easy to tag and forward newsletter emails. Route those to a webhook that extracts article links and stores them in a read-later service or a personal knowledge base.
  • Client communication logging: Freelancers and small agencies that communicate with clients via Fastmail can forward project-related emails to a webhook that appends each message to the relevant project record in their project management tool.
  • Personal automation pipelines: Power users can set up fine-grained forwarding rules in Fastmail based on sender, subject, or label, routing specific categories of email to different webhook endpoints for fully custom automation.

Frequently Asked Questions

Can I forward Fastmail emails to a webhook?
Yes. Fastmail supports email forwarding rules that let you relay a copy of any incoming message to an external address. By forwarding to your JsonHook @in.jsonhook.com address, those messages are immediately parsed and delivered as a JSON POST to your webhook endpoint — no polling required.
Does JsonHook parse Fastmail attachments?
Yes. Every attachment in a forwarded Fastmail message is extracted from the MIME envelope, base64-encoded, and included in the attachments array of the JSON payload. Each entry contains the original filename, MIME content type, file size in bytes, and the base64-encoded content string. You can decode it with a single line in any language.
How fast does Fastmail forwarding work?
End-to-end delivery is near real-time. Once Fastmail forwards the message to your JsonHook inbound address, JsonHook parses and dispatches the webhook within a few seconds. The main variable is how quickly Fastmail itself applies your forwarding rule after a message arrives — this is typically instantaneous for filters and a few seconds for rule-based forwarding.
Does Fastmail's forwarding preserve the original sender address?
Yes. Fastmail forwards emails with the original From header intact (or in a Reply-To header, depending on configuration). When the message arrives at your JsonHook address, the from.address field in the JSON payload reflects the actual sender, not Fastmail's infrastructure address.