I need to go through a gmail conversation and check if ALL of the emails that belong to this conversation , serve certain criteria.
Example: "Show me all the conversations that all emails reside ONLY in sent items and trash"
I am open to any solution in PHP, .NET (ASP.NET/Winforms)
Google uses a non-standard extension, the X-GM-THRID
for their conversations stuff. Using that, and somehow having obtained the X-GM-THRID
of the relevant thread, you can simply use that in the IMAP's SEARCH
command. Google also uses the "all messages" mailbox which contains all messages for your account and the X-GM-LABELS
for finding out to which of the IMAP folders that message is mapped.
See RFC 3501 for how to use the AND
operator in SEARCH
and just combine the keys mentioned above. The result is easy to use in any IMAP library.