Search Operations - WeOnlyDo Discussion board

Search Operations (wodSmtpServer / wodPop3Server / wodImapServer)

by nestorcastro, Friday, March 06, 2020, 20:32 (1733 days ago)

Hello,

How can I implement the search feature on my IMAP server?

My webmail client have a search box, and when i try to find some message with a given string, no messages is listed even when there is a message with this text.

See your debug log:

----------- NEW SESSION STARTED ------------
* OK [CAPABILITY IMAP4REV1] WeOnlyDo! COM Imap server version 2.4.6.163 ready.
A0001 LOGIN user@domain.com ****PASSWORD******
A0001 OK LOGIN completed
A0002 SELECT spam
* FLAGS (\Seen \Answered \Deleted \Flagged \Draft \Recent)
* 825 EXISTS
* 0 RECENT
* OK [UNSEEN 1] first unseen
* OK [UIDVALIDITY 1524526761] UIDs valid
* OK [PERMANENTFLAGS (\Seen \Answered \Deleted \Flagged \Draft)]
A0002 OK [READ-WRITE] SELECT completed
A0003 CAPABILITY
* CAPABILITY IMAP4REV1
A0003 OK CAPABILITY completed
A0004 UID SEARCH OR HEADER SUBJECT EXAMPLE HEADER FROM EXAMPLE
* SEARCH
A0004 OK UID SEARCH completed
A0005 LOGOUT


Which event is triggered?

Search Operations

by Jasmine, Saturday, March 07, 2020, 19:01 (1732 days ago) @ nestorcastro

Hi.

ReadMessage will be triggered for each message that corresponds to SEARCH query. Can you check for that event? You need to provide message body data, and wodImapServer will search in message contents if it matches requested search paramters.

Jasmine.

Search Operations

by Nestor Castro Junior, Sunday, March 08, 2020, 23:05 (1731 days ago) @ Jasmine

Jasmine, it is not clear to me what I am expected to do when this event is triggered. Could you give me a small example of what I should do to make the search work?

Hi.

ReadMessage will be triggered for each message that corresponds to SEARCH query. Can you check for that event? You need to provide message body data, and wodImapServer will search in message contents if it matches requested search paramters.

Jasmine.

Search Operations

by Jasmine, Monday, March 09, 2020, 06:44 (1730 days ago) @ Nestor Castro Junior

Hi.

You're not expected to do anything, except to feed the message when asked by the event to do so.

I can try to duplicate your problem and debug it to see why there's no results from the search as you expected them. How can I set up your environment? Any chance you can make small demo project and send it over to techsupport?

Regards,
Jasmine.

Search Operations

by Nestor Castro Junior, Monday, March 09, 2020, 18:11 (1730 days ago) @ Jasmine

Jasmine,

How do I identify that the event is requesting message data? How do I feed the message? Any specific method for doing this within this event?

I would have difficulty reproducing in a project, as I use the Roundcube client as webmail to connect to the IMAP server. In it I try to search for a term and hoped that messages with that term would be filtered out. But no message is displayed and I don't know if I should have programmed something to make the search return messages that match the search term.

Hi.

You're not expected to do anything, except to feed the message when asked by the event to do so.

I can try to duplicate your problem and debug it to see why there's no results from the search as you expected them. How can I set up your environment? Any chance you can make small demo project and send it over to techsupport?

Regards,
Jasmine.

Search Operations

by Jasmine, Monday, March 09, 2020, 22:48 (1730 days ago) @ Nestor Castro Junior

Hi.

How do you actually provide messages to wodImapServer? Where do you do Folder.Messages.Add? If you already added them, for example, in ListMessages, then ReadMessage will not fire if it already have the contents of the message.

If you can feed your messages to our "2. Full" example and duplicate the problem with it, it would be easiest way to ZIP and send it over so we can check it out.

Jasmine.

Search Operations

by Nestor Castro Junior, Friday, April 10, 2020, 20:26 (1698 days ago) @ Jasmine

Hello,

I found the problem. My private SMTP was modifying the message due to AddFromLine propetie set to True.

I changed to False and now it is working fine!

Hi.

How do you actually provide messages to wodImapServer? Where do you do Folder.Messages.Add? If you already added them, for example, in ListMessages, then ReadMessage will not fire if it already have the contents of the message.

If you can feed your messages to our "2. Full" example and duplicate the problem with it, it would be easiest way to ZIP and send it over so we can check it out.

Jasmine.