Archived Forum Post

Index of archived forum posts

Question:

imap.search question

Jul 18 '16 at 08:28

Hi, my question belongs to imap.search component.

I'm having a program running which graps all new emails via imap.Search("NEW",1)

The program is not disconnecting from the imap server, instead connection keeps alive so imap.Search is called again and again on every iteration of the program.

The search looks like that:

ChilkatLog:
  Search:
    DllDate: Dec 29 2015
    ChilkatVersion: 9.5.0.55
    UnlockPrefix: XXX
    Username: XXX
    Architecture: Little Endian; 64-bit
    Language: Windows Java
    VerboseLogging: 0
    criteria: NEW
    criteriaUtf8QP: NEW
    connectedTo: XXX
    selectedMailbox: Inbox
    bUid: 1
    Command: aaad UID SEARCH NEW
    numMessages: 0
    Success.
  --Search
--ChilkatLog

NEW ITERATION:

0

ChilkatLog:
  Search:
    DllDate: Dec 29 2015
    ChilkatVersion: 9.5.0.55
    UnlockPrefix: XXX
    Username: XXX
    Architecture: Little Endian; 64-bit
    Language: Windows Java
    VerboseLogging: 0
    criteria: NEW
    criteriaUtf8QP: NEW
    connectedTo: XXX
    selectedMailbox: Inbox
    bUid: 1
    Command: aaae UID SEARCH NEW
    numMessages: 0
    Success.
  --Search
--ChilkatLog

NEW ITERATION:

0

ChilkatLog:
  Search:
    DllDate: Dec 29 2015
    ChilkatVersion: 9.5.0.55
    UnlockPrefix: XXX
    Username: XXX
    Architecture: Little Endian; 64-bit
    Language: Windows Java
    VerboseLogging: 0
    criteria: NEW
    criteriaUtf8QP: NEW
    connectedTo: XXX
    selectedMailbox: Inbox
    bUid: 1
    Command: aaaf UID SEARCH NEW
    numMessages: 0
    Success.
  --Search
--ChilkatLog

I'm confused from the "Command line" in this example like the last command: "aaaf UID SEARCH NEW"

What is this ID doing here?

Because when I'm doing a shutdown of the program, everything will be closed and also a disconnect of the imap server will be done and at that point chilkat is doing some kind of closing? for each search request?!

like that:

aaad OK SEARCH completed.
----IMAP REQUEST----
aaae UID SEARCH NEW
----IMAP RESPONSE----
* SEARCH
aaae OK SEARCH completed.
----IMAP REQUEST----
aaaf UID SEARCH NEW
----IMAP RESPONSE----
* SEARCH
aaaf OK SEARCH completed.
----IMAP REQUEST----
aaag UID SEARCH NEW
----IMAP RESPONSE----
* SEARCH
aaag OK SEARCH completed.
----IMAP REQUEST----
aaah UID SEARCH NEW
----IMAP RESPONSE----
* SEARCH
aaah OK SEARCH completed.
----IMAP REQUEST----
aaai UID SEARCH NEW
----IMAP RESPONSE----
* SEARCH
aaai OK SEARCH completed.
----IMAP REQUEST----
aaaj UID SEARCH NEW
----IMAP RESPONSE----
* SEARCH
aaaj OK SEARCH completed.
----IMAP REQUEST----
aaak UID SEARCH NEW
----IMAP RESPONSE----
* SEARCH
aaak OK SEARCH completed.
----IMAP REQUEST----
aaal UID SEARCH NEW
----IMAP RESPONSE----
* SEARCH
aaal OK SEARCH completed.
----IMAP REQUEST----
aaam UID SEARCH NEW
----IMAP RESPONSE----
* SEARCH
aaam OK SEARCH completed.
----IMAP REQUEST----
aaan UID SEARCH NEW
----IMAP RESPONSE----
* SEARCH 538
* 1 RECENT

As this can take a while (depends on the time the program was running) my questions is how to avoid this?

Thanks a lot!