Programmable email for developersRead the docs

The email gateway for your apps.

Send and receive email without ever touching a mail server.

Inbound mail from customers, vendors, and web forms enters mxRaven, where listeners accept it and routing rules decide its outcome: an event for your app, an auto-reply, or a webhook. Mail your app submits leaves through mxRaven to its recipients. Control-plane settings for domains, listeners, routing rules, and suppressions configure the hub.

Don't keep all your hopes on a single API black box. Your app should stay in the driver's seat.

mxRaven is the gateway for your application to the global email infrastructure. Send emails through submission listeners, receive them through MTA listeners, filter and route them using programmable rules and actions, and deliver every event and side-effect to your code. Pull updates and operational insights behind a CGNAT or firewalls, be it on either trusted or untrusted networks.

Because your app should react to mail, not poll for it.

Route, notify and analyze.

  1. envelope.mail_from endsWith "@partner.example"SMTP forwardcontinues
  2. verdicts.is_spamDropstops
  3. any(headers["subject"], # contains "verification")Deliver webhookcontinues
  4. "support@acme.example" in envelope.rcpt_toAuto-replystops

no matchDeliver

Durable · 24h retention
  1. acceptedmsg_9f2c41 · inboundacked
  2. attempts3 · mail/9f2c41.emldelivered
  3. attemptsmtp · customer@example.comdeferred
  4. acceptedmsg_9f2c42 · inboundpending

Your consumer

import { NotificationClient } from "@mxraven/mail/notify";

const client = await NotificationClient.connect({
  url: "wss://notifications.mxraven.com",
  username: process.env.MXRAVEN_KEY_PREFIX!,
  secret: process.env.MXRAVEN_KEY_SECRET!,
  listener: listenerId,
});
await client.consume((event) => {
  if (event.kind === "accepted") save(event.accepted.task_id);
  else track(event.attempt.channel, event.attempt.status);
});
Acknowledged
3
Pending
1
Last 7 days · example data

99.6% delivery success rate

succeeded_tasks / (succeeded + failed + expired)

Delivered
11,764
Failed
41
Expired
3
Suppressed
96

Suppressed messages are reported separately: mxRaven blocks them before delivery.

Delivered per daypeak 1,902

Deferred events per daypeak 52

Build for AI.

Not sure what to build? No problem, we'll go first. We built perch, a complete inbox for agents in a single binary. Check it out on GitHub.

perch
pi~/acme-inbox

Priya's asking about invoice 1042. Reply with the PDF.

Thinking

Bash command="perch mail search -q 'unseen from:priya' --json"
{"uid":42,"seq":1,"mailbox":"INBOX","subject":"Invoice 1042","from":[{"name":"Priya Raman","address":"priya@northwind.example"}],"to":[{"address":"support@acme.example"}],"date":"2026-03-14T09:12:41Z","internal_date":"2026-03-14T09:12:41Z","size":48213,"message_id":"<CAF8x2q0Jd@northwind.example>"}
Bash command="perch mail fetch --uids 42"
From: Priya Raman <priya@northwind.example>
Subject: Invoice 1042
... (48 more lines, ctrl+o to expand)

Invoice 1042 from Northwind. Replying with the PDF attached.

Bash command="perch mail send --to priya@northwind.example --subject 'Re: Invoice 1042' --body 'Attached - thanks for the nudge.' --attach invoices/1042.pdf --in-reply-to '<CAF8x2q0Jd@northwind.example>'"

Sent. mxRaven reports the SMTP attempt as delivered.

$ perch serve --config ~/.config/perch/perch.yaml

time=2026-03-14T09:12:04.118Z level=INFO msg="IMAP listener" addr=127.0.0.1:1143 starttls=false

time=2026-03-14T09:12:04.121Z level=INFO msg="consuming mxRaven notifications" listener=lst_8f21c4 kind=inbound

time=2026-03-14T09:12:41.902Z level=INFO msg="stored inbound message" task=tsk_01JQ8Z2K4M account=support@acme.example mailbox=INBOX bytes=48213 raw_sha256=6f1c0b2e8d94a37c05f1b6de2a7c48d9e3b05f7a1c6d82e94b3f0a7d5c1e8b62 message_id=<CAF8x2q0Jd@northwind.example>

time=2026-03-14T09:13:06.441Z level=INFO msg="submission relayed" account=support@acme.example from=support@acme.example recipients=[priya@northwind.example] message_ref=out_7c31d9 bytes=51204 remote=127.0.0.1:52318

time=2026-03-14T09:13:07.215Z level=INFO msg="mxRaven attempt" channel=smtp status=delivered task=tsk_01JQ8Z4M correlation=cor_5b9e91 object_key="" message_ref=out_7c31d9

A scripted pi session, using perch's real commands and log output.

An agent session against perch. A message from Priya Raman arrives over mxRaven's outbound connection and perch stores it. The agent searches the inbox with perch mail search, fetches the message with perch mail fetch, and replies with the invoice attached using perch mail send. The server log then shows the submission and mxRaven's delivered SMTP attempt.

Integrate now.

I want to

Submission

@mxraven/mail

import { Client, Message } from '@mxraven/mail';

const client = new Client({
	host: 'smtp.mxraven.email',
	username: 'mxr_tx_ab12cd34ef56',
	secret: process.env.MXRAVEN_SECRET!,
});

// DELIVERBY: expire in 10 minutes instead of retrying stale codes for hours.
// REQUIRETLS: refuse any delivery hop that would fall back to cleartext.
const { messageRef } = await client.send(
	new Message()
		.from('Acme <noreply@acme.example>')
		.to('customer@example.com')
		.subject('Your verification code: 428193')
		.text('Your code is 428193. It expires in 10 minutes.'),
	{ deliveryBy: { seconds: 600, mode: 'R' }, requireTls: true },
);

console.log('accepted as', messageRef);
await client.close();

mxraven

import os

from mxraven import Client, DeliveryBy, DeliveryByMode, Message

client = Client(
    host="smtp.mxraven.email",
    username="mxr_tx_ab12cd34ef56",
    secret=os.environ["MXRAVEN_SECRET"],
)

try:
    # DELIVERBY expires the code; REQUIRETLS forbids a cleartext hop.
    result = client.send(
        Message()
        .from_("Acme <noreply@acme.example>")
        .to("customer@example.com")
        .subject("Your verification code: 428193")
        .text("Your code is 428193. It expires in 10 minutes.")
        .deliver_by(DeliveryBy(600, DeliveryByMode.RETURN))
        .require_tls()
    )
    print("accepted as", result.message_ref)
finally:
    client.close()

github.com/synqronlabs/mxraven-go/mail

client, err := mail.New(
	mail.WithAddress("smtp.mxraven.email", mail.DefaultAddressPort),
	mail.WithCredentials("mxr_tx_ab12cd34ef56", os.Getenv("MXRAVEN_SECRET")),
)
if err != nil {
	log.Fatal(err)
}
defer client.Close()

// DELIVERBY expires the code; REQUIRETLS forbids a cleartext hop.
result, err := client.Send(ctx, mail.NewMessage().
	From("Acme <noreply@acme.example>").
	To("customer@example.com").
	Subject("Your verification code: 428193").
	Text("Your code is 428193. It expires in 10 minutes.").
	DeliveryBy(mail.DeliveryBy{Within: 10 * time.Minute, Mode: mail.DeliveryReturn}).
	RequireTLS())
if err != nil {
	log.Fatal(err)
}
log.Printf("accepted as %s", result.MessageRef)

com.mxraven:mail

SmtpConfig config = SmtpConfig.builder()
        .host("smtp.mxraven.email")
        .port(587)
        .startTls()
        .credentials("mxr_tx_ab12cd34ef56", System.getenv("MXRAVEN_SECRET"))
        .build();

Mail mail = MailBuilder.create()
        .from("Acme <noreply@acme.example>")
        .to("customer@example.com")
        .subject("Your verification code: 428193")
        .textBody("Your code is 428193. It expires in 10 minutes.")
        .build();

// DELIVERBY and REQUIRETLS are envelope parameters, so send on this envelope.
Envelope envelope = Envelope.builder()
        .from("noreply@acme.example")
        .to(List.of(Recipient.of("customer@example.com")))
        .deliveryBy(new DeliveryBy(600, DeliveryByMode.RETURN, false))
        .requireTls(true)
        .build();

try (SmtpClient client = SmtpClient.connect(config)) {
    SendResult result = client.sendRaw(envelope, mail.content().toRaw());
    System.out.println("accepted as " + result.messageRef());
}

@mxraven/mail/notify

import { NotificationClient } from '@mxraven/mail/notify';

const client = await NotificationClient.connect({
	url: 'wss://notifications.mxraven.com',
	username: 'mxr_tx_ab12cd34ef56',
	secret: process.env.MXRAVEN_SECRET!,
	listener: listenerId,
});

// Returning acknowledges the event; throwing leaves it for redelivery.
await client.consume((event) => {
	if (event.kind === 'accepted') {
		queue.push(event.accepted.task_id);
	} else {
		record(event.attempt.correlationId, event.attempt.status);
	}
});

mxraven[notify]

import os

from mxraven.notify import NotificationClient, NotificationKind

with NotificationClient.connect(
    url="wss://notifications.mxraven.com",
    username="mxr_tx_ab12cd34ef56",
    secret=os.environ["MXRAVEN_SECRET"],
    listener=listener_id,
) as client:
    for delivery in client.events():
        event = delivery.event
        if event.kind is NotificationKind.ACCEPTED:
            queue.push(event.accepted.task_id)
        else:
            record(event.attempt.correlation_id, event.attempt.status)
        delivery.ack()

github.com/synqronlabs/mxraven-go/mail/notify

client, err := notify.New(
	notify.WithURL("wss://notifications.mxraven.com"),
	notify.WithCredentials("mxr_tx_ab12cd34ef56", os.Getenv("MXRAVEN_SECRET")),
	notify.WithListener(listenerID),
)
if err != nil {
	log.Fatal(err)
}
defer client.Close()

// Returning an error leaves the event unacknowledged for redelivery.
err = client.Consume(ctx, func(ctx context.Context, event notify.Event) error {
	if event.Accepted != nil {
		queue.Push(event.Accepted.TaskID)
	} else if event.Attempt != nil {
		record(event.Attempt.CorrelationID, event.Attempt.Status)
	}
	return nil
})

com.mxraven:mail

NotificationClient client = NotificationClient.connect(
        NotificationClientOptions.builder()
                .username("mxr_tx_ab12cd34ef56")
                .secret(System.getenv("MXRAVEN_SECRET"))
                .listener(listenerId)
                .build());

client.consume(event -> {
    if (event instanceof AcceptedNotification accepted) {
        queue.push(accepted.taskId());
    } else if (event instanceof AttemptNotification attempt) {
        record(attempt.correlationId(), attempt.status());
    }
    return HandlerResult.CONTINUE;   // STOP, or throw to leave it for redelivery
});

@mxraven/mail/webhook

import { WebhookHandler, eventType } from '@mxraven/mail/webhook';

const webhook = new WebhookHandler({
	secret: process.env.MXRAVEN_WEBHOOK_SECRET!,
});

webhook.on(eventType.inboundEmail, async (email) => {
	// Every header, plus a short-lived raw_email reference.
	await tickets.create({
		task: email.task_id,
		subject: email.message.subject,
	});
});

// Workers, Bun, Deno, Next.js, Hono: hand over the Fetch request.
export default { fetch: (request: Request) => webhook.handle(request) };

mxraven.webhook

import os

from mxraven.webhook import Verifier, event_type

verifier = Verifier(secret=os.environ["MXRAVEN_WEBHOOK_SECRET"])


def handle(request):
    # Verify against the raw body and the public URL the sender called.
    event = verifier.verify_and_decode(request)
    if event.type is event_type.inbound_email:
        email = event.inbound_email
        tickets.create(task=email.task_id, subject=email.message.subject)
    return 204

github.com/synqronlabs/mxraven-go/mail/webhook

verifier, err := webhook.NewVerifier(
	webhook.WithSecret(os.Getenv("MXRAVEN_WEBHOOK_SECRET")),
)
if err != nil {
	log.Fatal(err)
}

http.HandleFunc("/mxraven/webhook", func(w http.ResponseWriter, r *http.Request) {
	event, err := verifier.VerifyAndDecode(r)
	if err != nil {
		http.Error(w, "invalid webhook", http.StatusUnauthorized)
		return
	}
	if email := event.InboundEmail; email != nil {
		tickets.Create(r.Context(), email.TaskID, email.Message.Subject)
	}
	w.WriteHeader(http.StatusNoContent)
})

com.mxraven:mail

WebhookVerifier verifier = WebhookVerifier.builder()
        .secret(System.getenv("MXRAVEN_WEBHOOK_SECRET"))
        .build();

WebhookHandler handler = WebhookHandler.builder()
        .verifier(verifier)
        .listener(event -> tickets.create(event))  // or typed WebhookCallbacks
        .build();

// Inside your framework: pass the raw body bytes and the signed request target.
WebhookResult result = handler.handle(method, requestUri, headers, rawBody);
response.setStatus(result.status());   // 204 accepted, 401 bad signature
Spam/ham learning

@mxraven/mail/feedback

import { Client } from '@mxraven/mail/feedback';

const secret = process.env.MXRAVEN_SECRET;
if (secret === undefined || secret === '') {
	throw new Error('MXRAVEN_SECRET is required');
}

const feedback = new Client({
	baseUrl: 'https://api.mxraven.com',
	username: 'mxr_tx_ab12cd34ef56',
	secret,
});

// The exact raw RFC 822 bytes mxRaven processed, matched by SHA-256.
await feedback.learnSpam(spamBytes);

const learned = await feedback.learnHam(falsePositiveBytes);
console.log('learned as', learned.disposition, 'matched', learned.matchedHashKind);

mxraven.feedback

import os

from mxraven.feedback import Client

feedback = Client(
    base_url="https://api.mxraven.com",
    username="mxr_tx_ab12cd34ef56",
    secret=os.environ["MXRAVEN_SECRET"],
)

# The exact raw RFC 822 bytes mxRaven processed, matched by SHA-256.
feedback.learn_spam(spam_bytes)

learned = feedback.learn_ham(false_positive_bytes)
print("learned as", learned.disposition, "matched", learned.matched_hash_kind)

github.com/synqronlabs/mxraven-go/mail/feedback

client, err := feedback.New(
	feedback.WithBaseURL("https://api.mxraven.com"),
	feedback.WithCredentials("mxr_tx_ab12cd34ef56", os.Getenv("MXRAVEN_SECRET")),
)
if err != nil {
	log.Fatal(err)
}

// The exact raw RFC 822 bytes mxRaven processed, matched by SHA-256.
if _, err := client.LearnSpam(ctx, bytes.NewReader(spamBytes)); err != nil {
	log.Fatal(err)
}
learned, err := client.LearnHam(ctx, bytes.NewReader(falsePositiveBytes))
if err != nil {
	log.Fatal(err)
}
log.Printf("learned as %s (matched %s)", learned.Disposition, learned.MatchedHashKind)

com.mxraven:mail

FeedbackClient feedback = FeedbackClient.builder()
        .baseUrl("https://api.mxraven.com")
        .credentials("mxr_tx_ab12cd34ef56", System.getenv("MXRAVEN_SECRET"))
        .build();

// The exact raw RFC 822 bytes mxRaven processed, matched by SHA-256.
feedback.learnSpam(spamBytes);
LearningResult learned = feedback.learnHam(falsePositiveBytes);

System.out.println("learned as " + learned.disposition()
        + " (matched " + learned.matchedHashKind() + ")");
Routing rule

@mxraven/admin

import { AdminClient, routingRuleAction } from '@mxraven/admin';

const admin = new AdminClient({
	baseUrl: 'https://api.mxraven.com',
	token: process.env.MXRAVEN_API_TOKEN!,
});

const listener = await admin
	.workspace('acme-prod')
	.listeners()
	.get(mtaListenerId);

await listener.routingRules().create({
	priority: 10,
	expressionText:
		'envelope.rcpt_to[0] == "invoices@acme.com" && authentication.dmarc.status == "pass" && !verdicts.has_malware',
	action: routingRuleAction.deliverWebhook('erp-ingest-webhook'),
});

github.com/synqronlabs/mxraven-go/admin

ws := client.Workspace("acme-prod")
rule, err := ws.RoutingRules.Create(ctx, mtaListenerID, admin.CreateRoutingRuleRequest{
	Priority:       10,
	ExpressionText: `envelope.rcpt_to[0] == "invoices@acme.com" && authentication.dmarc.status == "pass" && !verdicts.has_malware`,
	Action: api.NewDeliverWebhookActionRoutingRuleAction(api.DeliverWebhookAction{
		ActionType:    admin.DeliverWebhookActionActionTypeDELIVERWEBHOOK,
		ActionPayload: api.WebhookActionPayload{WebhookRef: "erp-ingest-webhook"},
	}),
})
if err != nil {
	log.Fatal(err)
}
log.Printf("created rule %s", rule.ID)

com.mxraven:admin

AdminClient admin = new AdminClient("https://api.mxraven.com", token);
Listener listener = admin.workspace("acme-prod").listeners().get(mtaListenerId);

RoutingRule rule = listener.routingRules().create(rule -> rule
        .priority(10)
        .expressionText("envelope.rcpt_to[0] == \"invoices@acme.com\""
                + " && authentication.dmarc.status == \"pass\""
                + " && !verdicts.has_malware")
        .action(RoutingRuleAction.deliverWebhook("erp-ingest-webhook")));
Limits and analytics

@mxraven/admin

const ws = admin.workspace('acme-prod');

// Overrides must stay stricter than the limits they replace.
await ws.mtaRateLimits().put({
	messageRatePerMinute: 600,
	recipientRatePerMinute: 1_200,
	taskRatePerMinute: 600,
	burst: 50,
	maxConcurrency: 8,
});

const report = await ws.mailAnalytics().overview({
	startAt: '2026-09-01T00:00:00Z',
	endAt: '2026-09-02T00:00:00Z',
});

console.log(report.summary.egressTasks, report.summary.terminalOutcomes.failed);

github.com/synqronlabs/mxraven-go/admin

ws := client.Workspace("acme-prod")

// Overrides must stay stricter than the limits they replace.
if _, err := ws.MTARateLimits.PutOverride(ctx, admin.MTARateLimitPolicy{
	MessageRatePerMinute:   600,
	RecipientRatePerMinute: 1200,
	TaskRatePerMinute:      600,
	Burst:                  50,
	MaxConcurrency:         8,
}); err != nil {
	log.Fatal(err)
}

overview, err := ws.MailAnalytics.GetOverview(ctx, admin.GetMailAnalyticsOverviewQuery{
	StartAt: time.Date(2026, 9, 1, 0, 0, 0, 0, time.UTC),
	EndAt:   time.Date(2026, 9, 2, 0, 0, 0, 0, time.UTC),
})
if err != nil {
	log.Fatal(err)
}
log.Printf("%d egress tasks, %d failed", overview.Summary.EgressTasks, overview.Summary.TerminalOutcomes.Failed)

com.mxraven:admin

Workspace ws = admin.workspace("acme-prod");

// Overrides must stay stricter than the limits they replace.
ws.mtaRateLimits().put(new MTARateLimitPolicy(600, 1_200, 600, 50, 8));

MailAnalyticsOverview report = ws.mailAnalytics().getMailAnalyticsOverview(
        "2026-09-01T00:00:00Z",
        "2026-09-02T00:00:00Z");

System.out.println(report.summary().egressTasks()
        + " egress tasks, "
        + report.summary().terminalOutcomes().failed()
        + " failed");

Browse the SDK guides

Pick your altitude.

Set your monthly volume. The cheapest plan that carries it is picked for you, with any overage shown on top of its base price.

10,000
1,0002,000,000
5,000
1,0001,000,000
5,000
1,0001,000,000
3
1100

Curious about something?

Can I send marketing mail?Yes, by listener class

Yes. You send transactional or marketing mail through a listener after declaring its class at creation. mxRaven does not manage your subscription lists or campaign schedules, so build or bring your own marketing software, such as listmonk, and configure an mxRaven listener as its smarthost for final delivery. A listener's stream is fixed at creation, so set the marketing listener up next to the transactional one from the start. One-click unsubscribe (RFC 8058) and the suppression list come with the stream; unsolicited bulk mail and abuse can pause outbound sending or suspend the account, as our terms say.

Streams and listeners
Why not just SES or Resend?We own receive, filter, route

Those primarily sell the sending hop. mxRaven owns both directions on one governed path: mail for your domain lands on a listener, is scanned by Rspamd, matched against your routing rules, and leaves as a webhook, a forward, an auto-reply, or an outbound send. The client notification stream publishes one event when a listener accepts a message and another when a delivery channel completes an attempt, and your workers pull them over WebSocket and acknowledge each one. Transport is raven's modern SMTP extension set rather than the 1982 baseline, and nothing is kept: spooled message files are deleted at 48 hours, and message bodies are not retained beyond that.

Routing rules and outbound actions
Is mxRaven open source?No, raven is

No, the platform is not open source, though we might consider a source-available license some time in the future. Meanwhile raven, the core SMTP toolkit and Go library mxRaven uses for authentication and transport, is open source, and so are the official SDKs.

synqronlabs on GitHub
Will it cost a lot?Free, then $5 a month

The free plan covers 1,000 outbound and 1,000 inbound tasks a month, one domain, and one user, with no card. Past an allowance, mail is $0.01 per 100 messages in either direction, the rate SES charges for sending. Dedicated IPs are $10 each per month, and the estimator above picks the cheapest plan for your volume.

Full pricing
Does it use an upstream relay?No, our own IP pools

No. Unlike some of our competitors, we do not rely on a third-party delivery or transport provider such as SES. Our core transport library is open source, and mxRaven maintains its own shared IP pools and IP warmup algorithms for efficient, high-performance delivery and abuse prevention. If you want an upstream anyway, a smarthost relay sends through a provider you configure.

IP pools and delivery

Not in the list?Read the docs Ask us