Haraka

一个快速、高扩展性和事件驱动的 SMTP 服务器。(A fast, highly extensible, and event driven SMTP server.)

Github stars Tracking Chart

Haraka -- 一个 Node.js 邮件服务器

Haraka 是一个高度可伸缩的 node.js 电子邮件服务器,具有模块化的插件架构。Haraka 可以提供数千个并发连接,每秒可以发送数千条消息。Haraka 和插件是用异步 JS 编写的,速度非常快。

Haraka 提供极高的性能以及灵活的插件系统,允许 Javascript 程序员完全访问服务器的行为。 它在一些高流量网站中被大量使用 —— 请参阅官网“已知用户”链接以获得推荐。

Haraka 有非常好的垃圾邮件保护(参见插件),可以很好地用作过滤 MTA(邮件传输代理)。它也可以作为一个 MSA(邮件提交代理) 运行在端口587上,并启用了 auth 和 dkim_sign 插件。

Haraka 不会尝试成为邮件存储(如 Exchange 或 Postfix/Exim/Qmail)、LDA,也不是 IMAP 服务器(如 Dovecot 或 Courier)。 Haraka 通常与此类系统一起使用。

Haraka 内置了可扩展的出站邮件交付引擎。标记为中继的邮件(例如通过 auth 插件)会自动排队等待出站交付。

获得帮助

截屏

Haraka 入门

为什么要使用 Haraka?

Haraka 的插件架构提供了一个易于扩展的 MTA,它补充了传统的 MTA,后者擅长管理邮件存储,但没有足够的过滤功能。

插件系统使编写新特性变得很容易。一个典型的例子是向 Exchange 系统提供类似 qmail 的扩展地址,这样您可以以 user-anyword@domain.com 接收邮件,但仍然可以将其正确路由到 user@domain.com。这在 Haraka 中只是几行代码的事。

提供插件用于通过 SpamAssassin 运行邮件、验证 HELO 名称、检查 DNS 阻止列表以及 许多其他插件

安装 Haraka

Haraka 需要 node.js 才能运行。 用 npm 安装 Haraka:

npm install -g Haraka

安装后,使用 haraka 二进制文件来设置服务。

运行 Haraka

首先,创建服务:

haraka -i /path/to/haraka_test

这将创建目录 haraka_test,其中包含 config 和 plugin 目录。它还将 Haraka 使用的主机名设置为 hostname 的输出。

如果主机名不正确,请编辑 config/host_list。例如,要接收发往 user@domain.com 的邮件,请将 domain.com 添加到 config/host_list 文件中。

最后,使用 root 权限启动 Haraka:

haraka -c /path/to/haraka_test

它将运行。

配置 Haraka

要选择运行哪些插件,请编辑 config/plugins。插件控制 Haraka 的整体行为。默认情况下,只接受 config/host_list 中列出的域的消息,然后通过 smtp-forward 插件传递。在 config/smtp_forward.ini 中配置目标。

阅读精细手册

haraka -h plugins/$name

文档详细说明了每个插件的配置方式。编辑 config/plugins 后,重新启动 Haraka 并享受它!

从 git 运行

如果您无法使用 npm 安装 Haraka,可以按照以下步骤从 git 运行:

首先克隆存储库:

$ git clone https://github.com/haraka/Haraka.git
$ cd Haraka

在本地安装 Haraka 的 node.js 依赖项:

$ npm install

编辑 config/plugins 和 config/smtp.ini 以指定所需的插件和配置。

最后运行 Haraka:

$ node haraka.js

许可和作者

Haraka 基于 MIT 许可发布 -- 有关详细信息,请参阅LICENSE文件。

Haraka 是由 Matt Sergeant 发起的一个项目,他在电子邮件和反垃圾邮件领域工作了10年。之前他一直是 SpamAssassin 的项目负责人和 Qpsmtpd 项目大神。

