Searching IMAP inbox for messages from a specefic

2019-07-04 02:36发布

Is it possible to use wildcards in searching for a specific sender on IMAP folder?

typ, data = M.SEARCH(None, 'from','"security@website*"')

标签: python imap
1条回答
等我变得足够好
2楼-- · 2019-07-04 03:03

IMAP RFC 3501 6.4.4:

In all search keys that use strings, a message matches the key if the string is a substring of the field. The matching is case-insensitive.

So you need to search without * and you should almost similar result. (you get security@website ...)

查看更多
登录 后发表回答