Email address verification without sending an email. #1472
ghost
started this conversation in
Feature suggestions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I just stumbled upon this nice script, wondering if it would be a good feature to be implemented in Postal.
https://github.com/sdwolfe32/trumail
How it Works
Verifying the deliverability of an email address isn't a very complicated process. In fact, the process Trumail takes to verify an address is really only half that of sending a standard email transmission and is outlined below...
First a TCP connection is formed with the MX server on port 25.
HELO my-domain.com // We identify ourselves as my-domain.com (set via environment variable)
MAIL FROM: [email protected] // Set the FROM address being our own
RCPT TO: [email protected] // Set the recipient and receive a (200, 500, etc..) from the server
QUIT // Cancel the transaction, we have all the info we need.
As you can see we first form a tcp connection with the mail server on port 25. We then identify ourselves as example.com and set a reply-to email of [email protected] (both these are configured via the SOURCE_ADDR environment variable). The last, and obviously most important step in this process is the RCPT command. This is where, based on the response from the mail server, we are able to conclude the deliverability of a given email address. A 200 implies a valid inbox and anything else implies either an error with our connection to the mail server, or a problem with the address requested.
The first 3 command steps above process happen here. Deliverability is checked here. Transaction is cancelled (QUIT) and the connection is closed here.
Beta Was this translation helpful? Give feedback.
All reactions