How to search and fetch based on Keywords(Custom flags) in IMAP ?

0 votes
asked May 28, 2016 by Sigamani (480 points)

I assigned custom flag keywords for a mail. And I need to search based on the keywords assigned

Applies to: Rebex Secure Mail

1 Answer

+1 vote
answered May 30, 2016 by Lukas Matyska (43,890 points)
selected May 31, 2016 by Sigamani
 
Best answer

To search based on the keywords use the Search method with the ImapSearchParameter.Keyword parameters.

Please visit Message Keywords sample code on our IMAP features page.

commented May 30, 2016 by Sigamani (480 points)
Yahoo n Outlook doesn't support keywords.

Will iCloud and Rediff support Keywords ?
commented May 31, 2016 by Sigamani (480 points)
How to get Messages based on only  Message ID as parameter
commented May 31, 2016 by Lukas Matyska (43,890 points)
To find a message with specified Message ID, use the Search method like this:
  imap.Search(ImapSearchParameter.Header("Message-ID", "your-ID-here"))

This call returns a collection of all messages with the specified Message ID.
Please note that Message ID is not unique - i.e. more messages on the IMAP server can have same Message ID
commented Jun 2, 2016 by Sigamani (480 points)
I have given like this

ImapMessageCollection Msgsearch =  imap.Search(ImapSearchParameter.Header("MessageId", "CAGB00=92manEQqA4PK2bVbCrDEQ9oLMUv+g1g7QvmH=Mausqew@mail.gmail.com"));

But getting Count=0 in MsgSearch Message Collection
commented Jun 2, 2016 by Lukas Matyska (43,890 points)
Please note that the header name is "Message-ID" not the "MessageId". Try to change your code to:

ImapMessageCollection Msgsearch =  imap.Search(ImapSearchParameter.Header("Message-ID", "CAGB00=92manEQqA4PK2bVbCrDEQ9oLMUv+g1g7QvmH=Mausqew@mail.gmail.com"));
commented Jun 3, 2016 by Sigamani (480 points)
Have any Working  Code to Maintain IMAP  IDLE  for Notification . Please Share
...