使用Anaconda2-5.0.0-Windows-x86_64,Python2.7,Exchangelib 1.10.4
我正在尝试保存来自交换帐户的所有电子邮件的附件。看来我可以毫无问题地连接到该帐户,但是每次我尝试执行该过程时,都会出现一条错误消息。这是我尝试过的代码:
mailbox = account.inbox
for msg in mailbox.all():
for attachment in msg.attachments:
fpath = os.path.join(r'C:\temp', attachment.name)
with open(fpath, 'wb') as f:
f.write(attachment.content)
我得到的错误是:
'FieldURI'属性无效-根据其数据类型'http://schemas.microsoft.com/exchange/services/2006/types:UnindexedFieldURIType',值'item:IsAssociated'无效-枚举约束失败。
该收件箱上的邮件包含CSV文件附件,该邮箱当前已存储23条邮件。
最佳答案
连接到Exchange 2007服务器时,这是exchangelib中的错误。已在https://github.com/ecederstrand/exchangelib/commit/8561bd0f3e6bfd7c8d01bc57cbcc3dca3cf33fc4和https://github.com/ecederstrand/exchangelib/commit/3609fa23e403821bdc5f80cd896a9df1d73f0275中修复