IntroductionThis page will introduce you to the concepts behind the advanced e-mail validation. Function overviewTo give you an first glimpse how the e-mail Validator works, we will start with a UML sequence diagram:
As you can see the Validator uses three key classes to perform the validation. A MailAddressFactory to create an instance of MailAddress, a Resolver to fetch the MX entries from the DNS and an AccountQuery to ask the mail servers for the existence of the e-mail account. - Call the create(...) method on the MailAddressFactory to create a MailAddress.
- Get the domain from the mail address and resolve the MX records from the domain name system.
- Iterate over all MX entries from the DNS:
- Connect to the SMTP server on port 25.
- Start negotiation with the SMTP server. The e-mail validator will pretend the transmission of an e-mail.
- Return the result to the caller
ConclusionAs you can see a complete e-mail validation cycle ValidatorService will perform at least two network requests. If a domain has more than one MX entry (google returned five) and some of them don't respond, the number of network requests may rise. So be aware of the performance and network impact if you initiate the validation process.
|