(Second edition: vz revised at 2019.08.09)

Overview

Name With Ownerharaka/Haraka
Primary LanguageJavaScript
Program languageJavaScript (Language Count: 5)
PlatformBSD, Linux, Windows
License:MIT License
Release Count96
Last Release Namev3.0.3 (Posted on )
First Release Namev0.2 (Posted on 2011-04-05 12:25:12)
Created At2011-03-10 17:00:20
Pushed At2024-04-28 01:46:44
Last Commit At2024-04-27 18:11:48
Stargazers Count4.8k
Watchers Count145
Fork Count648
Commits Count4.7k
Has Issues Enabled
Issues Count1182
Issue Open Count28
Pull Requests Count1818
Pull Requests Open Count2
Pull Requests Close Count262
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private

Haraka - a Node.js Mail Server

Build Status
Coverage Status
Windows Status
Greenkeeper badge

Haraka is a highly scalable node.js email server with a modular
plugin architecture. Haraka can serve thousands of concurrent connections
and deliver thousands of messages per second. Haraka and plugins are written
in asynchronous JS and are very fast.

Haraka has very good spam protection (see plugins) and works
well as a filtering MTA. It also works well as a MSA running on
port 587 with auth and dkim_sign plugins enabled.

Haraka makes no attempt to be a mail store (like Exchange or Postfix/Exim/Qmail),
a LDA, nor an IMAP server (like Dovecot or Courier). Haraka is
typically used with such systems.

Haraka has a scalable outbound mail delivery engine built in. Mail
marked as relaying (such as via an auth plugin) is automatically
queued for outbound delivery.

Getting Help

Screencast

Getting started with Haraka

Why Use Haraka?

Haraka's plugin architecture provides an easily extensible MTA that
complements traditional MTAs that excel at managing mail stores but do
not have sufficient filtering.

The plugin system makes it easy to code new features. A typical example
is providing qmail-like extended addresses to an Exchange system,
whereby you could receive mail as user-anyword@domain.com, and yet
still have it correctly routed to user@domain.com. This is a few lines of
code in Haraka.

Plugins are provided for running mail through SpamAssassin, validating
HELO names, checking DNS Blocklists, and many others.

Installing Haraka

Haraka requires node.js to run. Install Haraka with npm:

# If the second command gives "nobody" errors, uncomment & run the next command
# npm -g config set user root
npm install -g Haraka

After installation, use the haraka binary to set up the service.

Running Haraka

First, create the service:

haraka -i /path/to/haraka_test

That creates the directory haraka_test with config and plugin
directories within. It also sets the host name used by Haraka
to the output of hostname.

If hostname is not correct, edit config/host_list. For example,
to receive mail addressed to user@domain.com, add domain.com to the
config/host_list file.

Finally, start Haraka using root permissions:

haraka -c /path/to/haraka_test

And it will run.

Configure Haraka

To choose which plugins run, edit config/plugins. Plugins control the
overall behaviour of Haraka. By default, only messages to domains listed
in config/host_list will be accepted and then delivered via the
smtp-forward plugin. Configure the destination in config/smtp_forward.ini.

Read the Fine Manual

haraka -h plugins/$name

The docs detail how each plugin is configured. After editing
config/plugins, restart Haraka and enjoy!

Running from git

If you are unable to use npm to install Haraka, you can run from git by
following these steps:

First clone the repository:

$ git clone https://github.com/haraka/Haraka.git
$ cd Haraka

Install Haraka's node.js dependencies locally:

$ npm install

Edit config/plugins and config/smtp.ini to specify the plugins and
config you want.

Finally run Haraka:

$ node haraka.js

License and Author

Haraka is MIT licensed - see the LICENSE file for details.

Haraka is a project started by Matt Sergeant, a 10 year veteran of the email
and anti-spam world. Previous projects have been the project leader for
SpamAssassin and a hacker on Qpsmtpd.

To the top