From 0cc38571f494a40170dc9913eddad5012337574a Mon Sep 17 00:00:00 2001 From: Quentin Dufour Date: Fri, 19 Jan 2024 16:47:20 +0100 Subject: Implement some part of SPECIAL-USE --- src/imap/command/authenticated.rs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/imap/command') diff --git a/src/imap/command/authenticated.rs b/src/imap/command/authenticated.rs index 3fd132f..c5f2d00 100644 --- a/src/imap/command/authenticated.rs +++ b/src/imap/command/authenticated.rs @@ -235,11 +235,19 @@ impl<'a> AuthenticatedContext<'a> { .to_string() .try_into() .map_err(|_| anyhow!("invalid mailbox name"))?; - let mut items = vec![FlagNameAttribute::try_from(Atom::unvalidated( + let mut items = vec![FlagNameAttribute::from(Atom::unvalidated( "Subscribed", - ))?]; + ))]; if !*is_real { items.push(FlagNameAttribute::Noselect); + } else { + match *mb { + "Drafts" => items.push(Atom::unvalidated("Drafts").into()), + "Archive" => items.push(Atom::unvalidated("Archive").into()), + "Sent" => items.push(Atom::unvalidated("Sent").into()), + "Trash" => items.push(Atom::unvalidated("Trash").into()), + _ => (), + }; } if is_lsub { ret.push(Data::Lsub { -- cgit v1.2.3