From 32fa8dc6fe4963239f6542222a9b4895751ae48a Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Fri, 28 Oct 2022 13:09:57 -0500 Subject: [PATCH] Add basic docs for Postfix w/ Gmail relay --- docs/base/email/postfix.rst | 40 ++++++++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/docs/base/email/postfix.rst b/docs/base/email/postfix.rst index 3d1b1d3..e5da62c 100644 --- a/docs/base/email/postfix.rst +++ b/docs/base/email/postfix.rst @@ -1,5 +1,43 @@ +.. highlight:: sh + Postfix Setup ============= -TODO +The typical scenario for a Rattail server is that it runs Linux and +Postfix for the mail service. Here we describe that typical setup. + + +Basics +------ + +If you don't already have Postfix installed, do that first:: + + sudo apt install postfix + +It's normally a good idea to declare your domain and hostname. +Assuming your server is ``myserver.example.com`` then:: + + sudo postconf -e 'myhostname=myserver.example.com' + sudo postconf -e 'myorigin=example.com' + sudo systemctl restart postfix + + +Gmail Relay +----------- + +Make sure Postfix knows to send all mail through Gmail relay:: + + sudo postconf -e 'relayhost=smtp-relay.gmail.com:25' + sudo systemctl restart postfix + +This however assumes the Gmail relay is also configured to allow mail +from your server. The most straightforward way to do this is +via IP address authentication. + +See `Google Help`_ for more info, but the gist is that you should +choose "Only accept mail from the specified IP addresses" for the +relay authentication within Google Admin settings. And then specify +the public-facing IP address for your server. + +.. _Google Help: https://support.google.com/a/answer/2956491?hl=en