This article describes how to setup mail notifications, using sendmail, and how to verify it works
Ubuntu/Debian (apt)
apt-get install sendmail mailutils
Redhat/Centos (yum)
yum install sendmail mailutils
# OR
yum install sendmail mailx
Verify it works
echo "test message" | mail -s "test subject" myemail@example.com
Replace myemail@example.com with your email address.
Do you get mail, good.
DId the command above "hang"? See trouble shooting
Troubleshooting
Check the mail error log:
Jan 9 12:23:39 monitor sm-msp-queue[10031]: My unqualified host name (monitor) unknown; sleeping for retry
Jan 9 12:24:37 monitor sm-mta[10021]: unable to qualify my own domain name (monitor) -- using short name
Jan 9 12:24:39 monitor sm-msp-queue[10031]: 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:
http://forums.fedoraforum.org/archive/index.php/t-85365.html
Comments
8 comments
Cluster Configurator scripts install postfix, however sendmail is apparently required to send mail? Why is postfix installed instead of sendmail? Postfix could also be used as an SMTP using localhost, but it does not appear to work.
Hi,
I am not 100 why postfix is installed. It must be installed as an dependency.
what do you get in /var/log/mail.log ?
BR
johan
Yes Johan, it appears that postfix is installed as dependency of the clustercontrol-controller package.
Unfortunately mail.log gets nothing when I try to send a test email, be it using mail or SMTP server (localhost:25) from UI
I have tried using mail on the command line and it works fine, as expected.
Frankly, I am more familiar with postfix, but still I would install sendmail in a heartbeat if that's all it took. I will just feel horible if I have a production server with postfix and sendmail on it!
Any ideas?
Hi,
I will check with my colleagues, but it sounds like the postfix is not setup correctly to be a SMTP server (maybe you can set it up to relay the email from localhost to a real SMTP server).
However, if:
works (replace user@example.com with the real user) then i suggest you tell ClusterControl to use the "mail" program as the method, by going into Settings -> General Settings -> Configure Mailserver:
So you tick "Option 1", and then also set the mail sender (maybe needed to avoid delivery problems).
Let me know if this works.
BR
johan
Dear Johan,
If it wasn't clear, sending from UI using both "mail" and "SMTP" are not working. They are simply poping up a confirmation dialog and adding a "Job" in the list. Nothing ever reaches the mail.log.
In regards to system setup, I can send emails using "mail" from the command line, as well as by "talking" to the localhost SMTP via telnet.
Is there any log I could check, because nothing gets logged in cmon.log when sending notifications.
BR,
Anastasis
The Cluster Configurator scripts install postfix, however sendmail appears to be required to send email. Why is postfix deployed rather than sendmail? Postfix may be used as an SMTP server via localhost, but this does not appear to work.
https://support.severalnines.com/ doodle jump
The troubleshooting steps provided are really helpful in case of any issues. It's great to have the commands for both Ubuntu/Debian and Redhat/Centos systems. The link to the external forum for further discussion is also a good addition for additional support time calculator
This article provides a step-by-step guide to setting up email notifications using Sendmail. It explains how to configure Sendmail on your system, customize the settings for sending notifications, and test the configuration to ensure it works correctly. You may also like to Calculate Vat.
Please sign in to leave a comment.