Skip to content

Instantly share code, notes, and snippets.

@sr2ds
Created March 5, 2025 21:30
Show Gist options
  • Select an option

  • Save sr2ds/0383b0e82d0b52e939c8f7f6f7dd03c1 to your computer and use it in GitHub Desktop.

Select an option

Save sr2ds/0383b0e82d0b52e939c8f7f6f7dd03c1 to your computer and use it in GitHub Desktop.

Revisions

  1. sr2ds created this gist Mar 5, 2025.
    26 changes: 26 additions & 0 deletions smtp.py
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,26 @@
    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)