Verifier provides a verification of email deliverablity and existance
over SOCKS proxy SMTP connection or normal SMTP connection.
Email Verifier uses the custom
SocksSMTP class which is a subclass of builtin SMTP class and
replaces the socket attribute with SOCKS proxy sockets if a proxy is provided.
The class acts as normal SMTP in case no proxy is provided.
How is email verified?
The best way to test deliverablity of an email address will be to actually send an email. But, we don't want to spam anyone's email just to test that.
Next best thing will be to try sending an email but close the connection just before completing the process.
Here are the steps how we do that.
- Create a connection with the SMTP sever for the given email (Provided the email is in valid format).
HELOto initialize the conversation with the server.
MAIL FROMto indicate the sender's address.
RCPT TOwith the email address to verify.
- Determine the deliverablity of the email based on the status of
- Close the connection.
Copy the verifier directory to your project
# use an appropriate path to import from verifier.verifier import Verifier # Use normal SMTP to connect to the server normal_verifier = Verifier(firstname.lastname@example.org') # No proxy results = normal_verifier.verify('email@example.com') # Use socks proxy to connect over SMTP socks_verifier = Verifier( firstname.lastname@example.org', proxy_type='socks5', proxy_addr='socks5.your-proxy-provider.com', proxy_port=1080, proxy_username='funky-username', proxy_password='crazy-password' ) results = socks_verifier.verify('email@example.com')
The verifier can also be run directly.
$ python3 verifier.py
Make sure your firewall allows outgoing connects on SMTP port.
This project have following external dependencies
I you find any bugs, please feel free to open an issue or send a pull request.