feat: Remove "jobs" from imap_markseen if folder doesn't exist (#5870)

Add a `create` param to `select_with_uidvalidity()` instead of always trying to create the folder
and return `Ok(false)` from it if the folder doesn't exist and shouldn't be created, and handle this
in `store_seen_flags_on_imap()` by just removing "jobs" from the `imap_markseen` table. Also don't
create the folder in other code paths where it's not necessary.
This commit is contained in:
iequidoo
2024-08-18 17:49:29 -03:00
committed by iequidoo
parent f1302c3bc4
commit 3d9aee1368
6 changed files with 133 additions and 68 deletions

View File

@@ -29,7 +29,9 @@ impl Session {
) -> Result<Self> {
use futures::future::FutureExt;
self.select_with_uidvalidity(context, folder).await?;
let create = true;
self.select_with_uidvalidity(context, folder, create)
.await?;
if self.drain_unsolicited_responses(context)? {
self.new_mail = true;