This article describes how to setup mail notifications, using sendmail, and how to verify it works
apt-get install sendmail mailutils
yum install sendmail mailutils
yum install sendmail mailx
Verify it works
echo "test message" | mail -s "test subject" email@example.com
Replace firstname.lastname@example.org with your email address.
Do you get mail, good.
DId the command above "hang"? See trouble shooting
Check the mail error log:
Jan 9 12:23:39 monitor sm-msp-queue: My unqualified host name (monitor) unknown; sleeping for retry
Jan 9 12:24:37 monitor sm-mta: unable to qualify my own domain name (monitor) -- using short name
Jan 9 12:24:39 monitor sm-msp-queue: unable to qualify my own domain name (monitor) -- using short name
The "unqualified..." means you dont have a domain name set.
In /etc/hosts you must have something like this, i.e, the hostname (in this case 'monitor') cannot be alone on the line. It needs the 'monitor.local' too.
<your ip address> monitor monitor.local
Change and restart sendmail:
service sendmail restart
If it takes long time (> 10 seconds) to restart sendmail, then there are still problems with the domain name.
Here are external links on the subject: