Relay mail to GMail with OpenBSD

Using Postfix

postfix logo

Install packages

pkg_add postfix-<ver>-sasl2

Setup mailer.conf


Configure /etc/postfix/ Add the following ...

relayhost = []:587
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous
smtp_tls_CAfile = /etc/postfix/cacert.pem
smtp_use_tls = yes

Put gmail login in /etc/postfix/sasl_passwd


Map sasl password

sudo chmod 400 /etc/postfix/sasl_passwd
sudo postmap /etc/postfix/sasl_passwd

Install a root certificate to /etc/postfix/cacert.pem

Start or reload postfix.

postfix start

Using smtpd

opensmtpd logo

Using the guide from I got this working.