Connect n8n to Mailcow by adding SMTP credentials in n8n's email node: Host mail.yourdomain.com, Port 587, STARTTLS, and a dedicated Mailcow mailbox for authentication. For inbound triggers, use n8n's IMAP node connected to a Mailcow mailbox to trigger workflows when emails arrive. This creates a fully self-hosted email automation stack.
Mailcow + n8n Integration: Automated Email Workflows
Why n8n + Mailcow
n8n is an open-source workflow automation platform. Mailcow is a self-hosted email server. Together, they create a fully self-hosted email automation stack that replaces paid services like Mailchimp + Zapier at a fraction of the cost.
n8n handles the logic: triggers, conditions, scheduling, API integrations. Mailcow handles the delivery: SMTP sending, IMAP receiving, authentication, reputation management.
Total infrastructure cost: $10-30/month for both services on a single VPS. Make sure your Mailcow DNS and authentication are configured first.
Sending Email: n8n → Mailcow
Configure SMTP Credentials in n8n
- In n8n, go to Credentials → Add Credential → SMTP
- Enter:
| Field | Value |
|---|---|
| Host | mail.yourdomain.com |
| Port | 587 |
| User | [email protected] |
| Password | (mailbox password) |
| SSL/TLS | STARTTLS |
- Create the mailbox
[email protected]in Mailcow first
Use the Send Email Node
In any n8n workflow, add a Send Email node and select your Mailcow SMTP credentials. Set the From address to match the Mailcow mailbox domain.
Basic send workflow:
Trigger → Process Data → Send Email (via Mailcow SMTP)
The email goes through Mailcow's Postfix, gets DKIM-signed automatically, and delivers with full authentication.
Receiving Email: Mailcow → n8n
IMAP Email Trigger
n8n can poll a Mailcow mailbox for incoming email and trigger workflows:
- Add an IMAP Email Trigger node
- Configure credentials:
| Field | Value |
|---|---|
| Host | mail.yourdomain.com |
| Port | 993 |
| User | [email protected] |
| Password | (mailbox password) |
| SSL/TLS | Enabled |
- Set the mailbox to
INBOX - Set poll interval (e.g., every 1 minute)
When an email arrives in that Mailcow mailbox, n8n triggers your workflow with the full email content — subject, body, sender, attachments.
Practitioner note: For inbound email triggers, create a dedicated mailbox like
[email protected]. Don't use a personal inbox — n8n will process every incoming message, and you don't want personal email triggering automation workflows.
Practical Automation Recipes
Recipe 1: Welcome Email Sequence
Webhook (new signup) → Wait 0min → Send Welcome Email
→ Wait 1day → Send Getting Started Email
→ Wait 3days → Send Tips Email
Each Send Email node uses Mailcow SMTP. The entire sequence runs self-hosted.
Recipe 2: Form Submission → Email Notification
Webhook (form submit) → Format Data → Send Email to Team
→ Send Confirmation to Submitter
When someone fills out a form on your site, n8n receives the webhook, formats the data, and sends notification emails through Mailcow.
Recipe 3: Scheduled Digest Email
Cron (daily 8am) → HTTP Request (fetch data) → HTML Template → Send Email
Pull data from your API or database daily, format it as an HTML email, and send through Mailcow. Replace expensive digest/newsletter tools.
Recipe 4: Bounce and Complaint Processing
IMAP Trigger (bounces@domain) → Parse Bounce → Update CRM/Database → Alert if critical
Configure Mailcow to forward bounces to a dedicated mailbox. n8n monitors that mailbox, parses bounce messages, and updates your contact list automatically.
Practitioner note: The bounce processing workflow is the one most people skip and most regret skipping. Automated bounce handling keeps your sender reputation clean without manual list scrubbing. Build this workflow before you start sending volume.
Running Both on One Server
If you want to minimize costs, both n8n and Mailcow run as Docker containers on the same VPS:
Minimum specs: 4GB RAM, 2 vCPU, 40GB SSD
Separate Docker Compose stacks:
/opt/mailcow-dockerized/ → Mailcow stack
/opt/n8n/ → n8n stack
They share the server but run independently. n8n connects to Mailcow via localhost SMTP (port 587) — no external network latency.
Resource Allocation
| Service | RAM Usage | Notes |
|---|---|---|
| Mailcow (all containers) | ~1.5-2GB | ClamAV is the heaviest |
| n8n | ~200-500MB | Depends on workflow complexity |
| OS overhead | ~300MB | |
| Total | ~2.5-3GB | 4GB VPS recommended |
To reduce Mailcow memory: disable ClamAV if you don't need antivirus scanning (saves ~800MB). Edit mailcow.conf and set SKIP_CLAMD=y.
Separate Servers (Production Recommended)
For production workloads, run them on separate VPSes:
- Mailcow server: $5-10/month (Hetzner CX22/CX32)
- n8n server: $5/month (Hetzner CX22)
- Total: $10-15/month
Benefits: Mailcow updates don't affect n8n, resource contention is eliminated, and you can scale each independently.
Practitioner note: For agencies running both n8n and Mailcow for multiple clients, separate servers is the way. One bad n8n workflow consuming all CPU shouldn't delay email delivery. The extra $5/month for a second VPS is cheap insurance against cross-service resource conflicts.
Monitoring the Integration
Set up these alerts in n8n:
- Email send failure alert — if the Send Email node fails, trigger a Slack/Discord notification
- Queue depth monitor — periodically check Mailcow's Postfix queue via API and alert if emails are backing up
- Bounce rate monitor — track bounce counts and alert if they spike
Mailcow's monitoring dashboard shows queue depth, delivery rates, and error logs. Check it weekly.
If you want a complete self-hosted automation stack set up and integrated, schedule a consultation — I deploy n8n + Mailcow stacks for businesses that want full control over their email automation.
Sources
- n8n: SMTP Node Documentation
- n8n: IMAP Email Trigger
- Mailcow: Docker Configuration
- Mailcow: API Documentation
v1.0 · April 2026
Frequently Asked Questions
How do I connect n8n to Mailcow?
In n8n, create SMTP credentials: Host is your Mailcow hostname, Port 587, User is a Mailcow mailbox address, Password is the mailbox password, enable SSL/TLS (STARTTLS). Use these credentials in the Send Email node to send through Mailcow.
Can n8n receive email from Mailcow?
Yes. Use n8n's IMAP Email Trigger node connected to a Mailcow mailbox. When an email arrives in that mailbox, n8n triggers a workflow. Configure with IMAP host (mail.yourdomain.com), port 993, SSL enabled, and the mailbox credentials.
Is n8n + Mailcow a good email automation setup?
For self-hosted automation, it's excellent. n8n handles workflow logic (triggers, conditions, scheduling) while Mailcow handles email delivery. Total cost: $5-20/month for both on a single VPS or $10-30 on separate VPSes.
Can I run n8n and Mailcow on the same server?
Yes, if your VPS has 4GB+ RAM. Both are Docker-based. Run them in separate Docker Compose stacks sharing the same server. At 2GB RAM, it's too tight — Mailcow alone needs 1.5-2GB. For production, separate servers are more reliable.
What email automations can I build with n8n and Mailcow?
Welcome email sequences, transactional notifications, scheduled digest emails, form submission confirmations, alert emails from monitoring systems, lead follow-up sequences, invoice delivery, and any workflow that needs to send or receive email.
Want this handled for you?
Free 30-minute strategy call. Walk away with a plan either way.