“NOT FROM”IMAP搜索与outlook.com的电子邮件无法正常工作

时间:2014-02-13 16:50:25

标签: python imap outlook.com

这是我在outlook.com上通过OAuth2进行的IMAP测试

# THIS IS CORRECT
ipdb> mail.criterion = '(FROM "ship-confirm@amazon.com")'
ipdb> mail.get_headers()
[('"Inbox"', [<mailengine.scrubber.IMAPScrubber object at 0x110c21650>, <mailengine.scrubber.IMAPScrubber object at 0x110c21290>, <mailengine.scrubber.IMAPScrubber object at 0x110c1f6d0>, <mailengine.scrubber.IMAPScrubber object at 0x110c1f950>, <mailengine.scrubber.IMAPScrubber object at 0x110c1f750>])]

 # THIS IS INCORRECT (we should have 3 emails)
ipdb> mail.criterion = '(NOT FROM "ship-confirm@amazon.com")'
ipdb> mail.get_headers()
[]

# TEST (correctly getting all emails)
ipdb> mail.criterion = '(NOT FROM "anyword")'
ipdb> mail.get_headers()
[('"Inbox"', [<mailengine.scrubber.IMAPScrubber object at 0x110c21290>, <mailengine.scrubber.IMAPScrubber object at 0x110c1f950>, <mailengine.scrubber.IMAPScrubber object at 0x110c1f850>, <mailengine.scrubber.IMAPScrubber object at 0x110c1f690>, <mailengine.scrubber.IMAPScrubber object at 0x110c1f6d0>, <mailengine.scrubber.IMAPScrubber object at 0x110c1f750>, <mailengine.scrubber.IMAPScrubber object at 0x110c1f810>, <mailengine.scrubber.IMAPScrubber object at 0x110c1f1d0>])]

# TEST (incorrectly getting 0 emails)
ipdb> mail.criterion = '(NOT FROM "anyword@gmail.com")'
ipdb> mail.get_headers()
[]

我的(不是那么狂野)猜测@符号正在打破NOT FROM搜索。也许我应该看看它?可怕的虫子?

0 个答案:

没有答案