mirror of
https://github.com/chatmail/core.git
synced 2026-05-20 07:16:31 +03:00
feat: Start IMAP loop for sentbox only if it is configured (#5105)
This commit is contained in:
@@ -475,6 +475,15 @@ impl Context {
|
|||||||
|| self.get_config_bool(Config::OnlyFetchMvbox).await?)
|
|| self.get_config_bool(Config::OnlyFetchMvbox).await?)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Returns true if sentbox ("Sent" folder) should be watched.
|
||||||
|
pub(crate) async fn should_watch_sentbox(&self) -> Result<bool> {
|
||||||
|
Ok(self.get_config_bool(Config::SentboxWatch).await?
|
||||||
|
&& self
|
||||||
|
.get_config(Config::ConfiguredSentboxFolder)
|
||||||
|
.await?
|
||||||
|
.is_some())
|
||||||
|
}
|
||||||
|
|
||||||
/// Gets configured "delete_server_after" value.
|
/// Gets configured "delete_server_after" value.
|
||||||
///
|
///
|
||||||
/// `None` means never delete the message, `Some(0)` means delete
|
/// `None` means never delete the message, `Some(0)` means delete
|
||||||
|
|||||||
@@ -830,10 +830,7 @@ impl Scheduler {
|
|||||||
|
|
||||||
for (meaning, should_watch) in [
|
for (meaning, should_watch) in [
|
||||||
(FolderMeaning::Mvbox, ctx.should_watch_mvbox().await),
|
(FolderMeaning::Mvbox, ctx.should_watch_mvbox().await),
|
||||||
(
|
(FolderMeaning::Sent, ctx.should_watch_sentbox().await),
|
||||||
FolderMeaning::Sent,
|
|
||||||
ctx.get_config_bool(Config::SentboxWatch).await,
|
|
||||||
),
|
|
||||||
] {
|
] {
|
||||||
if should_watch? {
|
if should_watch? {
|
||||||
let (conn_state, handlers) = ImapConnectionState::new(ctx).await?;
|
let (conn_state, handlers) = ImapConnectionState::new(ctx).await?;
|
||||||
|
|||||||
Reference in New Issue
Block a user