Sendmail服务未在CentOS7上启动并发出错误消息

Sendmail服务未在CentOS7上启动并发出错误消息,centos,sendmail,centos7,Centos,Sendmail,Centos7,我试图在centos7上启动sendmail服务,但它给了我下面的错误消息,这是非常模糊的。有人能帮我找出这个问题吗 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 st

我试图在centos7上启动sendmail服务,但它给了我下面的错误消息,这是非常模糊的。有人能帮我找出这个问题吗

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.
我正在使用centos7

    #rpm -qa | grep -i sendmail
  sendmail-8.14.7-5.el7.x86_64
  sendmail-cf-8.14.7-5.el7.noarch
centos7的sendmail是否存在已知问题?

可能的原因: 您在sendmail.mc中有2倍的行
DAEMON_选项('Port=smtp,Name=MTA')dnl

我的解决方案 我也有同样的问题, 在sendmail.mc中,我有这样的行

# DAEMON_OPTIONS('Port=smtp,Addr=127.0.0.1, Name=MTA')dnl
DAEMON_OPTIONS('Port=smtp, Name=MTA')dnl
我以为我已经注释掉了,但是要注释掉这个文件中的一行,它必须是:
dnl\DAEMON\u选项('Port=smtp,Addr=127.0.0.1,Name=MTA')dnl

我是如何解决这个问题的:

我使用了与“smpt”(默认端口25)不同的端口,并将其更改为端口26(将“smtp”替换为“26”)

nano/etc/mail/sendmail.mc

DAEMON_选项('Port=26,Addr=127.0.0.1,Name=MTA')dnl

重新生成sendmail并重新启动服务:
make-C/etc/mail

sudo systemctl重启sendmail

然后服务正确启动,没有任何错误,并且在邮件到达邮箱之前发送电子邮件

然后我将端口从
26
更改回
smtp

然后
make-C/etc/mail

sudo systemctl重启sendmail
sudo systemctl status sendmail

而且服务工作正常,没有出现错误

检查sendmail正在工作的端口:
netstat-anp | grep LISTEN | grep sendmail

这解决了Centos 7服务器上的此问题。
sendmail-8.14.7-5.el7.x86_64