ANNOUNCE: Haraka 2.8.10

This release pretty much signifies exactly why I love truly open source software – the release happened almost entirely in my absence, and I’m enormously grateful for the talented developers that work so hard and diligently on this project.

The main focus of this release has been some huge improvements to our TLS support from a contributor only known as “typingArtist” – ah the mysteries of the internet – we may never know your real life identity but we remain grateful – you are Haraka’s “Batman” this release. Many further thanks to Matt Simerson who coordinated this release, and continues to contribute fantastic work to this project. We don’t forget our other contributors, but those two were the stand outs in this release.

  • Changes
    • use standard npm syntax for lint and tests #1646
    • remove ./net_utils to haraka-net-utils #1644
    • remove incorrect and unused spf.hello_host #1635
    • remove rogue DENYSOFT copy-pasta error #1634
    • update async to v2 #1545
    • remove plugin/dir support from base haraka #1668
      • use node_modules_dir support instead
    • use TLSSocket instead of createSecurePair #1672
    • refactor plugins/tls #1670
    • moved watch plugin to npm as haraka-plugin-watch #1657
    • normalize proxy properties #1650
  • New Features
    • added connection.remote.is_private boolean #1648
    • added additional TLS options (@typingArtist) #1651
    • added wildcard boolean support to config loader #1680
    • tls: allow multiple key and cert parameters for RSA+ECDSA #1663
    • permit specifying haraka plugins w/o haraka-plugin- prefix #1645
      • in config/plugins and resultstore
  • Improvements
    • connection.geoip replaced by haraka-plugin-geoip #1645
    • connection.asn replaced by haraka-plugin-asn #1645
    • permit specifying npm packaged plugins w/o haraka-plugin prefix #1647
    • normalized connection properties #1547, #1577
    • Rspamd: fix spambar for negative scores #1630
    • set connection.remote.is_private early
      • replace calls to net_utils with remote.is_private test
  • Bug Fixes
    • Tidy-up graceful shutdown and fix for non-cluster mode #1639
    • Fix data.headers plugin crash #1641
    • Fix access plugin crash #1640
    • Minor DKIM fix #1642
    • do not set TLS timer if timeout=0 #1632
    • do not overwrite config/host_list on install #1637
    • correct smtp_forward cfg for multiple rcpts #1680
    • fix TLS timeout errors #1665

Release Page

Github Home Page for Haraka

Project Home



ANNOUNCE: Haraka v2.8.9

