-
Notifications
You must be signed in to change notification settings - Fork 263
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Force pre-fetch (aka mirror) complete IMAP server-content (account) #2621
Comments
*note: |
We store all relevant headers (the envelopes) but not the structure (the body) |
Interesting, so the primary difference between this and what (for example) outlook does is cachine the body. That would be more complex than I thought. None the less an interesting idea. |
Correct. And I would refrain from caching the bodies in the database. This would bloat it unnecessarily. Instead, we should try to use the memcache as much as possible and if feasible prepopulate it in a cron job so data is loaded faster when the user requests it. |
@ChristophWurst Wildcard queries on big portions of text in many-row tables doesn't seem the best idea indeed, mysql seems to be quite inefficient used that way. Prepopulate the memcache is a great idea, till you hit GB's of emails. That way the user can reload most of the cache from disk after (for example) a reboot, instead of IMAP. |
The simplest strategy would just be to cache messages as they come in and when the user visits them individually. They are immutable, so caching is quite simple to do. |
The problem is search: Your solution would work great, IF i would've recieved all emails mentioning John during that nextcloud/cache session. Which would obviously often not be the case. So that would require me to prefetsh the whole 3GB every boot. Which wouldn't be an issue with the IMAP server locally, but with an off-site IMAP server even this is troublesome. Thats why I like the way Outlook prefetches everything including body, it enables search as if I was working on the server locally. |
Please see https://help.nextcloud.com/t/call-for-testers-mail-v1-3/75825. We'd appreciate if you could help us test the upcoming release ✌️ |
Great work!! @ChristophWurst May I suggest to cache email body like iPhone does? For me it would make perfect sense to cache emails (or entire Thread if it has 1 new email) within a week for how I work, maybe 2 weeks when I'm on holidays. And I don't think I've ever read anything that's more than 90 days. This way you can avoid bloated DB? What do you guys think? |
I also noticed that preview text is null or empty string in the db while it's set for 255 characters, is that the correct behavior? |
I worked on that for #2628 but I couldn't find an easy way to extract the subject from HTML emails, hence this is unused right now. We want to show the preview text here #2666 |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Feature Request
Simply put:
Even with caching, searching extremely big mailboxes on remote IMAP servers is a chore.
Make it like a normal client like outlook and download-all-the-things.
Enable us (admins) to fetch a complete copy of the IMAP server (account) and store it locally for fast searches.
This prevents issues with big IMAP servers on slower connections and timeouts. (see below for a usecase).
Summary
it might be worthwhile to add button/feature to force download the whole imap account. Because there is a case where querying an IMAP server isn't feasable:
IMAP server is external
Pipe to the imap server isn't too big (lets say 10MB/s)
IMAP server contains GB's (lets say 4GB) of small emails
Even preloading all email from the server takes a few hours, but queries to the IMAP server might take a LONG time as well. (minutes)
If we add to this the following situation:
Using a reverse proxy or other execution time limiter
We end up with 504 A LOT, because the proxy or other limiter isn't going to accept minutes of wait time to finish such a query.
If we, as admin, could force Nextcloud to preload the whole IMAP account, this would be sped up even byond this PR and should be relatively easy to add even within scope of this PR.
Implementation proposal
Considering #2064 most of the backend to store these large(ish) amounts of mail are already there. It just needs a big fat button and some stitches it seems.
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
The text was updated successfully, but these errors were encountered: