开发者

Email Validation using MX

开发者 https://www.devze.com 2023-01-26 03:40 出处:网络
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).

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 requ开发者_JS百科est 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


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.)

0

精彩评论

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