Add parameter to disable IMAP All Messages folder
This commit is contained in:
@@ -75,6 +75,7 @@ pub struct IMAP {
|
||||
pub max_auth_failures: u32,
|
||||
pub name_shared: String,
|
||||
pub name_all: String,
|
||||
pub name_all_enable: bool,
|
||||
pub allow_plain_auth: bool,
|
||||
pub enable_uidplus: bool,
|
||||
|
||||
|
||||
@@ -47,6 +47,7 @@ impl IMAP {
|
||||
.value("imap.folders.name.shared")
|
||||
.unwrap_or("Shared Folders")
|
||||
.to_string(),
|
||||
name_all_enable: config.property_or_static("imap.folders.all-messages", "true")?,
|
||||
name_all: config
|
||||
.value("imap.folders.name.all")
|
||||
.unwrap_or("All Mail")
|
||||
|
||||
@@ -175,7 +175,10 @@ impl SessionData {
|
||||
let mut list_items = Vec::with_capacity(10);
|
||||
|
||||
// Add "All Mail" folder
|
||||
if !filter_subscribed && matches_pattern(&patterns, &self.imap.name_all) {
|
||||
if self.imap.name_all_enable
|
||||
&& !filter_subscribed
|
||||
&& matches_pattern(&patterns, &self.imap.name_all)
|
||||
{
|
||||
list_items.push(ListItem {
|
||||
mailbox_name: self.imap.name_all.clone(),
|
||||
attributes: vec![Attribute::All, Attribute::NoInferiors],
|
||||
|
||||
Reference in New Issue
Block a user