开发者

Why does php's mail() want to deliver to the second specified MX record?

This is very similar to this problem:

sendmail and MX records when mail server is not on web host

I have a php script on an IIS server called example.org. It sends mail() to somedude@example.com, which goes to a spam appliance and on to their Exchange server, but the mail never gets through. When I look in the logs there's an SMTP error saying user unknown or something, but the main point is that it's throwing an error as it's using the server specified in the second MX record, rather than the pri开发者_如何学编程mary one. Consistantly.

Did a nslookup and the machine can look up the DNS and get the correct data, what's going on?


The second MX should only be used when

  • the primary / first MX does not respond
  • the primary and the secondary have the same preference

You can verify this by using

dig ${YOURDOMAIN} MX

Also, please not that the secondary MX is refusing the connection with a non-fatal aka. temporary error 4xx.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