2017-03-01 92 views
0

我试图用exchangelib登录到exchangeserver。 当我尝试运行该脚本时,它给了我一个错误: 文件“/usr/local/lib/python3.5/dist-packages/exchangelib/protocol.py”,第61行,在init assert isinstance(证书) 声明错误python3 exchangelib凭证

从我所能理解的情况来看,这表示我的凭证variabel不是正确的类型。我已尝试使用和不使用自动发现功能。我犯了同样的错误。 这里是相关的代码。

credents = Credentials(username='domain\\aaa.fh', password= 'password'), 

    config = Configuration(server='domain.aaa.no', credentials= credents) 

    account = Account(
      primary_smtp_address='[email protected]', 
      config=config, 
      autodiscover=True, 
      access_type=DELEGATE) 

回答

0

试试这个方法:

config = Configuration(
        server='mail.example.com', 
        credentials=Credentials(username='Domain\username', password='password'), 
        auth_type=NTLM 
        ) 
account = Account(primary_smtp_address='[email protected]', config=config, 
          access_type=DELEGATE) 
0

这是由于在第一行可怕的Python后面的逗号,其中“有益”将您的credents可变进Credentials元组。