Created
March 5, 2025 21:30
-
-
Save sr2ds/0383b0e82d0b52e939c8f7f6f7dd03c1 to your computer and use it in GitHub Desktop.
VRFY SMTP async
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import smtplib | |
import time | |
import concurrent.futures | |
smtp_server = "10.129.217.194" | |
port = 25 | |
def get_email(email): | |
with smtplib.SMTP(smtp_server, port) as server: | |
print('trying to get', email) | |
code, response = server.docmd("VRFY", email) | |
if code == 252: | |
return email | |
with open("lista.txt", "r") as f: | |
emails = f.read().splitlines() | |
with concurrent.futures.ThreadPoolExecutor() as executor: | |
futures = [] | |
for index, email in enumerate(emails): | |
futures.append(executor.submit(get_email, email)) | |
for future in concurrent.futures.as_completed(futures): | |
result = future.result() | |
if result: | |
print('===========') | |
print(result) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment