Ubuntu – How is Ubuntu able to send alerts to external e-mail addresses

cronemailserver

I am trying to understand the procedure of sending email. I have configured a crontab to send system alerts to my external email and it is working fine. However, I didn't configure any SMTP server on this machine, but still the system can send alerts to external email. This machine is a fresh install and connected to the internet only.

Can anyone help me understand how the system is able to send emails?

Best Answer

This happens because Ubuntu desktop and server has by default (at least on 16.04 and onward) postfix.service enabled and running. You can confirm this by issuing the following command in terminal:

systemctl --type service --state running | grep postfix

The sending of mail works because postfix does a simple DNS lookup for the MX record for the domain the mail is destined for. The receiving server simply takes the mail it got sent and maybe does a few checks on it and puts it on the receivers inbox. So no SMTP configuration is needed to send an email.