Skip to content

Instantly share code, notes, and snippets.

@sr2ds
Created March 5, 2025 21:30
Show Gist options
  • Save sr2ds/0383b0e82d0b52e939c8f7f6f7dd03c1 to your computer and use it in GitHub Desktop.
Save sr2ds/0383b0e82d0b52e939c8f7f6f7dd03c1 to your computer and use it in GitHub Desktop.
VRFY SMTP async
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