IMAP search command failed for specific fields

162 views Asked by At

I want to write a script to auto-detect and unsubscribe newsletters for me. I tried to achieve it using IMAP search command for fields like List-Unsubscribe, but the server merely returned search success with nothing else.

I tested on both Gmail and yahoo mail and they shared the same behavior. But searching for common fields like From, To and Subject all succeeded.

So is it the result of different server implementations of IMAP? Does it mean that if I want to get all mails with list-unsubscribe field, I have to fetch every mail's header and search locally? Thanks in advance!

0

There are 0 answers