Ubuntu – Sendmail very slow – /etc/hosts configuration


It takes ~15 seconds to send single e-mail using sendmail.


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



/etc/hosts:   piotr-probook localdev localhost router


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

Obviously I can ping piotr-probook host and HTTP server popups in browser when i type url http://piotr-probook

What am I doing wrong? How to fix the problem?

Best Answer

Got the answer at superuser.com https://superuser.com/a/626219/242163:

Sendmail requires that the result of "hostname" be a fully qualified domain name to start cleanly.

Set the hostname to something like piotr-probook.localdomain and update /etc/hosts.

/etc/hosts   piotr-probook.localdomain piotr-probook localdev localhost