Haraka is a high-performance, open-source Node.js-based Mail Transfer Agent (MTA) built around a plugin architecture that lets you write mail-handling logic in JavaScript. It targets teams that already live in the Node ecosystem and want their inbound filtering, outbound relaying, and custom SMTP behavior to be extensible in the same language as the rest of their stack.
Haraka Quick Reference Guide
Core facts
- Type: Open-source, event-driven Node.js Mail Transfer Agent (MTA).
- Architecture: Node.js core + JavaScript plugins + async I/O.
- Ideal users: Node-first teams, inbound gateways, custom SMTP proxies, transactional relays.
- Focus: Extensibility via JavaScript plugins, event-driven hooks, inbound content processing.
- Deployment: npm install, Docker containers, PM2, systemd services.
Typical Haraka use cases
- Inbound MX filtering with custom content scoring in JavaScript.
- Transactional relay for Node.js SaaS applications (100k-10M msgs/month).
- Custom SMTP proxy for header rewriting, DKIM signing, TLS upgrades.
- Any workflow where MTA extensibility in JavaScript beats config-driven models.
Haraka in one sentence
Haraka is an open-source, JavaScript-driven, plugin-first MTA designed for teams that want to extend mail handling in the same language as their Node.js applications.
1. Introduction to Haraka
What this Haraka guide covers (and who it’s for)
This guide is for teams considering Haraka for their mail infrastructure: SaaS engineers looking for a scriptable SMTP layer, inbound processing teams needing custom filtering, and anyone whose stack is Node.js-first and wants their MTA to match. It covers how Haraka works, when it beats Postfix and Exim, where it does not compete with PowerMTA or KumoMTA, and the concrete use cases where it shines.
Quick definition: what is Haraka?
Haraka is an open-source Node.js MTA that treats mail handling as a stream of events (connect, mail, rcpt, data, queue, deliver) with JavaScript plugins hooked into each. Unlike traditional config-driven MTAs, everything in Haraka, from spam filtering to authentication to routing, is a plugin. The engine is small; the ecosystem does the work.
2. Haraka in the Email Infrastructure Stack
Where Haraka sits in your architecture
In a typical stack, Haraka can sit at two distinct points: as an inbound MX handling incoming mail, or as an outbound relay for messages generated by your applications.
- Your application submits messages to Haraka via SMTP (or Haraka accepts inbound as your MX).
- Plugins run on each SMTP event: authentication, spam scoring, DKIM signing, routing decisions.
- Haraka delivers via SMTP to recipient MTAs, or hands accepted inbound mail to storage or queue systems.
- Node.js integration lets any plugin call any npm package or your application’s own libraries.
Haraka vs cloud SMTP APIs
- Cloud SMTP APIs hide the MTA layer from you and manage everything themselves.
- Haraka gives you the MTA layer with JavaScript hooks into every phase of mail handling.
- For small-to-mid volume where control matters more than turn-key operation, Haraka wins.
- For turn-key sending at scale without operational burden, cloud APIs win.
3. Haraka Origins and Positioning
Why Haraka was created (Node.js MTA story)
- Haraka was born from a specific gap: teams running Node.js applications needed an MTA they could extend without switching languages.
- Writing Postfix milters in C or Exim expansion strings is a context switch; Haraka lets you write mail logic in JavaScript.
- Positioned as the extensible, developer-friendly alternative to config-driven traditional MTAs.
Open-source community model
- Fully open-source under an MIT license, with no commercial variant or vendor.
- Plugin ecosystem has grown organically over more than a decade.
- Active on GitHub with a smaller but experienced community of operators and contributors.
- No commercial vendor to call, you rely on documentation, GitHub issues, and your own engineering team.
4. Haraka Architecture Deep Dive
Node.js core and async I/O
- Single-threaded event loop handles many concurrent SMTP connections efficiently.
- Non-blocking I/O means slow receivers do not block other deliveries in progress.
- Cluster mode uses worker processes to leverage multiple CPU cores when needed.
- Familiar operational model for any team that has built Node.js services before.
The plugin system (Haraka’s defining feature)
- Every SMTP event (connect, mail, rcpt, data, queue, delivered, bounce) can be intercepted by plugins.
- Plugins are just Node.js modules; install them with npm and register them in a config file.
- Ships with more than 60 built-in plugins for common needs (SPF, DKIM, DMARC, DNSBL, spam scoring).
- Write your own plugin in around 50 lines of JavaScript to add custom logic.
Event hooks and the delivery pipeline
hook_connectruns when a client connects, good for IP-based blocking and rate limiting.hook_mailandhook_rcptrun on envelope commands, recipient validation, alias expansion.hook_dataandhook_data_postsee the full message, content filtering, header manipulation.hook_queuedecides how to accept and route accepted messages.hook_deliverruns on outbound delivery attempts to remote MTAs.
5. Key Haraka Features
Inbound plugin ecosystem
- DNSBL and URIBL, block based on IP or URL reputation lists.
- SPF, DKIM verify, DMARC, full SPF, DKIM, and DMARC validation suite as plugins.
- rspamd or SpamAssassin, integrate with external spam scoring engines.
- ASN and geoip, reject or flag messages by autonomous system or country.
- Rate limiting, throttle abusive clients before they consume resources.
Outbound and signing
- DKIM signing, sign outbound messages per domain with configurable selectors.
- Outbound queue, persistent queue with retry logic and TLS negotiation.
- Per-domain concurrency, basic throttling to major receivers to avoid rate limits.
- SNI and STARTTLS, modern TLS with certificate selection based on hostname.
Built-in authentication
- Full SPF check and DKIM verify plugins with sensible defaults.
- DMARC evaluation with Authentication-Results header writing.
- ARC signing available via community plugin.
- These match what modern receivers like Gmail and Yahoo expect from a compliant MTA.
6. Haraka Management and Observability
Logs and log levels
- Configurable log levels: debug, info, warn, error, critical.
- Plaintext or JSON output for ingestion into ELK, Loki, or similar log platforms.
- Per-plugin logging namespaces make it easy to filter and troubleshoot specific components.
Metrics via plugins
- Graphite plugin exposes counters and timing metrics.
- Prometheus support is available via community plugins.
- Custom metric emission from your own plugins takes one line of code.
Node ecosystem integration
- Any npm package is available inside a plugin (Redis clients, S3, message queues, gRPC).
- Share code with your main application when it makes sense architecturally.
- Deploy through the same CI/CD pipeline you use for other Node.js services.
7. Haraka vs Other MTAs
High-level comparison table
| MTA | License | Extensibility | Best for | Scale sweet spot |
|---|---|---|---|---|
| Haraka | Open-source | JavaScript plugins | Node teams, inbound gateways | Small to mid |
| Postfix | Open-source | Config + milters (C) | General-purpose mail servers | Any |
| Exim | Open-source | ACLs, expansion strings | Hosting, complex routing | Any |
| KumoMTA | Open-source | Lua policies | ESP-scale sending | High |
| PowerMTA | Commercial | Config-driven | Enterprise ESPs | Very high |
| Halon | Commercial | HSL scripting | Programmable policy | Mid to high |
| MailerQ | Commercial | Queue + JSON | Queue-native ESPs | High |
| GreenArrow | Commercial | Config + optional UI | Marketing-oriented ESPs | High |
| Postal | Open-source | UI + APIs | Platform-in-a-box | Small to mid |
| Sendmail | Open-source | sendmail.cf, m4 | Legacy systems | Legacy only |
Haraka vs Postfix and Exim
- Postfix and Exim excel at battle-tested general-purpose mail serving; Haraka excels at scriptable custom logic.
- Postfix has decades of production hardening; Haraka has a smaller footprint but younger track record.
- Choose Postfix or Exim for standard mail server duties; choose Haraka when JavaScript extensibility drives the decision.
Haraka vs KumoMTA and PowerMTA
- Haraka is not designed for ESP-scale bulk sending, it lacks per-tenant IP pools, MX rollup, and enterprise deliverability controls out of the box.
- KumoMTA and PowerMTA are built for millions-per-hour bulk; Haraka is built for thousands-per-hour with rich custom logic.
- Do not pick Haraka if your problem is “I need to send 500 million marketing emails per month”, pick it if your problem is “I need to filter and transform mail with custom code”.
Haraka vs Halon and MailerQ
- Halon offers programmable policies in its own HSL language; Haraka offers the same programmability in JavaScript.
- Halon is commercial and enterprise-focused; Haraka is community-driven and free.
- MailerQ centers on RabbitMQ integration and JSON messaging; Haraka has no such coupling and integrates with any queue accessible from Node.
8. Haraka Use Cases and Reference Architectures
Inbound filtering gateway
- Deploy Haraka in front of your existing mail server as an inbound MX.
- Run DNSBL, SPF/DKIM/DMARC checks, and custom content scoring in JavaScript plugins.
- Reject or quarantine bad mail; forward clean mail to Postfix, Exchange, or Dovecot for storage.
- Common architecture for teams that want MX-layer control without replacing their storage MTA.
Transactional relay for Node.js applications
- Node.js SaaS applications send via an internal Haraka instance instead of an external SMTP API.
- Local delivery means zero network latency for critical transactional flows like password resets.
- Custom plugins add tenant tagging, per-customer rate limits, and rich event logging.
- Sweet spot: applications sending 100k to 10M messages per month with control requirements.
Custom SMTP proxy
- Sit Haraka between a legacy application and a modern SMTP endpoint.
- Rewrite headers, sign with DKIM, add List-Unsubscribe, upgrade to TLS on the fly.
- Common for organizations modernizing legacy systems without touching the legacy code.
When Haraka is NOT the right choice
- ESP-scale bulk sending, use KumoMTA, PowerMTA, or MailerQ instead.
- General-purpose mail server with mailboxes for users, use Postfix with Dovecot.
- You want a platform with web UI, HTTP APIs, and multi-tenant orgs, use Postal.
9. Installing and Deploying Haraka
Prerequisites and supported environments
- Linux server or container platform with Node.js 18 LTS or newer.
- Networking access for SMTP: port 25 inbound, port 587 submission, outbound 25/587/465.
- DNS control for sending domains and reverse DNS records on outbound IPs.
- Familiarity with npm, JavaScript, and JSON or YAML configuration.
Quick start: single-node setup
- Install Node.js LTS and Haraka:
npm install -g Haraka && haraka -i /path/to/haraka. - Configure the
host_listandmefiles with your domain and hostname. - Enable core plugins in
config/plugins(SPF, DKIM verify, DKIM sign, DNSBL, spamassassin). - Configure SPF, DKIM, and DMARC DNS records for sending domains.
- Start Haraka:
haraka -c /path/to/haraka, then send a test message through it.
Docker, PM2, and clustering
- Official Docker images are available on Docker Hub for quick container deployment.
- Run multiple Haraka workers via built-in cluster mode or an external process manager like PM2.
- Load-balance inbound SMTP with nginx stream, HAProxy, or a cloud load balancer.
- Share configuration via volume mounts, or bake it directly into container images.
10. Traffic Handling with Haraka
Concurrency model
- The Node.js event loop handles many concurrent SMTP sessions per process.
- Cluster mode adds worker processes to use all available CPU cores.
- A well-configured single Haraka instance can handle hundreds of concurrent connections.
Rate limiting via plugins
- Built-in
limitplugin caps connections per IP and messages per SMTP session. - Custom plugins can implement any throttling logic (per-tenant, per-sender, per-recipient).
- No built-in per-domain rollup like KumoMTA, you build it yourself if you need it.
Where Haraka stops scaling
- ESP-scale bulk with per-tenant IP pools and MX rollup is out of scope for Haraka.
- Above roughly 10 million outbound messages per month with complex policy, consider KumoMTA or PowerMTA.
- Inbound scales further than outbound because most inbound work is content processing, not per-domain throttling.
11. Operating Haraka Day-to-Day
Monitoring, alerts, and SLOs
- Track queue length, delivery latency, and 4xx/5xx SMTP responses per receiver.
- Alert on plugin errors, a crashing plugin can silently drop mail.
- Watch process health because Node.js crashes cascade if you do not use PM2 or systemd for auto-restart.
Common issues and troubleshooting
- Plugin misconfiguration is the number one source of production incidents, test plugins in staging first.
- Node.js version mismatches can break plugins; pin your Node version explicitly.
- Outbound TLS failures often stem from misconfigured cipher lists in older Node versions.
Performance tuning and capacity planning
- Enable cluster mode for CPU-bound plugins (spam scoring, DKIM signing verification).
- Move heavy processing (large attachment scanning) to background workers via a message queue.
- Cache DNS lookups (SPF, DKIM, DMARC) with a plugin like
dns-listto reduce latency.
12. Security and Compliance in Haraka
Hardening Haraka deployment
- Run Haraka as a non-root user with minimal filesystem permissions.
- Restrict access to the config directory and log files.
- Use TLS for both submission (port 587) and MTA-to-MTA traffic (port 25 with STARTTLS).
- Implement MTA-STS and DANE at the DNS layer for outbound TLS enforcement.
Plugin trust model
- Plugins run with full Node.js privileges, audit any third-party plugin before installing it.
- Prefer built-in plugins for security-critical paths (authentication, filtering).
- Custom plugins should follow the same code review standards as production application code.
Logging, audit trails, and retention
- Configure log retention per your compliance framework (GDPR, HIPAA, SOC 2).
- Log authentication decisions and delivery outcomes for audit purposes.
- Sanitize sensitive data (passwords, PII) before writing anything to logs.
13. Migration Scenarios Involving Haraka
Migrating from Postfix to Haraka
- Migrate when you need JavaScript extensibility, not merely as a Postfix replacement.
- Run in parallel initially, Haraka on a separate IP with Postfix as fallback.
- Move plugin-friendly workloads (inbound filtering, custom relaying) first.
- Keep Postfix for mailbox storage if you have local users.
Migrating from Haraka to a bulk MTA
- Trigger: you hit ESP-scale volumes and Haraka’s outbound features feel limiting.
- Migrate outbound to KumoMTA or PowerMTA; keep Haraka for inbound filtering.
- Run both in parallel during warm-up on the new outbound IPs.
- Common pattern for growing SaaS: outgrow Haraka’s outbound but keep it for MX-layer processing.
Hybrid: Haraka plus cloud SMTP API
- Use cloud SMTP APIs (SES, SendGrid) for bulk marketing and campaign traffic.
- Use Haraka for transactional and inbound where control matters more than throughput.
- Split by traffic type, not by tenant, to keep operations clear.
14. Haraka Pros, Cons and Fit
Key advantages of Haraka
- JavaScript plugins mean any Node.js developer can extend the MTA.
- Fast iteration cycles compared to milter or ACL-based extension models.
- Small footprint suitable for containers and edge deployment.
- Strong authentication and inbound filtering capabilities out of the box.
Limitations and trade-offs
- Not designed for ESP-scale bulk sending, do not use it as a PowerMTA or KumoMTA replacement.
- Smaller operator community than Postfix or Exim, fewer Stack Overflow answers.
- No commercial support option, you rely on community and your own team.
- Plugin quality varies; audit before adopting third-party plugins.
When Haraka is the right choice
- Your team is Node.js-first and wants MTA extensibility in the same language as your applications.
- You need custom inbound filtering, header manipulation, or content-based routing.
- You send under 10 million messages per month with real control requirements.
- You want an open-source MTA with modern JavaScript plugin architecture.
15. Haraka FAQ
What is Haraka and how does it differ from Postfix?
Haraka is a Node.js MTA where all mail-handling logic runs as JavaScript plugins hooked into SMTP events. Postfix is a C-based MTA configured via text files with limited extensibility through milters. Haraka wins on developer velocity for teams that live in JavaScript; Postfix wins on maturity, community size, and battle-tested performance at any scale.
Can Haraka handle ESP-scale bulk sending?
No, not in the way PowerMTA or KumoMTA can. Haraka lacks per-tenant IP pools, MX rollup, warm-up automation, and the enterprise deliverability controls that ESP-scale requires. If you need those features, use KumoMTA (open-source) or PowerMTA (commercial). Haraka excels at small-to-mid volume with custom logic, not high-volume bulk.
Is Haraka good for inbound filtering?
Yes. Inbound filtering is where Haraka truly shines. The plugin architecture makes it trivial to add DNSBL checks, custom content scoring, header rewriting, per-recipient routing, and integration with external services (rspamd, ClamAV, custom APIs). Many organizations run Haraka as an inbound MX in front of a traditional storage MTA like Postfix or Exchange.
How do I write a Haraka plugin?
A Haraka plugin is a Node.js module that registers callbacks on SMTP hooks. Create a JavaScript file in plugins/, export a function like exports.hook_rcpt = function(next, connection, params) {... }, and enable the plugin in the config file. Plugins have access to the connection object, the message data, and can call any npm package installed alongside Haraka.
Does Haraka support SPF, DKIM, and DMARC?
Yes, all three are shipped as built-in plugins. Enable spf, dkim_verify, dkim_sign, and dmarc in your config to get full SPF, DKIM, and DMARC coverage. The plugins write standard Authentication-Results headers that downstream systems can consume.
Should I use Haraka or a cloud SMTP service like SendGrid?
Use Haraka when control matters (custom filtering, local processing, on-premises requirements) and you have Node.js operations bandwidth. Use a cloud SMTP service when turn-key sending with zero ops is more valuable than control. Many teams use both: Haraka for transactional and inbound, cloud SMTP for bulk marketing.
What is the biggest operational risk with Haraka?
Plugin quality. A misbehaving plugin can silently drop mail, leak memory, or crash the process. Mitigation: prefer built-in plugins for security-critical paths, audit third-party plugins before adoption, and treat custom plugin code with the same review standards as production application code. Combined with proper monitoring, this makes Haraka reliably operable at its intended scale.
About the Author

Alaa · LinkedIn
Email infrastructure specialist with 8+ years of hands-on experience in SMTP, deliverability, and email verification. I’ve configured and troubleshot mail systems across Postfix, Exchange, and cloud relays, managed IP reputation and warmup campaigns, and built verification pipelines processing millions of addresses. My work spans DNS authentication (SPF, DKIM, DMARC, BIMI), bounce handling, blocklist monitoring, and compliance frameworks including CAN-SPAM and GDPR. I write every article on SMTPedia to give email professionals, developers, and marketers the accurate, RFC-grounded reference they need.
About SMTPedia
SMTPedia is an independent email industry reference covering SMTP, IMAP, POP3, email deliverability, marketing platforms, DNS authentication, and email verification. Every article is researched from official provider documentation, IETF RFCs, and industry best practices. Settings and configurations are verified quarterly.
We are cited as a source by ChatGPT, Microsoft Copilot, and thousands of email professionals worldwide. Learn more about our editorial process.

