Skip to content

haraka/Haraka

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4,772 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Haraka — a Node.js Mail Server

Tests Coverage Status

Haraka is a highly scalable Node.js SMTP server with a modular plugin architecture. It handles thousands of concurrent connections and delivers thousands of messages per second. Haraka and its plugins are written in asynchronous JavaScript, optimised for throughput and low latency.

Haraka offers strong spam protection (see Plugins.md) and is widely deployed as a filtering MTA or as a MSA on port 465 (and legacy 587) with the auth and DKIM plugins enabled.

Haraka is not a mail store, an LDA, or an IMAP server. It is designed to work alongside those systems. A scalable outbound delivery engine is built in: mail flagged as relaying (for example, by an auth plugin) is queued for outbound delivery automatically.

Plugin Architecture

Haraka's defining feature is its plugin system. Every SMTP transaction is a sequence of well-defined hooks — connect, helo, mail, rcpt, data, data_post, queue, and more — and each hook can be extended with a few lines of JavaScript. Plugins are asynchronous by default, so a slow lookup against DNS, Redis, or an HTTP API never blocks the server.

The result is that behaviours which would require a custom MTA elsewhere are typically a small file in Haraka. For example, accepting qmail-style tagged addresses (user-anything@domain.com) and rewriting them to user@domain.com before forwarding to an Exchange or IMAP backend looks roughly like this:

exports.hook_rcpt = (next, connection, params) => {
  const rcpt = params[0]
  const [user] = rcpt.user.split('-')
  rcpt.user = user
  next()
}

A comprehensive registry of community and core plugins — auth, DNSBLs, DKIM, SpamAssassin, rspamd, Redis, ClamAV, queue backends, and many others — lives in Plugins.md. To write your own, see the plugin tutorial.

Documentation

  • Plugins.md — plugin registry and configuration reference
  • docs/ — core documentation (Connection, Transaction, Outbound, …)
  • Tutorial — step-by-step getting started guide
  • CHANGELOG.md — release notes
  • SECURITY.md — security policy and reporting

Getting Help

Installation

Haraka requires Node.js. Install via npm:

npm install -g Haraka

Create a service directory:

haraka -i /path/to/haraka_test

This creates haraka_test with config/ and plugins/ subdirectories and sets the host name from hostname(1). Edit config/host_list to add the domains for which Haraka should accept mail.

Start Haraka:

haraka -c /path/to/haraka_test

Configuration

Edit config/plugins to select active plugins. By default, mail addressed to domains in config/host_list is accepted and forwarded via the smtp-forward plugin (configured in config/smtp_forward.ini).

Per-plugin documentation is available via:

haraka -h plugins/<name>

See Plugins.md for the full registry.

Running from Source

git clone https://github.com/haraka/Haraka.git
cd Haraka
npm install
node haraka.js

Authorship and Maintenance

Haraka was created by Matt Sergeant (baudehlo), formerly project leader of SpamAssassin and a contributor to Qpsmtpd. The project is currently maintained by Matt Simerson (msimerson).

Haraka is the work of many hands. See CONTRIBUTORS.md for the full list of people who have contributed code, documentation, and plugins.

License

Haraka is released under the MIT License. See LICENSE for details.

About

A fast, highly extensible, and event driven SMTP server

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Sponsor this project

  •  

Contributors

Languages