I Stopped Trusting Staging Emails — and Built a Cheap, Realistic Email Deliverability Lab

A practical, low-cost way to test real inbox behaviour in India: local inboxes, a small VPS with proper SPF/DKIM, and realistic seeds to improve email deliverability.

Written by: Rohan Deshpande

Developer typing on a laptop showing terminal windows, a coffee cup beside the keyboard.
Image credit: Pexels

We all know the feeling: you push a change to transactional email templates, QA says everything looks fine, but users complain that OTPs and receipts are landing in spam. That happened to me after a release where the staging system used MailHog and assumed “works on staging = works in production.” Spoiler: it doesn’t. Staging catches SMTP handshakes, not real ISP heuristics.

So I built a small, pragmatic lab to test real inbox behaviour without paying for enterprise tools. My position is simple: use local tools for fast iteration, but add one realistic external hop (a VPS with correct DNS and signing) to catch the things staging misses. This hybrid approach caught deliverability regressions faster and reduced post-deploy firefights. Below is how I did it and what you should expect.

Why staging-only testing lies to you

The setup I recommend (cheap, reproducible)

  1. Fast local loop for everyday work

    • Keep MailHog or smtp4dev in Docker for rendering and template checks. This is your “fast feedback” layer.
    • Hook your app environments (dev, feature branches) to this by default so designers and QA can iterate without sending real email.
  2. A small “real” sending environment

    • Spin up a small VPS (you can find providers with India-region or Singapore nodes for ~₹200–₹600/month). I used a ₹350/month VPS to mirror latency and routing typical for our user base.
    • Install Postfix (or Exim) as your SMTP relay and configure OpenDKIM for signing. Set SPF, DKIM, and DMARC records in DNS. Use the VPS provider’s console to set the reverse PTR record to match your mail hostname.
    • Send through this VPS from a staging environment as your “pre-production” sender. This is the environment that talks to real inboxes.
  3. Seed list and monitoring

    • Maintain a seed list of real accounts: Gmail, Outlook, Yahoo, major Indian corporate email providers, and a few popular ISP mailboxes. Keep at least one test account per major provider.
    • Use Mail-Tester and Gmail/Postmaster tools for single-message checks and reputation metrics.
    • Check message headers (X- headers, Received chains), spam scores, and landing location (Primary/Promotions/Spam).

Why this catches real problems

Practical steps and commands (high level)

Tradeoffs and real constraints

What I stopped doing (and why)

India-specific notes

Final takeaway Email deliverability is messy and empirical. Fast local tools are indispensable, but they will not reveal ISP-level rejections, spam-folder problems, or reputation issues. A cheap, properly-configured external sender combined with seeded inbox checks teaches you far more than mailhog + wishful thinking. Yes, setting this up takes time and a bit of maintenance, and no setup is a silver bullet—but for the number of support tickets we avoided after switching to this workflow, it paid for itself within two sprints.

If you want, I can share the minimal Docker Compose + Postfix/OpenDKIM config I used so you can fork it and get a lab running in a few hours.