Install Send Only SMTP Server
We will configure the alert manager to use a local SMTP server for sending email alerts.
In this lecture, we create a very quick and simple local SMTP server which can only send emails from localhost.
The commands are
sudo apt install mailutils
A postfix config screen should appear,
Choose internet site from the choices
enter the mail servers name, I will use my existing Prometheus domain i've already setup.
Then configure postfix by calling
sudo nano /etc/postfix/main.cf
scroll to the bottom, and set
inet_interfaces = loopback-only inet_protocols = ipv4
sudo systemctl restart postfix
try sending an email from the command line,
echo "This is the body" | mail -s "This is the subject" -a "FROM:firstname.lastname@example.org" your@email-address
Check your SPAM folder.
If you have trouble receiving emails at your email provider, then please see my SMTP Troubleshooting page in my Zabbix course at https://sbcode.net/zabbix/setup-smtp/#troubleshooting