使用 MX 进行电子邮件验证
需要实现电子邮件验证来确定电子邮件是否确实存在。经过一番搜索后发现,由于使用了垃圾邮件控制技术(例如灰名单),这是不可能的。
因此,进行了 MX 和 A 属性检查(因为我们不允许直接发送确认邮件):
DirContext ictx = new InitialDirContext(); 属性 attrs = ictx.getAttributes("gmail.com", 新字符串[] {"MX"});
我得到了结果,但不确定 dns 查找在这里是如何工作的(请求和响应的完整背景,即请求如何转发到邮件交换服务器以及哪个端口用于联系邮件交换)服务器)
这将极大地帮助您进入生产环境,而不会对网络行为产生任何疑问,因为我们有严格的防火墙限制。
生产环境:Solaris 操作系统上的 Weblogic Server。
类似的讨论位于 电子邮件验证 MX 查找,但没有足够的详细信息
Need to implement the email validation to find if the email really exists. After some search found that the this is not possible due to the spam control techniques used (e.g. grey listing).
So moved with MX and A attribute check (as we are not allowed to send confirmation mails directly):
DirContext ictx = new InitialDirContext();
Attributes attrs = ictx.getAttributes("gmail.com",
new String[] {"MX"});
I am getting the results but not sure how the dns lookup works here (the complete background of the request and response i.e how the request is forwarded to the mail exchange server and also which port is used for the contacting the Mail Exchange server)
This will immensely help in moving into the production env without any doubts about the network behavior as we are having strick firewall restrictions.
Production Env : Weblogic Server on Solaris OS.
Similar dicussion is at Email validation MX Lookup but it doesnt have enough detail
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
听起来您混淆了两种不同的技术:
1) 执行 DNS 查找以确保域存在 MX 记录。这将消除假(即未注册)域中的所有电子邮件地址。但请注意,拥有 MX 记录并不是合法邮件接收的必要条件。如果没有 MX 记录,邮件软件将仅使用基本域的 A 记录。
2) 与收件人邮件服务器建立 TCP 连接以查看是否有任何内容正在侦听。这始终是端口 25。您不必发送测试消息,只需连接到该端口即可,然后立即断开连接。成功的连接意味着有效的电子邮件地址。 (或者至少是一个有效的域名,这是您可以验证的尽可能多的域名。)
It sounds like you're confusing two different techniques:
1) Perform a DNS lookup to ensure that an MX record exists for the domain. This will eliminate all email addresses at fake (i.e., not registered) domains. Note however that having an MX record is not a requirement for legitimate mail reception. In the absence of an MX record, the mail software will simply use the A record for the base domain.
2) Make a TCP connection to the recipient mail server to see if anything is listening. This is always port 25. You don't have to send a test message, you can just connect to the port and then immediately disconnect. A successful connection implies a valid email address. (Or at least, a valid domain, which is as much as you can verify.)