退信內容
Sorry, we were unable to deliver your message to the following address.
xxxxxxxxxxx@XXXX.com.tw:
No MX records for XXXX.com.tw
yahoo一直被退信,gmail就沒問題請問yahoo的MX records是什麼?跟公司的DNS有關嗎?
打電話給客戶,請客戶找該公司的MIS,增加MX Record呀!
c:\nslookup
server dns.hinet.net
set type=MX
gmail.com
bot.com.tw
XXXXX.com.tw
exit
你可以觀察一下,上面三個domain,若是輸入gmail.com,應該會出現MX資料
而輸入bot.com.tw,卻沒有
當然,你也可以輸入你客戶的Domain囉!
依據RFC2821的規範,mail server要寄信到特定domain的話會先透過DNS查詢有沒有MX RR,若有MX RR就再查詢其MX有無A RR,若有就往該IP address送,若沒有MX RR但有A RR則往A RR的IP address送,下圖中的3p.club.tw只有MX RR,而其MX也有A RR,所以xxx@3p.club.tw的mail最後會往60.251.148.121送,但w3.3p.club.tw只有A RR而沒有MX RR,若Yahoo在寄mail給xxx@w3.3p.club.tw時只看MX RR而忽略A RR時可能就會發生您說的狀況,只是您沒有說明XXXX.com.tw到底為何,所以鵝也只能瞎猜了
No MX records for XXXX.com.tw
SMTP是不管MX的, MX是給POP3/IMAP用的. 因此對於SMTP(寄信)來說, 不需要知道MX紀錄的, 一般沒有SMTP會去管收件者是否有正確的MX紀錄, 很奇怪的是, Yahoo!會去檢查MX紀錄, 可能是因為被Aabaco Small Business買走的關係吧?
20170519T1618修正:
SMTP可以不管MX紀錄的
R U sure?? SMTP server就是根據MX決定mail routing的,而一般MUA怎麼連上mail server跟MX RR也沒關係吧....
請看implicit MX:
https://tools.ietf.org/html/rfc5321#section-5
If an empty list of MXs is returned,the address is treated as if it was associated with an implicit MX RR, with a preference of 0, pointing to that host.
應該修正為:
SMTP可以不管MX紀錄. 這也是為什麼Gmail和其他Email Server會正確收信. TCP/IP應該是中性的, 不需知道應用服務. 而MX是一種應用服務. 所以現代Email Server採用Implicit MX.
可是根據RFC的要求,mail routing是以MX RR為主,A RR只應該在沒有MX RR時才可以被拿來當成MX的代用品啊....
請看RFC2821的原文,只要有MX RR的話SMTP server是不可以先查詢A RR的,所以爭論說是不是一定要有MX RR才收得到mail其實沒啥意義就是了....BTW,鵝剛試著從Yahoo寄mail到xxx@w3.3p.club.tw會收到No MX RR的退信,而xxx@3p.club.tw是正常的,可見Yahoo的確是忽略掉了只要有A RR也可以寄信這點了....
The lookup first attempts to locate an MX
record associated with the name. If a CNAME record is found instead,
the resulting name is processed as if it were the initial name. If
no MX records are found, but an A RR is found, the A RR is treated as
if it was associated with an implicit MX RR, with a preference of 0,
pointing to that host. If one or more MX RRs are found for a given
name, SMTP systems MUST NOT utilize any A RRs associated with that
name unless they are located using the MX RRs; the "implicit MX" rule
above applies only if there are no MX records present.
Gmail可以寄到. 因為Implicit MX, 我只是解釋為什麼Gmail寄到而Yahoo!會錯誤. 但實務上, 都會設MX.
證明了Yahoo!並未遵循RFC 2821.
寫得好複雜,所以有解決的方法嗎?謝謝回覆!
加上MX紀錄啊
就是因為複雜, 我通常都跟客戶說SMTP發生錯誤時不需看MX紀錄. 但您的案例是Yahoo!處理MX紀錄的問題, 這種幾乎不會發生的問題發生了.
(刪除混淆的例子)
implicit MX是指只有A RR時,SMTP server會把A RR視為priority為0的MX,直接把mail往那個IP送,應該不是您所說的意思吧....
在RFC 5321中的確是這樣說:If an empty list of MXs is returned,the address is treated as if it was associated with an implicit MX RR, with a preference of 0, pointing to that host.
那是指如果找不到MX紀錄的情況之下.
MX的確是用在SMTP收信, 而正常的Email Server一定會設MX紀錄, 只是沒有MX不會有問題.