Sendmail 很慢 - /etc/hosts 配置

use*_*886 11 linux sendmail ubuntu

使用 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
Run Code Online (Sandbox Code Playgroud)

/etc/主机名:

piotr-probook
Run Code Online (Sandbox Code Playgroud)

/etc/hosts:

127.0.0.1   piotr-probook localdev localhost
192.168.1.1 router
Run Code Online (Sandbox Code Playgroud)

/etc/mail/sendmail.cf:

# hosts file (normally /etc/hosts)
O HostsFile=/etc/hosts
Run Code Online (Sandbox Code Playgroud)

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

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

Bri*_*ian 20

Sendmail 要求“主机名”的结果是一个完全限定的域名才能干净地启动。

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

/etc/hosts

127.0.0.1   piotr-probook.localdomain piotr-probook localdev localhost
Run Code Online (Sandbox Code Playgroud)