scanner / asimap

Pure python based IMAP server with a MH based file store
BSD 3-Clause "New" or "Revised" License
42 stars 7 forks source link

Keep mailboxes up to date #323

Open scanner opened 1 month ago

scanner commented 1 month ago

Right now we only keep the internal asimap db and add uid's to new messages when a user is logged in and for a short bit after the user logs out.

An initial scan for a specific user can take a very long time (minutes). Especially apparent on first logins when transporting mailboxes into asimap.

We want to minimize this impact by having the main server go through all of the asimap accounts on a regular basis that have not had a login in, say, 24 hours, and starting up their user_server, even without a requesting IMAP client, to do the initial rescan of all of their folders. Those user servers will exit after a timeout when they have completed their work.

So, make a task in the server that will go through the accounts, and launch their user server (for it to exit on its own when it is done the folder check and its timeout expires.)

Perhaps once per 24 hours per account that has not logged in in 24 hours, spread throughout the day.