Issue
I am trying to start sendmail service on centos7,but it gives me the below error message Which is very Vague. Could someone help me to identify the issue?
Apr 12 01:04:25 server.localdomain systemd[1]: Starting Sendmail Mail Transport Agent...
Apr 12 01:04:25 server.localdomain systemd[1]: PID file /run/sendmail.pid not readable (yet?) after start.
Apr 12 01:04:25 server.localdomain sendmail[3712]: starting daemon (8.14.7): SMTP+queueing@01:00:00
Apr 12 01:05:55 server.localdomain systemd[1]: sendmail.service start operation timed out. Terminating.
Apr 12 01:05:55 server.localdomain systemd[1]: Failed to start Sendmail Mail Transport Agent.
Apr 12 01:05:55 server.localdomain systemd[1]: Unit sendmail.service entered failed state.
Apr 12 01:05:55 server.localdomain systemd[1]: sendmail.service failed.
I am using centos7.
#rpm -qa | grep -i sendmail
sendmail-8.14.7-5.el7.x86_64
sendmail-cf-8.14.7-5.el7.noarch
Is there any know issues with sendmail with centos7?
Solution
Possible reason:
You have in the sendmail.mc 2x the line
DAEMON_OPTIONS('Port=smtp, Name=MTA')dnl
My solution
I had the same problem, in the sendmail.mc I had the lines like this
# DAEMON_OPTIONS('Port=smtp,Addr=127.0.0.1, Name=MTA')dnl
DAEMON_OPTIONS('Port=smtp, Name=MTA')dnl
I thought I had commented it out, but to comment a line out in this file it has to be:
dnl # DAEMON_OPTIONS('Port=smtp,Addr=127.0.0.1, Name=MTA')dnl
How I tried to solve this was:
I used a different port than 'smpt' (which is default port 25) and changed it into port 26 (replace 'smtp' with '26')
nano /etc/mail/sendmail.mc
DAEMON_OPTIONS('Port=26,Addr=127.0.0.1, Name=MTA')dnl
Rebuild sendmail and restart the service:
make -C /etc/mail
sudo systemctl restart sendmail
Then the service started correctly without any errors and email send before arrived in the mail boxes.
Then I changed the port back from 26
to smtp
Then
make -C /etc/mail
sudo systemctl restart sendmail
sudo systemctl status sendmail
And the service was working fine again without errors
Check on which port sendmail is working:
netstat -anp | grep LISTEN | grep sendmail
This fixed this issue on my Centos 7 server.
sendmail-8.14.7-5.el7.x86_64
Answered By - homefreelancer Answer Checked By - Terry (WPSolving Volunteer)