login about faq

I need to search emails that are not from a Domain (I already do this) and that are not replies of emails.

I use CkImap_Search , and for the search Criteria I will use fristCriteria + « AND » and the secondCriteria.

I need you feedback( for the secondCriteria) of the best way to filter message that are replies.

I was thinking of subject begining with ‘Re : ‘ but that’s maybe not the clever way to check this.

What’s your thought ?

asked Oct 08 '17 at 08:29

chilkat's gravatar image

chilkat ♦♦

One possibility is to search for the presence of the "In-Reply-To" header field. Usually, an email that is a reply will contain this header. For example:

In-Reply-To: <eaa8317f-fe33-7279-5b9b-f32dd5b32531@something.com>
You should be able to use the HEADER keyword in the search expression. (Remember, the Search Expression you pass to the IMAP server is not interpreted by Chilkat. It is passed directly to the IMAP server. The rules for the IMAP search expressions and how they are (or should be) interpreted by an IMAP server are described in RFC 3501, and this is reproduced in the Chilkat reference documentation. But beware, different IMAP server implementations may behave differently, or may implement only subsets of the SEARCH functionality. (For example, full-text BODY searches may be limited for the fact that searches on huge mailboxes would result in heavy loads on the server.)


answered Oct 08 '17 at 08:40

chilkat's gravatar image

chilkat ♦♦

edited Oct 08 '17 at 08:41

Thanks Mat for your reply. In my case I don't know the reply because I want to exclude all replyed mails. Do something like NOT HEADER In-Reply-To "" should work ? Best regards


answered Oct 09 '17 at 03:41

ads's gravatar image


edited Oct 09 '17 at 08:44

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported



Asked: Oct 08 '17 at 08:29

Seen: 3,142 times

Last updated: Oct 09 '17 at 08:44

powered by OSQA