php takes 1+ minute to send mail with sendmail & maildev
Asked Answered
B

1

9

Maildev is running with

maildev -s 25

PHP is setup with

[mail function]
SMTP = 127.0.0.1
smtp_port = 25

When I try to send mail (with PHPMailer), I see that sendmail is running:

0784 www-data   20   0  4508   748   672 S  0.0  0.0  0:00.00 sh -c /usr/sbin/sendmail -t -i  -oi [email protected]

And after about ~2mn, that process ends and mails are sent to Maildev.

I don't understand why mails are not directly sent to Maildev...

Brokenhearted answered 8/5, 2017 at 7:55 Comment(0)
B
10

I finally found it!

In my /var/logs/mail.log I had this error log:

My unqualified host name (hugo) unknown; sleeping for retry

Then 1 minute later :

Unable to qualify my own domain name (hugo) -- using short name

I fixed this error with https://askubuntu.com/a/436270/510570, by:

Setting a good FQDN in my /etc/hosts file:

127.0.0.1 hugo.example.com hugo 

And applying it:

sudo hostname hugo.example.com
Brokenhearted answered 22/6, 2017 at 11:10 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.