Download Emails for faster reads?

Hi there,

I was wondering if Nextcloud is able to download emails as they come in? So I can read my emails instantly instead of the few seconds it takes for each and every email.

Is that possible through some settings? Or maybe it’s a addon in Nextcloud?

1 Like

No, this isn’t possible yet nor do I know if is a planned feature. Nevertheless you might think about creating a feature request in the GitHub repository of the app to address this functionality.

Download to you Nextcloud or your client? I think both makes no sense. If download to client use an email client.

You’re right that our database cache layer isn’t designed for email bodies. This would simply bloat the database. But I’ve been thinking about pre-populating memcache with new email as they arrive in the background. When the front-end then requests them, chances are high that a cached value could be used.

But this is just an idea, this needs a solid design and someone who implements it.

Hi, sorry if i reply on this old topic: after testing the mail app i saw in the database that there are lots of emails. It’s just the metadata (subject, date, senders) to speed up the browsing, or it’s fully downloaded?

Will it be cleaned after some days or it will persist in the database indefinitely, making the db backup bigger and bigger? I have some users with huge gmails with thousands and thousands of emails and I’m scared this would impact the performance of the database.

Because after i deleted the email account in the mail app the emails were still in the database - maybe they’ll be purged once in a while?

I tried to search this forum or the documentation but i did not find more info

I was curious and because it’s not documented I did some experiments with a small email account with 300 emails in inbox and 1700 emails in the trash

In the database they are all listed (only the title), all the 300 emails in inbox and all the 1700 emails in the trash, even if they are from more than one year ago, so it will persist indefinitely

During the indexing the database performance was severely impacted, other sites couldn’t even connect, (it’s a small VPS, though), and the mysql dump size increased 100% (from 2 mb of a virgin nextcloud install to 4 mb).

If an email is deleted, the database row will be deleted too, unless it’s moved in the trash. If it stays in the trash, it is kept in the database.

A big bug that i found if that the email account is deleted, the emails aren’t deleted from the database. If the user readds the same account, the emails are appended again (so, 2000 “useless” emails in the database from a now deleted account, and 2000 “new” emails from the new account). Delete and readd the account and now the emails in the database are 6000.

Ultimately, considering that it’s just a single account with a few emails, I found the performance unacceptable on my low-end VPS. Roundcube or snappymail doesn’t do this extensive caching yet they are much snappier. I wouldn’t imagine what would happen if a user connects his personal gmail with 50000 emails from the year 2004, or if ten or hundred users would do the same. Also, a bit of privacy issue to having the subjects of all the user emails saved in plain text in the database

Hae you added this issue here? Issues · nextcloud/mail · GitHub
If not, it might be a good idea, I think?

I’m not 100% sure if (the emails still in the database after deleting the account) it is a bug - i toyed with it for a short time, maybe (hopefully) there’s a purge action that happens once a day