Install Send Only SMTP Server

Video Lecture

Install Send Only SMTP Server Install Send Only SMTP Server

Description

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

restart postfix

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:root@your-domain.tld" your@email-address

Check your SPAM folder.

Troubleshooting

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