docker-magento2 icon indicating copy to clipboard operation
docker-magento2 copied to clipboard

Unable to send mail.

Open ashsmith opened this issue 9 years ago • 3 comments

I seem to be unable to send mail!

Steps to reproduce:

docker run --hostname="awesome.hostname.com" --name=phpfpmtest -d -e ENABLE_SENDMAIL=true meanbee/magento2-php:7.0-fpm
docker exec -it phpfpmtest php -r "mail('[email protected]', 'test', 'test');"

Then check the logs:

docker logs phpfpmtest
Starting Mail Transport Agent (MTA): sendmail.
[14-Feb-2017 11:22:08] NOTICE: fpm is running, pid 1
[14-Feb-2017 11:22:08] NOTICE: ready to handle connections
[14-Feb-2017 11:22:09] ALERT: oops, unknown child (68) exited with code 0. Please open a bug report (https://bugs.php.net).

The ALERT comes up after attempting to send mail.

Further debugging of /var/spool/mqueue/ led me to find the following: MDeferred: Name server: ashsmith.io.: host name lookup failure.

This made me think it was a configuration issue with my DNS. If I run dig ashsmith.io I get no MX records. Same with meanbee.com (I've also tried sending mail to my meanbee email).

Any ideas?

ashsmith avatar Feb 14 '17 13:02 ashsmith

I was able to reproduce this with the above commands.

I've dug a little more into this: https://askubuntu.com/questions/279371/deferred-name-server-host-name-lookup-failure-smart-host

MX records seem fine:

$ dig ashsmith.io MX

; <<>> DiG 9.8.3-P1 <<>> ashsmith.io MX
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 9296
;; flags: qr rd ra; QUERY: 1, ANSWER: 5, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;ashsmith.io.			IN	MX

;; ANSWER SECTION:
ashsmith.io.		299	IN	MX	1 aspmx.l.google.com.
ashsmith.io.		299	IN	MX	10 aspmx2.googlemail.com.
ashsmith.io.		299	IN	MX	10 aspmx3.googlemail.com.
ashsmith.io.		299	IN	MX	5 alt1.aspmx.l.google.com.
ashsmith.io.		299	IN	MX	5 alt2.aspmx.l.google.com.

So it seems obvious that the problem is DNS it's just a question of where and why. I was able to run ping against your domain name and that IP address was translated correctly:

$ ping ashsmith.io

PING ashsmith.io (54.231.82.201): 56 data bytes
64 bytes from 54.231.82.201: icmp_seq=0 ttl=61 time=90.930 ms
^C--- ashsmith.io ping statistics ---
1 packets transmitted, 1 packets received, 0% packet loss
round-trip min/avg/max/stddev = 90.930/90.930/90.930/0.000 ms

Not sure what the steps to resolve this are though.

punkstar avatar Feb 20 '17 08:02 punkstar

Hello , I have query help me proper suggestion , when we register customer in magento2 then I get " unable to send mail " error message ...

100rabhMisra avatar Jul 23 '17 19:07 100rabhMisra

Any update?

itsazzad avatar Apr 08 '19 13:04 itsazzad