Email Webhooks

Turn inbound email into signed webhooks.

AliasFleet email webhooks convert incoming messages for your aliases into real-time HTTPS POST requests. Every custom webhook delivery is signed with HMAC-SHA256, checked against replay windows, and filtered for private network SSRF targets before leaving the mail pipeline.

HMAC-SHA256 signed headers
JSON, Slack, Discord, and raw MIME
300-second replay protection

Built for reliable inbound automation

Route specific aliases or conditional rule matches directly to your backend workers, alert channels, or ticket queues without polling IMAP.

Five payload formats

Send parsed_json, metadata_only, Slack, Discord, or full RFC 5322 raw_mime (Business) payloads per endpoint.

Cryptographic signature verification

Validate requests with X-AliasFleet-Signature timestamps, v1 HMAC-SHA256 digests, and af_whsec_ rotating secrets.

Egress SSRF filtering

Every outbound webhook destination is checked before connection to reject RFC 1918 private subnets and cloud metadata IPs.

Delivery logs and test pings

Inspect HTTP status codes, response latency, and whd_ delivery IDs, or trigger /v1/webhooks/test during integration.

Verify webhook signatures in Node.js

Compute HMAC-SHA256 over the timestamp and raw unparsed request body, enforce the 300-second replay tolerance window, and compare digests in constant time.

app/api/webhook/route.tsNext.js Route Handler
import { NextResponse } from 'next/server';
import crypto from 'node:crypto';

export async function POST(req: Request) {
  const sig = req.headers.get('x-aliasfleet-signature');
  const secret = process.env.ALIASFLEET_WEBHOOK_SECRET;
  if (!sig || !secret) {
    return NextResponse.json({ error: 'Unauthorized' }, { status: 401 });
  }

  const rawBody = await req.text();
  const parts = Object.fromEntries(sig.split(',').map((kv) => kv.trim().split('=')));
  const timestamp = Number.parseInt(parts.t ?? '', 10);
  const receivedSig = parts.v1 ?? '';

  if (!timestamp || Math.abs(Math.floor(Date.now() / 1000) - timestamp) > 300) {
    return NextResponse.json({ error: 'Expired signature' }, { status: 401 });
  }

  const expected = crypto
    .createHmac('sha256', secret)
    .update(`${timestamp}.${rawBody}`)
    .digest('hex');

  const valid =
    receivedSig.length === expected.length &&
    crypto.timingSafeEqual(Buffer.from(receivedSig, 'hex'), Buffer.from(expected, 'hex'));

  if (!valid) {
    return NextResponse.json({ error: 'Invalid signature' }, { status: 401 });
  }

  return NextResponse.json({ received: true });
}
POST /your-webhook-endpointWebhook Headers
Content-Type: application/json
X-AliasFleet-Event: email.received
X-AliasFleet-Delivery: whd_9z8y7x6w5v4u3t2s
X-AliasFleet-Signature: t=1787652000,v1=9f83a21b4c7d0e9a8b7c6d5e4f3a...

Email webhook limits by plan

Start with standard alias forwarding on Free, add HTTP and chat webhooks on Pro, or unlock raw MIME streaming and unlimited endpoints on Business.

CapabilityFreeProBusiness
Active webhook endpoints02 endpointsUnlimited
Supported payload formatsNot includedparsed_json, metadata_only, slack, discordAll 4 + raw_mime (RFC 5322)
Delivery log retentionNot included7 days30 days + CSV/JSON export
HMAC-SHA256 signing and secret rotationNot includedIncludedIncluded
Routing rule trigger (send_to_webhook)Not includedUp to 20 rulesUnlimited rules

Related email automation guides

Pair inbound webhooks with conditional routing filters or manage endpoints over the REST API.

Webhooks API reference

Endpoint schemas, delivery retries, Slack/Discord formats, and verification examples.

Explore

Email filtering and routing rules

Trigger webhooks selectively based on sender domain, subject, regex, or attachments.

Explore

Email Alias REST API

Manage webhook endpoints, aliases, and custom domains programmatically.

Explore

Email webhook questions

How AliasFleet delivers, signs, and scopes inbound email webhook requests.

When an email matches an alias or routing rule configured with a webhook endpoint, the AliasFleet Engine serializes the message into your chosen payload format, signs the body with HMAC-SHA256, and sends an HTTPS POST request to your endpoint in real time.