Note this release contains a major security fix for those using the attachments plugin. Previous versions of this plugin allowed remote code execution using specially crafted zip files. Users are urged to upgrade as soon as possible.

  • New Features
    • Support outbound.pool_timeout of 0 to effectively disable pooling. #1561
    • Added never_add_headers option to rspamd plugin. #1562
    • rcpt_to.routes URI format w/ LMTP support #1568
  • Improvements
    • The delay_deny plugin now has a whitelist mode (vs blacklist). #1564
    • Don’t show the private key in logs for dkim_sign. #1565
    • update geoip for compat with newer ES (#1622)
    • drop node 0.10 testing / official support (#1621)
    • watch plugin displays UUIDs as URL (#1624)
    • Catch errors on header decode in rfc2231 #1599
    • Attachment plugin updates (#1606)
    • add outbound.ini pool_timeout example setting #1584
  • Bug Fixes
    • Fixed some small documentation issues. #1573, #1616, #1612
    • Fixed AUTH PLAIN when it spreads over two lines. #1550
    • Fixed dkim_verify calling next() too soon. #1566
    • Fixed bugs with outbound pools who shutdown before we QUIT. #1561, #1572
    • outbound issues #1615, #1603
    • Fixed adding/removing headers in rspamd plugin. #1562
    • Fixed process_title not shutting down. #1560
    • fix a spurious error emitted by p0f (#1623)
    • fix header version hiding (#1617)
    • messagestream returns destination (#1610)
    • plugins.getdenyfn now passed 3rd params arg (#1591)
    • Fix scope of spf logdebug (#1598)
    • fix rabbitmq deliveryMode bug (#1594)
    • fix dkim_sign TypeError with null mail_from.host (#1592)
    • fix dkim_sign attempting to lower an undefined (#1587)

Setting Up Haraka to send to mailchimp/sendgrid/SES etc

One really useful way to use Haraka at a business is to be a local fast cache to forward on to mailchimp/sendgrid/SES or one of the many available transactional mail senders out there. These services offer bounce management, tracking, and also manage deliverability for you, and yet often their sending systems are slow, which can affect your app. By installing Haraka locally you can keep all those benefits, but have your system return from sending mail much faster.

First, install haraka and create an instance of it:

$ sudo npm install -g Haraka
... # lots of output
$ haraka -i /var/apps/haraka

Now edit `/var/apps/haraka/config/plugins` to define what Haraka plugins will get loaded. Here’s my simple config for this setup:

# this lets you view how much stuff your haraka instance is doing
# this lets you receive inbound mail, but is mostly not required
# this is a custom plugin I'll detail below
# this lets you configure who can relay (i.e. your app)
# Check mail headers are valid
# this lets you configure where inbound mail goes (also mostly not required)
# this is just a safety net

You’ll need an entry in the `config/host_list` file:

$ hostname > /var/apps/haraka/config/host_list

You’ll want to allow localhost to relay:

$ echo > /var/apps/haraka/config/relay_acl_allow
$ echo ::1 >> /var/apps/haraka/config/relay_acl_allow

Copy this into your `/var/apps/haraka/config/relay.ini` file:


Prevent `smtp_forward` from processing outbound mail:

$ echo 'enable_outbound=false' > /var/apps/haraka/config/smtp_forward.ini

Edit your `smtp.ini` file to make it listen on a higher port so you don’t have to listen on port 25 by setting the `listen=` line to: listen=[::0]:2525, and set the `nodes=` line to use as many CPUs as you think is reasonable for your setup.

Finally, copy this plugin into `/var/apps/haraka/plugins/relay_via_external`:

var external_smtp = {
    auth_user: '<your username here>',
    auth_pass: '<enter password here>',
    priority: 0,
    exchange: 'smtp.mailgun.org', # or whoever else

exports.hook_get_mx = function (next, hmail, domain) {
    // All relaying goes via external service
    return next(OK, external_smtp);

Remember to edit the username and password – get them from your mail service provider.

And that’s it. There are various ways of launching Haraka (see the contrib directory on github) which keep it starting at startup. But to test it you can simply launch: `haraka -c /var/apps/haraka`.

Now just make your app use localhost on port 2525 as your mail server, with no authentication necessary, and your mail will go out MUCH faster.


ANNOUNCE: Haraka v2.8.8

  • Changes
    • removed UPGRADE.doc to wiki
  • Improvements
    • support + wildcard in aliases plugin #1531
    • Support dkim_sign with outbound.send_email() #1512
    • spf: always check remote IP, then public IP if != pass #1528
    • spf: diplay IP used for SPF eval #1528
  • Bug Fixes
    • handle missing wss section in http.ini #1542
    • fix leak on socket write error #1541
    • add results property to outbound transaction #1535
    • don’t unref unref’d wss server #1521

Announce: Haraka v2.8.5

I haven’t bothered posting about the earlier 2.8.x releases (beyond 2.8.0) because they have mostly fixed small bugs that we introduced in the 2.8.0 release. This is the first release to add significantly new features.

  • Changes
    • The connection object is now passed to get_plain_passwd. Older modules should continue to work as-is.
    • The reseed_rng plugin now just uses the Crypto module from core. Though it seems this plugin should be irrelevant with newer versions of node.js
  • New Features
    • Outbound mail now uses pooled connections, only sending a QUIT message if the connection has been idle for a while.
  • Improvements
    • Shut down and reload (via haraka -c <path> --graceful) is now graceful – allowing current connections to finish and plugins to clean up before ending.
  • Bug Fixes
    • Bind maxmind version to ignore API change (#1492)
    • Fix encodings when banners are used (#1477)
    • Various DKIM fixes (#1495)

Upgrading should be fairly transparent, especially for current 2.8.x users.

Happy Haraking!


ANNOUNCE: Haraka 2.8.2

Note: We shortly after this released 2.8.3 which fixes config merging, a feature we added in 2.8.0. It didn’t seem to really deserve a blog post.

This is a minor bugfix release, mostly to fix the broken config/plugins file we accidentally shipped with v2.8.0.


  • Added Node v6 to travis tests

New Features

  • Added bin/haraka –qunstick <domain> to flush all mails for that domain (#1460)


  • Make bin/haraka –qlist show much more information (#1452)
  • Allow CIDR ranges in no_tls_hosts (#1450)

Bug Fixes

  • 2.8.0 was shipped with a broken config/plugins. (#1453)
  • Stop haraka dying when ldap connections fail (#1456)
  • Pick up domain specific config correctly in ldap (#1456)

Announce: Haraka v2.8.0

This release represents a huge leap forwards for Haraka users everywhere. We came very close to calling this v3, but since we didn’t break any APIs we stuck with v2.8.

This release contains work from 15 contributors around the world, and we thank them all for their time and effort.

Upgrading is simply a matter of running: npm install -g Haraka. Following an upgrade to 2.8 we recommend deleting any config files in your personal Haraka config folder that you have not modified. The reason for this is that Haraka will now load non-modified config data from the core Haraka folder. This change makes future upgrades much easier.

The major new features in this release are:

  • The ability to write plugins as npm packages
  • The merging of config data to allow minimal config in your local config folder
  • Many TLS fixes including the ability to use outbound TLS without a certificate, meaning we now enable outbound TLS by default

The full list of changes are:

  • Changes
    • updated dependency versions (#1426, #1425)
    • use utf8 encoding for body filters (#1429)
    • remove spameatingmonkey from tests (#1421)
    • replace ./constants.js with haraka-constants (#1353)
    • Document HMail and TODO items (#1343)
    • Copy only a minimal config/* by default (#1341).
    • cfreader/* removed to haraka/haraka-config (#1350)
    • outbound and smtp_client honor tls.ini settings (#1350)
    • outbound TLS defaults to enabled
    • lint: remove all unused variables (#1358)
    • replace ./address.js with address-rfc2181 (#1359)
  • New Features
    • smtp_forward: accepts a list of backend hosts, thanks @kgeoss (#1333)
    • config: add array[] syntax to INI files (#1345)
    • plugins.js: support require(‘./config’) in plugins
    • Load plugin config from own folder and merge (#1335)
    • Allow original email’s Subject to be included in bounce message (#1337)
    • new queue/smtp_bridge plugin, thanks @jesucarr (#1351)
  • Improvements
    • early_talker: supports IP whitelisting (#1423)
    • loading plugins as packages (#1278)
    • removed TLD stuff to haraka/haraka-tld (#1301)
    • removed unused ‘require(‘redis’) in plugins/karma (#1348)
    • improved MIME header support per rfc2231 (#1344)
    • tls options can be defined for outbound and smtp_* (#1357)
    • explicitly disable SSLv2 (#1395)
    • cache STUN results
    • xclient plugin improvements (#1405)
    • tls: Set verify=NO correctly when no certificate presented (#1400)
    • improved message header decoding (#1403, #1406)
    • bounce: skip single_recipient check for relays/private_ips (#1385)
    • rspamd docs: Clarify usage of check.private_ip (#1383)
    • if rcpt_to returns DSN in msg, log it properly (#1375)
  • Bug Fixes
    • fix out-of-range errors from banner insertion (#1334)
    • dkim_verify: Call next only after message_stream ended (#1330)
    • outbound: remove type check from pid match (#1322)
    • lint: enable no-shadown and remove all shadow variables (#1349)
    • spf: fix log_debug syntax (#1416)
    • auto_proxy: fix a starttls loop (#1392)
    • fcrdns: corrected err variable name (#1391)
    • rspamd: Fix undefined variable (#1396)
    • dkim_verify: Fix header handling (#1371)
    • smtp_client: fix remote_ip (#1362)

Happy Haraking!