这是我在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
搜索。也许我应该看看它?可怕的虫子?