K-9: Search from server

Created on 12 Mar 2018  Â·  7Comments  Â·  Source: k9mail/k-9

Expected behavior

When you do a search and tell it to look on the server for more it should be pulling up all related email.

Actual behavior

90% of the time when you tell it to search the server it gives you the message that it is doing so but then the message disappears and no additional new emails show dispite there being many. Giving it time to sync does not help. This has been an issue for at least a year. Also happens on my wife's phone.

Steps to reproduce

  1. Hit search and put in a term and it brings up what's currently on the phone.
    2.hit the search icon on bottom left with the cloud in it (server search enabled in settings)
  2. Wait and nothing happens 90% of the time.

Environment

K-9 Mail version: current Android play store

Android version: 7.1.1

Account type (IMAP, POP3, WebDAV/Exchange):imap

bug

All 7 comments

Same problem on two different email providers, I had this problem years ago with hotmail too just remove the button if it doesnt work!

That doesn't help when you need to search that information

Get Outlook for Androidhttps://aka.ms/ghei36


From: regulator-g notifications@github.com
Sent: Tuesday, June 19, 2018 9:43:26 AM
To: k9mail/k-9
Cc: ufdemt15; Author
Subject: Re: [k9mail/k-9] Search from server (#3254)

Same problem on two different email providers, I had this problem years ago with hotmail too just remove the button if it doesnt work!

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHubhttps://github.com/k9mail/k-9/issues/3254#issuecomment-398403352, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AjlWPANBv-cwqPDOyZEQI31uL9-Ji8BOks5t-P_-gaJpZM4Sni6C.

For me it works perfectly reliable, e.g. with gmail, gmx, and all Dovecot installations I use. The only setting I, a bit surprisingly, had to take care of was Account Settings -> Fetching Mail -> Sync messages from. The fetching/syncing of the bodies of the found mails also respects that setting, so that it's better set to any time (no limit) if you want to use server side search. However, that doesn't seem to solve the problem if no messages are found in the first place.

Morckx it sounds like you are downloading all your mail avoiding the "search on server" problem

Morckx it sounds like you are downloading all your mail avoiding the "search on server" problem

😀 sounds look a nice workaround, but no. The message headers are definitely received by "search on server" and correctly displayed. The message contents, however, are only correctly received and displayed if they match the Sync messages from restriction.

I also think I have been confused by this bug. My problem:

  • use search (magnifying glass icon)
  • enter search term
  • press server side search
  • message headings appear
  • select a message
  • no body appears

On the server side (dovecot), I can see the system continually re-fetching the same message over and over:

2129 NOOP
2130 SELECT "INBOX"
2131 UID FETCH 53482 (UID FLAGS INTERNALDATE RFC822.SIZE BODY.PEEK[HEADER.FIELDS (date subject from content-type to cc reply-to message-id references in-reply-to X-K9mail-Identity)])
2132 NOOP
2133 SELECT "INBOX"
2134 UID FETCH 53482 (UID FLAGS INTERNALDATE RFC822.SIZE BODY.PEEK[HEADER.FIELDS (date subject from content-type to cc reply-to message-id references in-reply-to X-K9mail-Identity)])
2135 NOOP

The server is responding with message headers and no body.

I got the desired behaviour by changing the setting given by @morckx, above: Account Settings -> Fetching Mail -> Sync messages from. Changing this to no time limit (previously it was 2 weeks), and selecting the message resulted in the body appearing, as expected.

I have not looked into the code, but intuitively this suggests the client is filtering out the fetching of older message bodies, but doing so at too low a level; such that it affects requests to directly fetch a message, eg. in search results.

This should be fixed with #4385

Was this page helpful?
0 / 5 - 0 ratings

Related issues

D0ve picture D0ve  Â·  3Comments

SpatMan05 picture SpatMan05  Â·  3Comments

asbach2 picture asbach2  Â·  3Comments

frederiiiic picture frederiiiic  Â·  3Comments

BerndErnst picture BerndErnst  Â·  3Comments