From a5d0d4c1260c24654b489cc063b23ab5253bae0b Mon Sep 17 00:00:00 2001 From: iequidoo Date: Tue, 6 Aug 2024 12:17:07 -0300 Subject: [PATCH] fix: Retry configuring mvbox on IMAP reconnect if mvbox_move is enabled explicitly If `mvbox_move` isn't enabled explictly, but only by default, better not to retry configuring it to avoid excessive work, but if it's enabled explicitly by the user and actually can't be configured, the user should disable it. But anyway not being able to configure the mvbox doesn't prevent Delta Chat from working just leaving all mail in Inbox. --- src/imap.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/imap.rs b/src/imap.rs index 40d6a982e..26ed0108a 100644 --- a/src/imap.rs +++ b/src/imap.rs @@ -1776,14 +1776,17 @@ impl Imap { context .set_config_internal(Config::ConfiguredInboxFolder, Some("INBOX")) .await?; + for (config, name) in folder_configs { + context.set_config_internal(config, Some(&name)).await?; + } if let Some(mvbox_folder) = mvbox_folder { info!(context, "Setting MVBOX FOLDER TO {}", &mvbox_folder); context .set_config_internal(Config::ConfiguredMvboxFolder, Some(mvbox_folder)) .await?; - } - for (config, name) in folder_configs { - context.set_config_internal(config, Some(&name)).await?; + } else if create_mvbox && context.config_exists(Config::MvboxMove).await? { + warn!(context, "Will retry configuring MVBOX on reconnect."); + return Ok(()); } context .sql