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
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
| Component | Role | Options |
|---|---|---|
| n8n | Workflow orchestration, triggers, scheduling | Self-hosted (recommended) |
| SMTP Server | Email delivery, queue management | Postal, Mailcow, Postfix |
| Template Storage | Email templates | Database, file system, CMS |
| Contact Database | Subscriber data, segments | PostgreSQL, MySQL |
| Monitoring | Deliverability tracking | Google 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:
- Webhook trigger: new subscriber notification from your app
- Delay node: wait 1 minute (avoid race conditions)
- HTTP Request: fetch subscriber data from database
- HTTP Request: send welcome email via Postal API
- Delay: 3 days
- IF node: check if subscriber opened welcome email (via Postal webhook data)
- Send appropriate follow-up based on engagement
Scheduled campaign workflow:
- Cron trigger: daily at 9 AM
- HTTP Request: query database for contacts in target segment
- Split In Batches: process 100 contacts at a time
- HTTP Request: render template with contact data
- HTTP Request: send via Postal API
- 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.
| Week | Daily Volume | Target Audience |
|---|---|---|
| 1 | 50-100 | Your most engaged contacts |
| 2 | 200-500 | Engaged contacts (opened in last 30 days) |
| 3 | 500-1,000 | Active contacts (opened in last 90 days) |
| 4 | 1,000-3,000 | Active contacts |
| 5 | 3,000-10,000 | Broader audience |
| 6+ | Scale gradually | Full 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=noneto monitor, advance top=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
- Postal: Documentation
- n8n: Documentation
- Google: Postmaster Tools
- Microsoft: SNDS
- M3AAWG: Infrastructure Best Practices
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.