hashbangcode / vlad

Vlad - Vagrant LAMP Ansible Drupal
173 stars 53 forks source link

Sending mails is very slow (sendmail) - My unqualified host name unknown; sleeping for retry #298

Closed twerthmueller closed 8 years ago

twerthmueller commented 8 years ago

Sending mails form the vlad box is really slow. In the mail.log i found the following message (biham is the defined hostname):

Nov 1 20:40:01 biham sm-msp-queue[16059]: My unqualified host name (biham) unknown; sleeping for retry Nov 1 20:41:01 biham sm-msp-queue[16059]: unable to qualify my own domain name (biham) -- using short name

In the /etc/hosts file I have the lines

127.0.0.1 localhost 127.0.0.1 biham biham

As soon as i change the hosts entry to one line and add localhost.localdomain like this,

127.0.0.1 localhost.localdomain localhost biham

the mails are sending fast, because sendmail can resolve the host. It seems to be important, that all names are on the same line.

Is it possible that the created /etc/hosts file adds the one line entry for 127.0.0.1?

Thanks, Thomas

philipnorton42 commented 8 years ago

Strangely enough I was thinking about adding a hosts file to the guest box just like you've described above. It should solve one or two other problems, not just the mail slowness. Some Drupal modules like to call the site to see if things are working as expected (advagg for example) and this module gets confused when it can't find the correct domain.

twerthmueller commented 8 years ago

Cool!

Thank you Philip for the great work!

philipnorton42 commented 8 years ago

So this is now in Vlad (dev branch currently). With the following settings in my Vlad config file:

# Webserver settings
  webserver_hostname: 'drupal.local'
  webserver_hostname_aliases:
  - 'www.drupal.local'
  - 'www.example.com'
  - 'www.something.com'

It now generates the following lines in the guest machines /etc/hosts file.

127.0.0.1 drupal.local
127.0.0.1 www.drupal.local www.example.com www.something.com

So, assuming that this change fixes the mail issue I'm going to close this issue. Thanks for reporting! :)