MCPcopy
hub / github.com/haraka/Haraka

github.com/haraka/Haraka @v3.3.1 sqlite

repository ↗ · DeepWiki ↗ · release v3.3.1 ↗
349 symbols 1,038 edges 94 files 2 documented · 1%
README

Haraka — a Node.js Mail Server

Build Cover Qlty

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.

Core symbols most depended-on inside this repo

push
called by 226
outbound/queue.js
respond
called by 126
connection.js
get
called by 102
connection.js
set
called by 97
connection.js
makeConnection
called by 75
test/smtp_client.js
makePlugin
called by 61
test/smtp_client.js
disconnect
called by 37
connection.js
destroy
called by 37
smtp_client.js

Shape

Method 172
Function 155
Class 22

Languages

TypeScript100%

Modules by API surface

connection.js67 symbols
outbound/hmail.js41 symbols
tls_socket.js26 symbols
test/server.js22 symbols
plugins.js22 symbols
transaction.js16 symbols
smtp_client.js15 symbols
test/plugins/queue/smtp_forward.js10 symbols
server.js10 symbols
outbound/queue.js10 symbols
outbound/tls.js9 symbols
test/outbound/index.js8 symbols

Dependencies from manifests, versioned

@haraka/email-address3.1.6 · 1×
@haraka/eslint-config3.0.0 · 1×
express4.0 · 1×
haraka-config1.6.3 · 1×
haraka-constants1.0.8 · 1×
haraka-dsn1.2.0 · 1×
haraka-email-message1.4.0 · 1×
haraka-net-utils1.9.2 · 1×
haraka-notes1.1.3 · 1×
haraka-plugin-redis2.1.0 · 1×
haraka-results2.4.0 · 1×
haraka-test-fixtures1.7.1 · 1×

For agents

$ claude mcp add Haraka \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact