February 20, 2016

Postfix Smarthost with Debian Jessie

After running a mail server for a number of years I got fed up of managing spam and unreliable delivery for system mail. Expanding my recent of use mailgun for web applications I have now set it up to handle system mail. I have previously written this guide for Ubuntu Here, its very similar on Debian 8 but there are some differences:

For simplicity I will assume you don't have an existing mailserver. If you do it may be easier to remove it using the purge option and start again.

smtp_sasl_auth_enable = yes

relayhost = [smtp.mailgun.org]:587

smtp_sasl_security_options = noanonymous

smtp_sasl_password_maps=hash:/etc/postfix/sasl_passwd

Finished! A easy way of routing all your system mail through postfix. You will need to ensure you have added your custom domain into mailgun. For example if your server is called: box.howson.me then add this as a custom domain to mailgun. If some mail is sent as root@howson.me from the server don't worry this configuration will still work and is simple as it does not interfere with the mail provider serving your domain. Even DKIM and SPF work without any changes.

  • LinkedIn
  • Tumblr
  • Reddit
  • Google+
  • Pinterest
  • Pocket
Comments powered by Disqus