I use a small Linux VM in my environment to relay outbound SMTP using my e-mail provider. This is primarily used to get alerts and notifications from my Home Lab systems to my inbox.
My Ubuntu version was at end-of-life so it was time to rebuild with the latest version. I thought this was a good time to publish my notes to help myself – and anyone else!
Acknowledgements
I relied on 3 different blog articles to get this setup. I am sure there are other ways to accomplish this task; but these worked for me:
- https://www.linode.com/docs/guides/configure-postfix-to-send-mail-using-gmail-and-google-workspace-on-debian-or-ubuntu/
- https://www.linuxsysadmins.com/forcing-the-from-address-when-postfix-relays-over-smtp
- Setup App-specific passwords for Apple IDs
Goals
- SMTP host capable of relaying emails from internal systems to my e-mail provider.
- No inbound SMTP is needed or desired
- SMTP had to send email using specific username/credentials
- Initially it had to work with Gmail. I had the legacy free version of Google Apps since 2010. When that was initially announced to be shuttered, I moved all of my email services to Apple. Shortly after I had moved everything. Google announced it had changed its mind and was not shutting down Legacy G Suite after all; but that was too late for me. The steps below work for both Gmail and Apple mail.