Sending Email in a Private Network
Relay with Gmail SMTP Server
Quite often we need to send email in a private network for the application testing. Normally the application or commercial software is asking for an SMTP server to send email notifications. We may want the email to be sent to our internet email address for easy access.
This can be achieved with Postfix configured in satellite mode, where we use a “smarthost”, such as gmail, to deliver the email from the private network to the internet.
Settings of Gmail
We will use the Gmail SMTP service as the relay to send out our emails. The service endpoint is smtp.gmail.com:587
(TLS).
Authentication is required for this service. The user name will be your Gmail account. Generate an App Password in your google account as shown below. With the app password, you can still keep your main account to have the option of 2-Step Verification, and therefore you don’t need to turn off the less secure app protection.
Setup postfix
Let's install postfix silently
sudo DEBIAN_FRONTEND=noninteractive…