← Back to all posts
2026-09-04 · MailAnvil Team

Inside a Reliable Email Pipeline: Queues, Retries, and Why "Accepted" Isn't "Delivered"

The most dangerous line in an email integration is the one that treats an HTTP 202 as the end of the story. Your API returned 202 Accepted — the email is queued, not delivered. What happens between that response and the inbox is where every reliable transactional email system lives or dies.

The moment after 202

When a booking confirmation leaves your app, it does not fly straight to the recipient. A well-built email API does four things before it ever talks to a mail server:

  1. Validate and enqueue — the send endpoint returns 202 immediately and drops the message into a queue. This is deliberate: your API request should never block on SMTP round-trips.
  2. Claim, don't race — a consumer worker claims the job with an atomic UPDATE ... WHERE status='queued'. If zero rows update, another worker already got it. This is how you guarantee at-most-once delivery — no duplicate booking emails because two workers grabbed the same job.
  3. Classify failures — a throttling error (429, 5xx) is retried with backoff. A permanent rejection (bad address, 4xx from the provider) is not retried — it goes straight to a dead-letter queue. Retrying a permanently bad address is how you burn your sender reputation.
  4. Report honestlyqueued → sent → delivered / bounced / complained per recipient, pushed to you via webhook.

That last step matters more than most teams think. "Sent" only means SES (or your provider) accepted it. Only the delivery/bounce webhook tells you the truth.

Why Indonesia makes this harder

Transactional email in Indonesia fails for three predictable reasons, and each maps to a pipeline decision:

The queue is the product

When you evaluate an email API, don't ask "does it send mail." Ask what happens between enqueue and deliver:

A flat, synchronous "send email" endpoint is fine at 500 emails a month. It collapses at 100,000 — which is exactly where most Indonesian startups are headed.

Pricing that doesn't punish scale

Pipeline reliability is table stakes. The other half is cost. International providers meter in USD — at 100,000 emails you're paying roughly $40 (≈ Rp 640rb) a month with Resend or SendGrid, and the FX conversion swings with the dollar. MailAnvil prices flat in Rupiah: Growth tier is Rp 599rb for 100,000 emails, and you pay with QRIS or GoPay — no card, no FX spread.

Built on AWS SES and Cloudflare Workers at the edge, MailAnvil gives you the queue, the classified retries, the per-recipient webhooks, and the IDR pricing in one API — plus Bahasa documentation and Bahasa support.

Try MailAnvil free at mailanvil.com.