mirror of
https://github.com/chatmail/core.git
synced 2026-04-28 10:56:29 +03:00
imap: avoid reconnection loop when message without Message-ID is marked as seen
- do not attempt to mark reserved meessages as seen when messages with empty Message-ID are marked as seen on IMAP - do not reconnect on Seen flag synchronization failures This avoid reconnection loops in case of permanent errors in `sync_seen_flags`
This commit is contained in:
@@ -1,5 +1,11 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## Unreleased
|
||||||
|
|
||||||
|
### Fixes
|
||||||
|
- avoid reconnection loop when message without Message-ID is marked as seen #3044
|
||||||
|
|
||||||
|
|
||||||
## 1.73.0
|
## 1.73.0
|
||||||
|
|
||||||
### API changes
|
### API changes
|
||||||
|
|||||||
@@ -1980,7 +1980,7 @@ async fn mark_seen_by_uid(
|
|||||||
.sql
|
.sql
|
||||||
.query_row_optional(
|
.query_row_optional(
|
||||||
"SELECT id, chat_id FROM msgs
|
"SELECT id, chat_id FROM msgs
|
||||||
WHERE rfc724_mid IN (
|
WHERE id > 9 AND rfc724_mid IN (
|
||||||
SELECT rfc724_mid FROM imap
|
SELECT rfc724_mid FROM imap
|
||||||
WHERE folder=?1
|
WHERE folder=?1
|
||||||
AND uidvalidity=?2
|
AND uidvalidity=?2
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ use crate::dc_tools::maybe_add_time_based_warnings;
|
|||||||
use crate::ephemeral::delete_expired_imap_messages;
|
use crate::ephemeral::delete_expired_imap_messages;
|
||||||
use crate::imap::Imap;
|
use crate::imap::Imap;
|
||||||
use crate::job::{self, Thread};
|
use crate::job::{self, Thread};
|
||||||
|
use crate::log::LogExt;
|
||||||
use crate::smtp::{send_smtp_messages, Smtp};
|
use crate::smtp::{send_smtp_messages, Smtp};
|
||||||
|
|
||||||
use self::connectivity::ConnectivityStore;
|
use self::connectivity::ConnectivityStore;
|
||||||
@@ -206,15 +207,11 @@ async fn fetch_idle(ctx: &Context, connection: &mut Imap, folder: Config) -> Int
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Synchronize Seen flags.
|
// Synchronize Seen flags.
|
||||||
if let Err(err) = connection
|
connection
|
||||||
.sync_seen_flags(ctx, &watch_folder)
|
.sync_seen_flags(ctx, &watch_folder)
|
||||||
.await
|
.await
|
||||||
.context("sync_seen_flags")
|
.context("sync_seen_flags")
|
||||||
{
|
.ok_or_log(ctx);
|
||||||
connection.trigger_reconnect(ctx).await;
|
|
||||||
warn!(ctx, "{:#}", err);
|
|
||||||
return InterruptInfo::new(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
connection.connectivity.set_connected(ctx).await;
|
connection.connectivity.set_connected(ctx).await;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user