ColdMailer: cold outreach at a human pace

A self-hosted platform that sends campaigns from your own mailboxes, spaces every email like a person would, warms up new mailboxes and catches replies within seconds. A personal project I designed, built and deployed end to end.

Type
Self-hosted SaaS · multi-tenant
Role
Personal project · full-stack
Status
In production since Oct 2026
App
Next.js 16 · React 19 · TypeScript
Data
PostgreSQL 17 · Drizzle ORM · 14 tables
Mail
nodemailer · imapflow · mailparser
Infrastructure
Docker Compose · Caddy · cron runner
Security
JWT · scrypt · AES-256-GCM · HMAC
Extras
PWA · Web Push · REST API
(01)

How it's built

One Next.js app does everything: UI, REST API, background jobs and IMAP watchers, with a single PostgreSQL database. A tiny cron runner drives sending and inbox checks, and there's no Redis.

ColdMailer architecture: one Next.js 16 app (UI, REST API, background jobs and IMAP IDLE watchers) with a PostgreSQL database and a small cron runner, deployed with Docker Compose behind Caddy. It sends through the user's own mailboxes over SMTP, reads replies over IMAP, and records opens, clicks and unsubscribes.Docker Compose · one small VM · Caddy HTTPSSMTP · human-pacedIMAP IDLE · replies & bouncesTracking · unsubscribeBrowser · PWADashboardReply push alertsNext.js 16 appUI · REST API · actionsproxy.ts JWT authIMAP IDLE watchersTracking & unsubscribeCron runnersend: 1 min · inbox: 5 minPostgreSQL 17Drizzle · job lock rowMailboxesSMTP sendIMAP readAny providerRecipientsOpens · clicksUnsubscribesColdMailer architecture: one Next.js 16 app (UI, REST API, background jobs and IMAP IDLE watchers) with a PostgreSQL database and a small cron runner, deployed with Docker Compose behind Caddy. It sends through the user's own mailboxes over SMTP, reads replies over IMAP, and records opens, clicks and unsubscribes.Docker Compose · CaddyBrowser · PWANext.js 16 appUI · REST API · actionsIMAP IDLE watchersTracking & unsubscribeCron1 min · 5 minPostgreSQLDrizzle ORMMailboxesSMTP send · IMAP readRecipientsOpens · clicks · unsubscribes
(02)

By the numbers

200k

Recipients per campaign

Measured CSV import time, parsed in a background worker and uploaded in parts.

~3s

To pick up a reply

IMAP IDLE per mailbox, with a 5-minute check kept as the safety net.

54

End-to-end warm-up checks

54/54

All passing, three runs in a row, against a local mail test kit.

~200MB

RAM for the whole stack

App, cron, database and HTTPS proxy together on one small VM.

(03)

The warm-up engine

New mailboxes have no sending history, so providers treat them with suspicion. ColdMailer builds that history: a pool of the user's own mailboxes email each other, starting at 2 emails on day 1 and adding 2 a day up to 30 a day.

About 35% of warm-up emails get a natural reply 15 minutes to 3 hours later, in the same thread. Anything that lands in spam is moved back to the inbox, and placement becomes an inbox score.

The messages come from about 20 workplace scenarios with varied wording, so almost every body is unique. Warm-up mail never touches campaign stats or the do-not-send list, but it does share each mailbox's daily limit.

Warm-up emails per mailbox per dayCap reached (editable)

(04)

What it does

  1. Multi-mailbox campaigns

    Paste, upload a CSV of up to 200k rows (parsed in a background worker) or import a Google Sheet, with merge fields and fallbacks.

  2. Human-paced sending

    Send window ÷ daily limit, ±15% jitter, a 2-minute minimum gap and rolling 24-hour limits per mailbox.

  3. Sticky senders & threads

    A recipient always hears from the same mailbox, and follow-ups reply in the same thread.

  4. Reply & bounce detection

    IMAP IDLE picks up replies in about 3 seconds; bounces are classified and auto-replies flagged, without marking mail as read.

  5. Two email styles

    "Personal" plain text with no tracking, or "Newsletter" HTML with one-click unsubscribe and optional open and click tracking.

  6. Tracking without noise

    HMAC-signed tokens, with scanners, Apple Mail Privacy Protection and too-fast clicks filtered out.

  7. Unsubscribe & suppression

    One-click unsubscribe, "stop" and "remove me" replies detected, and hard bounces suppressed automatically.

  8. Workspaces & super admin

    Open sign-up with approval, every table scoped to its owner, and accounts that can be disabled or deleted.

  9. PWA, push & API

    An installable app with push alerts on every reply, plus a JWT-secured REST API for campaigns, replies and senders.

(05)

Engineering highlights

  • No queue infrastructure. Jobs are secret-protected HTTP routes driven by a tiny cron runner. A self-expiring PostgreSQL lock row prevents overlap, and the send job works inside a 45-second budget each minute, warm-up first.
  • Retries that never double-send. Up to 3 attempts, after 5, 15 and 45 minutes. Emails stuck in "sending" after a crash are flagged for review rather than sent again blindly.
  • Near-instant replies. An IMAP IDLE connection per active mailbox starts at server boot, with a reconcile loop, exponential backoff and a short debounce. The 5-minute check stays as the safety net and also covers spam folders.
  • Secure by default. An allowlist of public routes, separate JWT audiences for the web app and the API, AES-256-GCM-encrypted mailbox credentials, scrypt passwords and HMAC-signed tracking links. A 69-request cross-account sweep found no data leaks between workspaces.
  • Zero-touch deploys. One docker compose up backs up the database, generates and applies migrations, then starts the app behind Caddy with automatic HTTPS.
  • Testable without real inboxes. A local kit with embedded PostgreSQL, an SMTP sink and IMAP mocks, including a Gmail-like partner mailbox for warm-up tests.
(06)

ColdMailer FAQ

What is ColdMailer?

ColdMailer is a self-hosted cold-email platform built by Shahin Alam as a personal project. It sends campaigns from the user's own mailboxes (Gmail, Hostinger or any SMTP server) at a human pace, warms up new mailboxes, detects replies and bounces over IMAP within seconds, and tracks opens, clicks and unsubscribes. It is one Next.js 16 app with a PostgreSQL database, deployed with Docker Compose.

What is ColdMailer built with?

Next.js 16 (App Router), React 19 and TypeScript; PostgreSQL 17 with Drizzle ORM; nodemailer for SMTP, imapflow for IMAP and mailparser for incoming mail; Tailwind CSS; web-push for notifications; Docker Compose with Caddy for automatic HTTPS.

How does ColdMailer keep sending human-paced?

Each mailbox gets a next send time based on its sending window divided by its daily limit, with random jitter and a minimum gap between emails. Limits are counted over a rolling 24 hours across campaigns, warm-up and tests, the same way email providers count them, and whatever doesn't fit today carries over to tomorrow.

Can I see ColdMailer?

ColdMailer runs privately, so there's no public demo. I'm happy to walk you through it. Get in touch.