Configure mailgun on Ubuntu (bsd-mailx / postfix)

1) Install bsd-mailx

aptitude install bsd-mailx

Select Internet Site in the Postfix Configuration screen.

If you missed it or want do reconfigure do:

dpkg-reconfigure postfix

2) Add mailgun configuration

Edit /etc/postfix/

relayhost =
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = static:[email protected]:password
smtp_sasl_security_options = noanonymous

3) Restart the postifx service

service postfix restart


One Reply to “Configure mailgun on Ubuntu (bsd-mailx / postfix)”

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.