• Linux Commands

    How To Set Relay Postfix on Server

    I recently had to re-provision a VM which I use to run a bunch of cron jobs and email me reports. I use Ubuntu as my OS, Postfix as my mail server, and Gmail for my email account.. The details to make this happen can be found in quite a few places online, but the information was a bit scattered and didn’t match my situation exactly. Steps to Success 1. Edit /etc/postfix/main.cf # sets gmail as relay relayhost = [smtp.gmail.com]:587 # use tls smtp_use_tls=yes # use sasl when authenticating to foreign SMTP servers smtp_sasl_auth_enable = yes # path to password map file smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd # list of CAs to trust…