Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
An event driven SMTP server
JavaScript Other

dkim_sign: Buffer.concat expects an array of buffers

Bug reported on IRC by DarkSorrow:

[DEBUG] [F998D59E-CB9B-47F3-8056-736D91D0B8CF.1] [core] running queue_outbound hook in dkim_sign plugin
[CRIT] [-] [core] TypeError: undefined is not a function
[CRIT] [-] [core]     at Function.Buffer.concat (buffer.js:267:9)
[CRIT] [-] [core]     at DKIMSignStream.end (/data/src/Haraka/dkim_sign.js:87:25)
[CRIT] [-] [core]     at MessageStream.onend (stream.js:60:10)
[CRIT] [-] [core]     at emitNone (events.js:72:20)
[CRIT] [-] [core]     at MessageStream.emit (events.js:163:7)
[CRIT] [-] [core]     at /data/src/Haraka/messagestream.js:318:14
[CRIT] [-] [core]     at ChunkEmitter.end (/data/src/Haraka/chunkemitter.js:101:41)
[CRIT] [-] [core]     at MessageStream._read_finish (/data/src/Haraka/messagestream.js:310:18)
[CRIT] [-] [core]     at MessageStream._read (/data/src/Haraka/messagestream.js:245:18)
[CRIT] [-] [core]     at /data/src/Haraka/messagestream.js:233:22
[NOTICE] [-] [core] Shutting down
latest commit 6c83ff215a
@smfreegard smfreegard authored
Failed to load latest commit information.
bin tell haraka about docs/deprecated
cfreader add 'value' type to flat.empty
config Create an files with some tips
contrib added *BSD startup file for p0f
docs New config options for Rspamd plugin
http add HTTP support
plugins dkim_sign: Buffer.concat expects an array of buffers
tests Merge pull request #948 from msimerson/karma-minus-concurrent
.gitignore add HTTP support
.gitmodules working on packaging change.
.jshintrc replace infile jshint with .jshintrc
.travis.yml allow test failures against iojs-latest (curr 2.0)
Changes updated Changes for 2.6.1
Dockerfile Switch to Phusion baseimage instead of stock Ubuntu
Gruntfile.js add Gruntfile.js
LICENSE LICENSE and TODO files added missing ] in AppVeyor badge
TODO add HTTP support
UPGRADE add deprecated notice within legacy plugins
address.js allow domains with underscore
appveyor.yml * add Windows build status badge
attachment_stream.js Store attachment headers on stream
chunkemitter.js Support node v0.6 by adding in Buffer.concat
config.js * line shortening (lint)
configfile.js configfile: permit / char in ini keys
connection.js Remove errant console.log
constants.js Improve logging of plugins and common plugin errors
dkim.js Fix timeout issue in dkim_verify
dsn.js Change all 'instanceof Array' to 'Array.isArray(foo)'
fsync_writestream.js Address v0.10 compatibility
haraka.js Add support for .yaml and allow .json and .yaml files to override oth… Switch to Phusion baseimage instead of stock Ubuntu
line_socket.js reference issue #573
logger.js noop (mostly lint, line wrap, semicolon) changes
mailbody.js Don't capture multi-part body text
mailheader.js Prevent plugins adding empty headers
messagestream.js Add missing return to allow pipe()'s to be chained together per #791
net_utils.js rename net_utils.is_rfc1918 -> is_private_ip
outbound.js Fix for #891
package.json update dependency versions
plugins.js permit plugins to be packages
result_store.js result_store: add get_all function
rfc1869.js Finally fix RCPT parsing
run_tests cfreader/binary, flat, ini, json, yaml
server.js add HTTP support
smtp_client.js Fix SMTP AUTH in smtp_forward/proxy and add docs
spf.js Node 0.11.x compatibility fixes
timer_queue.js Major fixes to all aspects of outbound
tls_socket.js Changing createCredentials to tls.createSecureContext
transaction.js Update transaction.js
utils.js add utils.elapsed()

Haraka - a Node.js Mail Server

Build Status Coverage Status Windows Status

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 asyncronous 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 Postix/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


Getting started with Haraka

Why Use Haraka?

Haraka's plugin architecure 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, and yet still have it correctly routed to 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:

npm install -g Haraka

After installion, 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, add 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
$ cd Haraka

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.

Something went wrong with that request. Please try again.