jstedfast/MailKit

SearchQuery for Message-ID / References??

tinmac opened this issue · 1 comments

Hi, i'm Looking to create a List<UniqueId> of any messages where we find @agy- in the Message-Id or References field of INBOX emails.

I note I can do this

var query = SearchQuery.FromContains("anyone@gmail.com");
var summariesToMove1 = InboxFolder.Search(SearchOptions.All, query);

But can we search on Message-ID and References?

You can probably do something like this:

var query = SearchQuery.HeaderContains ("Message-ID", "@agy-").Or (SearchQuery.HeaderContains ("References", "@agy-");
var summariesToMove1 = InboxFolder.Search(query);