Memo about how to set SMTP in Linux environment (host) when sending notification mail with Docker
Configuration file: /etc/postfix/main.cf
mynetworks = 127.0.0.0/8,[IP used by Docker]
inet_interfaces = all
mynetworks
This item describes a trusted network. Mail from the SMTP server specified in this item is allowed to be relayed. That is, a list of IPs that are allowed to send email. Basically, specify "127.0.0.0/8" which indicates your server (localhost).
Please note that if you carelessly specify the IP in this item, it will be used for "illegal relay" to send spam mail from the outside.
inet_interfaces
Specifies the interface on which postfix listens. By default, it is localhost, and only mail can be exchanged inside the server. Specify all to allow communication with an external SMTP server.
https://oxynotes.com/?p=4646
systemctl restart postfix
Recommended Posts