Quick Answer

An n8n + self-hosted SMTP stack gives you unlimited email automation at near-zero per-email cost. n8n handles workflow orchestration — triggers, conditions, API calls, scheduling. Self-hosted SMTP (Postal or Mailcow) handles delivery. The tradeoff: complete control and cost savings at scale versus significant setup complexity and ongoing maintenance responsibility. This stack makes sense for technical teams sending 100K+ emails/month.

Building an Email Automation Stack With n8n + Self-Hosted SMTP

By Braedon·Mailflow Authority·Email Automation

Why Build This Stack

The standard ESP model charges you per contact or per email. At scale, that's expensive. At 500K emails/month, you're paying $500-2,000/month for infrastructure that costs $20/month to self-host.

The n8n + self-hosted SMTP stack eliminates per-email costs while giving you complete automation flexibility. But it's not for everyone — the setup and maintenance overhead is real.

Architecture Overview

Trigger Source → n8n Workflow → Template Engine → Self-Hosted SMTP → Recipient
     ↑                                                    ↓
     └──────── Webhook (bounces, complaints) ────────────┘

Component Roles

ComponentRoleOptions
n8nWorkflow orchestration, triggers, schedulingSelf-hosted (recommended)
SMTP ServerEmail delivery, queue managementPostal, Mailcow, Postfix
Template StorageEmail templatesDatabase, file system, CMS
Contact DatabaseSubscriber data, segmentsPostgreSQL, MySQL
MonitoringDeliverability trackingGoogle Postmaster Tools, SNDS

Setting Up the Stack

Step 1: Self-Hosted SMTP

Postal is the recommended SMTP for this stack. It provides:

  • Web UI for monitoring
  • HTTP API for sending (n8n integration)
  • Webhook support for bounces and events
  • Built-in IP pool management
  • Click and open tracking

Install on a VPS with a clean IP:

  • Use a provider known for clean IPs (Hetzner, OVH, Vultr)
  • Verify the IP isn't on any blacklists before setup
  • Set up reverse DNS (PTR record) pointing to your sending domain
  • Configure SPF, DKIM, and DMARC before sending anything

Step 2: n8n Setup

Install n8n on the same server or a separate one:

  • Docker installation is the simplest
  • Configure persistence for workflow data
  • Set up the SMTP node or HTTP Request node to connect to Postal's API

Step 3: Connect n8n to Postal

n8n connects to Postal via HTTP API:

  • Create API credentials in Postal
  • Use n8n's HTTP Request node to send via Postal's API
  • Or use n8n's SMTP node to connect directly to Postal's SMTP endpoint

The HTTP API approach is preferred — it gives you delivery status feedback and webhook integration for bounces.

Step 4: Build Core Workflows

Welcome sequence workflow:

  1. Webhook trigger: new subscriber notification from your app
  2. Delay node: wait 1 minute (avoid race conditions)
  3. HTTP Request: fetch subscriber data from database
  4. HTTP Request: send welcome email via Postal API
  5. Delay: 3 days
  6. IF node: check if subscriber opened welcome email (via Postal webhook data)
  7. Send appropriate follow-up based on engagement

Scheduled campaign workflow:

  1. Cron trigger: daily at 9 AM
  2. HTTP Request: query database for contacts in target segment
  3. Split In Batches: process 100 contacts at a time
  4. HTTP Request: render template with contact data
  5. HTTP Request: send via Postal API
  6. Rate limiting: max 500 emails/hour during warmup

Deliverability Management

Self-hosted means you own deliverability. No ESP is managing your reputation for you.

IP Warmup

New IPs have zero reputation. ISPs treat unknown senders with suspicion.

WeekDaily VolumeTarget Audience
150-100Your most engaged contacts
2200-500Engaged contacts (opened in last 30 days)
3500-1,000Active contacts (opened in last 90 days)
41,000-3,000Active contacts
53,000-10,000Broader audience
6+Scale graduallyFull list with engagement filtering

Monitor daily: Google Postmaster Tools, Microsoft SNDS, and bounce rates.

