login about faq

Hi

New to ChilKat but hoping someone can help - I am probably doing something dumb

If I use imap.search with "ALL" as a criteria then it works fine and I can loop through the messageset and get all the info for the various emails. If however I try and be specific using SUBJECT or HEADER <field> or TEXT (or anything other than ALL) then it returns 0 messages - so in ALL I can show the subject (for example one email has a subject of Hello and I see that in the returned messageset for ALL) but if i then search SUBJECT Hello it returns 0 messages (and any other criteria does the same) - any help or thoughts appreciated! - its 9.5.0 32 bit via VBS - working ALL, non working Hello and lasterror shown below.

Not Working searchkey = "SUBJECT Hello"

          Set messageSet = imap.Search(searchkey,1)

Working searchkey = "ALL"

         Set messageSet = imap.Search(searchkey,1)
**ChilkatLog:**
  Search:
    DllDate: Mar 11 2014
    ChilkatVersion: 9.5.0.18
    UnlockPrefix: Anything for 30-day trial
    Username: SV-DLL-TRANSD02:bot_dmy
    Architecture: Little Endian; 32-bit
    Language: ActiveX
    VerboseLogging: 0
    criteria: SUBJECT Hello
    criteriaUtf8QP: SUBJECT Hello
    connectedTo: 130.4.111.90
    selectedMailbox: Inbox
    bUid: 1
    Command: aaad UID SEARCH SUBJECT Hello
    numMessages: 0
    Success.
  --Search
--ChilkatLog

asked Dec 07 '16 at 06:51

Dave's gravatar image

Dave
212

edited Dec 07 '16 at 16:24

jpbro's gravatar image

jpbro ♦
1.1k2619


The emails are stored on the IMAP server, and therefore it's the IMAP server that performs the actual search specified by the search criteria in the SEARCH command. An IMAP client, such as Chilkat, doesn't do the actual searching. It's simply sending the SEARCH command (with a criteria string), the IMAP server does the search, and returns the results.

The Chilkat Imap.Search method passes the search criteria argument unmodified to the IMAP server. The format/syntax of the criteria is specified by RFC 3501 (Section 6.4.4) -- See https://tools.ietf.org/html/rfc3501#section-6.4.4

Different IMAP servers may support different subsets of the SEARCH criteria specification. Also, it depends on the IMAP server as to what email content is actually indexed. In this case, the IMAP server is saying "Database is not full text indexed".

There's nothing that can be done from the client-side to make this particular search work. It's because the client simply sends the command and receives the IMAP server's results.

link

answered Dec 08 '16 at 07:43

chilkat's gravatar image

chilkat ♦♦
12.8k318391554

edited Dec 08 '16 at 07:44

Hi - Thanks for the reply.

I have downloaded and tried the latest version - the same result I am afraid (although it now returns as failed rather than 0 messages) - log below. I have also tried for example setting it as "SUBJECT ""Hello""" in case it is to do with quoting but the same result (and the same with message-id etc as well).

ChilkatLog:
  Search:
    DllDate: Nov 12 2016
    ChilkatVersion: 9.5.0.64
    UnlockPrefix: ADLTLLYIMAPMAILQ
    Architecture: Little Endian; 32-bit
    Language: ActiveX
    VerboseLogging: 0
    criteria: SUBJECT "Hello"
    criteriaUtf8QP: SUBJECT "Hello"
    connectedTo: 130.4.111.90
    selectedMailbox: Inbox
    bUid: 1
    Command: aaad UID SEARCH SUBJECT "Hello"
    Failed.
  --Search
--ChilkatLog
link

answered Dec 08 '16 at 05:21

Dave's gravatar image

Dave
212

UPDATE (and further question)

Turning on verbose logging gives me more (as below) - namely it responds with NO SEARCH Database is not full text indexed. What database is it talking about here - the mail server database? Are we saying that unless it is FTI it cannot perform a search?

ChilkatLog:
  Search:
    DllDate: Nov 12 2016
    ChilkatVersion: 9.5.0.64
    UnlockPrefix: ADLTLLYIMAPMAILQ
    Architecture: Little Endian; 32-bit
    Language: ActiveX
    VerboseLogging: 1
    criteria: SUBJECT "Hello"
    criteriaUtf8QP: SUBJECT "Hello"
    connectedTo: 130.4.111.90
    selectedMailbox: Inbox
    bUid: 1
    Command: aaad UID SEARCH SUBJECT "Hello"
    ImapCmdSent: aaad UID SEARCH SUBJECT "Hello"
    getCompleteResponse:
      ImapCmdResp: aaad NO SEARCH Database is not full text indexed
    --getCompleteResponse
    Failed.
  --Search
--ChilkatLog
link

answered Dec 08 '16 at 05:29

Dave's gravatar image

Dave
212

That's a pretty old version of the library (from 2014). I recommend trying with the latest version and see if the problem persists.

If not, please repost the log in <pre></pre> tags in case there is more information generated in the newer library.

link

answered Dec 07 '16 at 16:25

jpbro's gravatar image

jpbro ♦
1.1k2619

Have added a reply as another answer below - sorry if thats bad form!

(Dec 08 '16 at 05:22) Dave
Your answer
toggle preview

Follow this question

By Email:

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

By RSS:

Answers

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

Tags:

×190
×14
×6
×2

Asked: Dec 07 '16 at 06:51

Seen: 1,459 times

Last updated: Dec 08 '16 at 07:44

powered by OSQA