Skip to content

 Threejs and TypeScript
 SocketIO and TypeScript
 Blender Topological Earth
 Sweet Home 3D
 Design Patterns Python
 Design Patterns TypeScript
 Course Coupon Codes
Three.js and TypeScript
Kindle Edition
$9.99 $14.99 Paperback 
$29.99 $34.99

Design Patterns in TypeScript
Kindle Edition
$9.99 $14.99 Paperback
$19.99 $24.99

Design Patterns in Python
Kindle Edition
$9.99 $14.99 Paperback
$19.99 $24.99

Use The Email Media Type And Create A Send Only SMTP Server

Video Lecture

Use The Email Media Type And Create A Send Only SMTP Server Use The Email Media Type And Create A Send Only SMTP Server Use The Email Media Type And Create A Send Only SMTP Server


It is important to get email alerts when a trigger happens in Zabbix. If you don't already have a SMTPĀ server for sending emails, you can also install a Send Only server on the Zabbix Server itself.

In this video I show you how to create your own minimal SMTP server on the Zabbix server itself specifically for the purpose of sending emails. If you already have a SMTP server setup somewhere else that you can use, then you can use that instead.

To install Postfix on your Zabbix server

On Ubuntu,

sudo apt install mailutils

On Centos,

sudo yum install postfix

On Ubuntu, a postfix config screen should appear,

select 'internet site'

enter the mail servers name, it should be the url you've already configured in your domain name provider.

For example. I pre set up an A name record for and it now points to the IP Address of the this new Zabbix Server.

Try a ping to ensure your domain resolves to your zabbix servers IP.

ping zabbix.your-domain.tld


Of course, replace your-domain.tld with your actual domain. eg,

Then configure postfix by calling

sudo nano /etc/postfix/

scroll to the bottom, and set

inet_interfaces = loopback-only
inet_protocols = ipv4

If you didn't get the configuration page when installing postfix (Centos usually), also ensure you have your domain name added to the

myhostname = zabbix.your-domain.tld
mydomain = your-domain.tld          #<---note that the subdomain part is removed here
mydestination = $myhostname, localhost.localdomain, localhost

restart postfix

sudo systemctl restart postfix

Try sending an email from the command line,

Ubuntu 18

echo "This is the body" | mail -s "This is the subject" -a "FROM:root@your-domain.tld" your@email-address

Centos 7

echo -e "Subject: This is the subject\n\nThis is the body\n" | sendmail -f root@your-domain.tld -v your@email-address

Minimal Email Media Type Settings in Zabbix UI

Minimal Email Media Type Settings in Zabbix UI


The most significant thing you can do, is to make sure that reverse DNS lookups work for your chosen domain name.

Eg, using the host command on a different servers, query your zabbix server by its domain name.


host zabbix.your-domain.tld
> zabbix.your-domain.tld has address 111.222.333.444

Then do the reverse look up

host 111.222.333.444
> domain name pointer zabbix.your-domain.tld.

If the reverse dns lookup works for your domain, then you will have less issues with email delivery.

If you use a Digital Ocean server, you can set up reverse DNS for your domain name by naming your droplet the same as your domain name, and then wait a few hours and try again. If you use other cloud providers then it may be a similar process. You will need to try or check with there support.

If you don't have the host command on your server, you can install it with,

Ubuntu 18

apt-get install dnsutils

Centos 7

yum install bind-utils

You can also try setting your servers host name.

hostnamectl set-hostname your-domain.tld

Check your mail spool for any SMTP rejection messages. eg,

cat /var/spool/mail/root

Try using root@your-domain.tld as the sender

If you want to send as a different user, eg zabbix@your-domain.tld, you can set up an alias in the file /etc/aliases. eg,

zabbix:         root

You may need to create a MX record for your domain at your DNS provider. Use or to check for propagation for your-domain.tld

your-domain.tld.         7200    IN      MX      10 zabbix.your-domain.tld.

Also try checking your log files for any clues

cat /var/log/mail.log   (Ubuntu)
cat /var/log/maillog    (Centos)

Check the postfix service status that it is running

sudo service postfix status

Try Postfix check

postfix check

Check your domain name resolves to the ip of your zabbix server. eg,

ping zabbix.your-domain.tld

Do a reverse lookup (replace the #'s with your ip address).

host ###.###.###.###

If you created your server using Digital Ocean, name your droplet, the same as your domain name.

Try pinging your destination email address domain from your server. eg,


If you ever need to rerun the postfix configuration wizard (Ubuntu), then run

sudo dpkg-reconfigure postfix

Note that this is only a minimal SMTP setup designed to demonstrate sending emails from Zabbix. Avoiding the SPAM folder for all possible email providers is a major task and outside the scope of this course. Usually as the Administrator, you are the recipient of the emails so you have the options in your email clients to set up rules to sort incoming messages and add senders to safe lists. The next thing you could also try is to add an SPF record for your domain.

Also, you can continue on with the course and try other forms of message delivery such as SMS, Slack and Telegram which are discussed in the next few lessons.

Useful Sites

Postfix Basic Configuration