Practitioner note: Self-hosted IP warmup is slower and more fragile than ESP warmup. On an ESP's shared infrastructure, you benefit from the pool's existing reputation. On a fresh IP, you're building from zero. I've seen self-hosted warmups take 6-8 weeks to reach stable deliverability. Be patient and don't rush the volume ramp.

Bounce and Complaint Handling

Configure Postal webhooks to send bounce and complaint events to n8n:

  • Hard bounces: n8n workflow suppresses the address immediately
  • Soft bounces: n8n tracks consecutive failures, suppresses after 3-5
  • Spam complaints: Immediate suppression and investigation
  • FBL reports: Process through n8n and add to suppression list

This webhook-to-n8n-to-database pipeline is critical. Without it, you'll keep sending to bad addresses and your IP reputation will degrade.

Authentication

Before sending a single email:

  • SPF: Include your server IP in your domain's SPF record
  • DKIM: Configure DKIM signing in Postal (2048-bit key)
  • DMARC: Start with p=none to monitor, advance to p=reject
  • Reverse DNS: PTR record matching your sending domain
  • MTA-STS: Optional but recommended for receiving

When This Stack Makes Sense

Good fit:

  • Technical team with Linux and email experience
  • Sending 100K+ emails/month where cost savings are significant
  • Need complete data ownership (compliance, sovereignty)
  • Want unlimited customization of automation logic
  • Already running n8n for other automation

Bad fit:

  • Small team without dedicated ops resources
  • Sending under 50K/month (ESP cost is minimal)
  • Need managed deliverability and support
  • Don't want to handle security, updates, and monitoring
  • Need a visual email builder and template library

Practitioner note: I run this exact stack for several clients who send 500K+ emails/month. The cost savings are dramatic — $20/month VPS vs $1,500/month ESP. But I spend 5-10 hours/month on maintenance, monitoring, and deliverability management. If your time isn't free (and it isn't), factor that into the cost comparison. See our self-hosted vs SendGrid and self-hosted vs Mailgun comparisons for detailed cost analysis.

Monitoring Requirements

Self-hosted email requires active monitoring:

  • Server health: CPU, memory, disk, queue depth
  • Deliverability: Postmaster Tools, SNDS, inbox placement
  • Blacklists: Check major blacklists daily
  • Bounce rate: Should stay below 2%
  • Complaint rate: Must stay below 0.1%

Build monitoring dashboards in n8n or use external tools. Set up alerts for anomalies.

If you're considering building a self-hosted email stack and want architecture guidance, schedule a consultation.

Sources


v1.0 · April 2026

Frequently Asked Questions

Why use n8n with self-hosted SMTP instead of a regular ESP?

Cost and control. At 500K emails/month, an ESP costs $500-2,000/month. n8n + Postal on a $20/month VPS costs nearly nothing per email. You also get complete data ownership and unlimited workflow customization.

What self-hosted SMTP should I use with n8n?

Postal for transactional and bulk email with a web UI, API, and webhook support. Mailcow for a full email suite with webmail. Postfix for maximum control with minimal overhead. Postal is the best match for n8n integration.

Is self-hosted SMTP reliable enough for production email?

With proper setup, yes. But reliability is your responsibility — server uptime, queue management, bounce handling, and deliverability monitoring all fall on you. No SLA, no support team, no automatic scaling.

How do I warm up a self-hosted SMTP IP?

Start with 50-100 emails/day to engaged contacts and increase by 20-30% daily over 4-6 weeks. Monitor Google Postmaster Tools and Microsoft SNDS daily. Self-hosted warmup takes longer than ESP warmup because you have no shared reputation to leverage.

Can n8n replace Klaviyo or ActiveCampaign?

For automation logic, yes — n8n can replicate triggers, conditions, delays, and branching. For email templates, analytics, segmentation, and managed deliverability, no. n8n is an automation engine, not a marketing platform. You'll need to build or integrate those capabilities separately.

Want this handled for you?

Free 30-minute strategy call. Walk away with a plan either way.