How to configure a Haraka mail server to forward mails to another address on another domain

emailharakanode.jssmtp

I'd like to setup an Haraka mail server on a domain (let's say 'example.com') that will only act as a forwarding service to a 'gmail.com' email address. For the sake of the example let's say I'd like all emails sent to 'me@example.com' to be forwarded to 'me@gmail.com'.

I've already partially succeeded in setting this up using the 'rcpt_to.alias_forward' plugin. Sending the mail using the server itself works, but sending it from gmail still doesn't work. The logs indicate that the message is forwarded in successfully, but it never arrives at the forwarding address.

Best Answer

What you need to do is first setup aliasing that address. You can do this with the aliases plugin (or the plugin you listed in your question). See the documentation here: http://haraka.github.io/manual/plugins/aliases.html (and add the plugin to config/plugins).

Secondly you need to set things up to relay everything outbound, since you want everything to go to this one address. You can do this with the relay plugin by setting the all=true option: http://haraka.github.io/manual/plugins/relay.html - but note how it says not to use that in production, so read the next section carefully:

Finally you need to make sure you don't relay mail that isn't for the known recipients. You do this with the access plugin. Just blacklist every email address, and whitelist the ones you want to allow. http://haraka.github.io/manual/plugins/access.html

Be careful with this setup. You can all too easily setup an open relay. If you get stuck, you can get real-time help on the #haraka IRC channel on Freenode, or use the Haraka mailing list.

Related Topic