5 ms·
There is a middle ground ... I have had success using an approach like the one found in this Python library: http://pypi.python.org/pypi/validate_email http://p
by oinksoft 14y ago
There is a middle ground ... I have had success using an approach like the one found in this Python library: http://pypi.python.org/pypi/validate_email http://pypi.python.org/pypi/validate_email
It performs regex validation, and if that passes, tries to get the SMTP server to validate the user's presence. Quite useful for when a user might fat-finger their username in the address.
So, for compliant mail servers, sending an email without verifying receipt via some confirmation token is no more reliable than this method (if it will falsely validate the user, it will probably falsely digest the message as well).
- bjourne 14y agoBe careful as validating email addresses like that will quickly get you grey or blacklisted by various spam cops. The method works well for a few addresses, but you can't use it to validate thousands of addresses at the same time. I learnt that the hard way. :)
- oinksoft 14y agoThat makes a lot of sense ... a reliable way to determine if a user is real could easily be abused.
- mosselman 14y agoCould you expand on this? Why will it get you black listed? What kind of situation are we talking about? It would be pretty annoying to get black listed.
- natep 14y agoI imagine a spammer could generate plausible emails and then check them against SMTP servers to discover the valid ones if they didn't get blacklisted.
- sickpig 14y ago@work we have done a lot of this kind of validations using a custom Tcl script, and luckily we have avoided to be blacklisted till now. Maybe it's due to the fact that validation requests come from an IP address marked as MX for the domain of the sender email address. Anyway not all SMTP servers are RFC compliant, they respond with a 2XX code to a "RCPT TO" even if user/mailbox doesn't exists. The same thing applies also if the SMTP server is acting as a relay and has no immediate access to the delivering system.
- pvsnp 14y agoI check if there's indeed a mail server in DNS to avoid the hassle of waiting for potentially slow SMTP servers to respond - for most cases, it works and I end up catching bogus email addresses from the domain names themselves.
- emillon 14y agoA MX record is not necessary for a host to be able to receive email.
- oinksoft 14y agoNote that that library can also check for an MX server. It goes Valid string -> MX exists -> User exists (you can choose to only check for MX, or only for valid string).
- michaelmior 14y agoReally? How is mail routed then?
- emillon 14y agoIt should fall back to a A record. That's not exactly best practice, but if you're compliant that is something that you should be able to handle.