Advertisement
Guest User

Untitled

a guest
Jan 1st, 2019
1,572
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.19 KB | None | 0 0
  1. import smtplib
  2. import gmail
  3. f = open("Bridges.txt", "a+")
  4. emails = {
  5.     "email1@gmail.com":"password"
  6.     "email2@gmail.com":"password",
  7.     "email3@gmail.com":"password",
  8.     "email4@gmail.com":"password",
  9.     "email5@gmail.com":"password",
  10.     "email6@gmail.com":"password",
  11.     "email7@gmail.com":"password",
  12. }
  13. for gmail_user, gmail_password in emails.iteritems():
  14.     sent_from = gmail_user  
  15.     to = ['bridges@bridges.torproject.org']  
  16.     subject = ''
  17.     body = 'get transport obfs4'
  18.     email_text = """\
  19. From: %s  
  20. To: %s  
  21. Subject: %s
  22.  
  23. %s
  24. """ % (sent_from, ", ".join(to), subject, body)
  25.     server = smtplib.SMTP_SSL('smtp.gmail.com', 465)
  26.     server.ehlo()
  27.     server.login(gmail_user, gmail_password)
  28.     server.sendmail(sent_from, to, email_text)
  29.     server.close()
  30.  
  31.     g = gmail.login(gmail_user, gmail_password)
  32.     email = g.inbox().mail(unread=True, sender="bridges@torproject.org")
  33.     while len (email) < 1:
  34.         email = g.inbox().mail(unread=True, sender="bridges@torproject.org")
  35.     email = email[0]
  36.     response = email.fetch()
  37.     for item in str(response).split("Here are your bridges:")[1].split("To enter bridges into Tor Browser,")[0].split("\r\n"):
  38.         f.write(item.strip() + "\r\n")
  39.     email.read()
  40.     g.logout()
  41. f.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement