电子邮件验证MX Lookup [英] Email validation MX Lookup
问题描述
我被要求在网络应用程序上实施一些电子邮件地址验证 - 我相信我们已经有一千次了...但是,这次我被要求在域上进行MX查询看看它是否接受电子邮件。
I have been asked to implement some email address validation on a web app - I'm sure we've all been there a thousand times... however, this time I have been asked to do an MX Lookup on the domain to see if it accepts emails.
有没有人知道这样做有什么潜在的问题?一个mx查询是一个可靠的方式来查找一个域是否接受电子邮件?有没有一个有效的电子邮件地址可能无法进行MX查询检查的边缘案例?
Does anyone know of any potential problems with doing this? Is an mx lookup a reliable way of finding out if a domain accepts email? are there any edge cases where a valid email address could fail an MX lookup check?
感谢您的建议!
推荐答案
是否有任何边缘案例,有效的电子邮件地址可能会失败MX查找检查? / p>
are there any edge cases where a valid email address could fail an MX lookup check?
是的,在没有MX记录的情况下,MTA会回到使用A记录。因此,只允许MX记录将失败一类在现实世界中工作的邮件服务器。
Yes, in that where there is no MX record, MTAs fall back to using the A record instead. So only allowing MX records would fail a class of mail servers that work in the real world.
允许使用MX 或的记录至少可以检测到明显的错误导致NXDOMAIN。然而,仍然会导致在寮屋地点造成的错误。 A记录解决的地址的另一步可能是检查25号端口在哪个地址上接受连接。
Allowing any name with an MX or A record at least detects obvious mistypings that result in NXDOMAIN. However it will still allow mistypings that end up at squatter sites. A further step for addresses resolved by A records might be to check where port 25 is accepting connections on that address.
这篇关于电子邮件验证MX Lookup的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!