mirror of
https://github.com/chatmail/core.git
synced 2026-05-04 13:56:30 +03:00
Do not skip Sent and Spam folders on Gmail
Skipping of all [Gmail] folders was introduced to avoid scanning virtual "[Gmail]/All Mail" folder. However, it also skips Sent and Spam folders which reside inside [Gmail]. As a result configured_sentbox_folder becomes unset after folder scan, making it impossible to watch Sent folder, and Spam folder is never scanned. This change makes Delta Chat identify virtual Gmail folders by their flags, so virtual folders are skipped while Sent and Spam folders are still scanned.
This commit is contained in:
10
src/imap.rs
10
src/imap.rs
@@ -125,6 +125,14 @@ enum FolderMeaning {
|
||||
Sent,
|
||||
Drafts,
|
||||
Other,
|
||||
|
||||
/// Virtual folders.
|
||||
///
|
||||
/// On Gmail there are virtual folders marked as \\All, \\Important and \\Flagged.
|
||||
/// Delta Chat ignores these folders because the same messages can be fetched
|
||||
/// from the real folder and the result of moving and deleting messages via
|
||||
/// virtual folder is unclear.
|
||||
Virtual,
|
||||
}
|
||||
|
||||
impl FolderMeaning {
|
||||
@@ -135,6 +143,7 @@ impl FolderMeaning {
|
||||
FolderMeaning::Sent => Some(Config::ConfiguredSentboxFolder),
|
||||
FolderMeaning::Drafts => None,
|
||||
FolderMeaning::Other => None,
|
||||
FolderMeaning::Virtual => None,
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1888,6 +1897,7 @@ fn get_folder_meaning(folder_name: &Name) -> FolderMeaning {
|
||||
"\\Sent" => return FolderMeaning::Sent,
|
||||
"\\Spam" | "\\Junk" => return FolderMeaning::Spam,
|
||||
"\\Drafts" => return FolderMeaning::Drafts,
|
||||
"\\All" | "\\Important" | "\\Flagged" => return FolderMeaning::Virtual,
|
||||
_ => {}
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user