4

I setup a Vagrant Box (precice64) with PHP5.3 and try to send a mail with it, but it's real slow. I have a simple script like:

$ok = mail('me@domain.com', 'test', 'test');
var_dump($ok);

And execute it on the command line (or browser, makes no difference):

$ php mail.php

The mail gets sent, but the script takes like 30 seconds to a minute to execute! Anyone know what might be causing this delay?

Giel Berkers
  • 2,852
  • 3
  • 39
  • 58

2 Answers2

3

I solved it by following Glavić's link.

I edited /etc/hosts to include the hostname of my Vagrant Box (precise64):

127.0.0.1 localhost.localdomain localhost myhostname precise64

And added the folowing line to /etc/mail/sendmail.conf:

HostsFile=/etc/hosts

Now it's working like a charm!

Giel Berkers
  • 2,852
  • 3
  • 39
  • 58
1

add this entry to your hosts file: 127.0.1.1 fullyQualifiedHostname

Luis Carlos Chavarría
  • 3,861
  • 2
  • 25
  • 26