contain_subject returning all email
I feel like I must have misread the manual - I have a mailbox (with about 3,000 messages). I'm running the following and for certain strings it returns all email in the inbox:
search_result = from:contain_subject(by[i]):
C (3): 1051 UID SEARCH ALL S (3): 1051 OK UID SEARCH completed C (3): 1052 UID SEARCH ALL SUBJECT "Access Token" S (3): 1052 OK UID SEARCH completed 2 messages moved from XXX/INBOX to XXX/INBOX/Focused.
C (3): 1057 UID SEARCH ALL S (3): 1057 OK UID SEARCH completed C (3): 1058 UID SEARCH ALL SUBJECT "Access Code" S (3): 1058 OK UID SEARCH completed Warning: More than 50 messages found for: Access Code. Total messages: 3415/3415
Unfortunately some email servers don't play well with the IMAP standards, and their searching functionality is not fully implemented or not working correctly.
If you didn't manage to workaround this problem some other way, I could only suggest using match_subject() instead. But note that this function will fetch the Subject header line from all 3415 messages in order to do the searching locally. And although it will cache the fetched header lines, the cache is in memory, so it will be lost once imapfilter exits.