Sendmail非常慢-/ etc / hosts配置


11

使用sendmail发送单个电子邮件大约需要15秒。

/var/log/mail.log:

Jul 31 09:52:42 piotr-probook sendmail[2912]: My unqualified host name (piotr-probook) unknown; sleeping for retry

/ etc /主机名:

piotr-probook

/ etc / hosts:

127.0.0.1   piotr-probook localdev localhost
192.168.1.1 router

/etc/mail/sendmail.cf:

# hosts file (normally /etc/hosts)
O HostsFile=/etc/hosts

显然piotr-probook,当我键入url时,可以在浏览器中ping 主机和HTTP服务器弹出窗口http://piotr-probook

我究竟做错了什么?如何解决该问题?

Answers:


20

Sendmail要求“主机名”的结果必须是完全合格的域名才能正常启动。

将主机名设置为类似piotr-probook.localdomain并更新/ etc / hosts。

/ etc / hosts

127.0.0.1   piotr-probook.localdomain piotr-probook localdev localhost

1
谢谢!有用!顺便说一句。它可以在不更改计算机主机名的情况下工作。我刚刚添加piotr-probook.localdomain到/ etc / hosts,一切正常
user21886

非常感谢,顺便说一句,我添加一个换行符127.0.0.1 piotr-probook.localdomain似乎不起作用,但是将其合并到一个行中,就可以了!
liuyang15年
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.