fix: delete available_post_msgs row if there is no corresponding IMAP entry

If we learn about this message being available on IMAP later,
we will add another available_post_msgs row.
If we don't delete the row, we will keep failing each time
until IMAP entry becomes available and it may not happen.
This commit is contained in:
link2xt
2026-03-22 22:32:34 +01:00
committed by l
parent 7b9e7ae611
commit 6b1e62faba

View File

@@ -165,6 +165,7 @@ pub(crate) async fn download_msg(
let Some((server_uid, server_folder, msg_transport_id)) = row else {
// No IMAP record found, we don't know the UID and folder.
delete_from_available_post_msgs(context, &rfc724_mid).await?;
return Err(anyhow!(
"IMAP location for {rfc724_mid:?} post-message is unknown"
));