From f332f887fdfd5fa4826f51a2596030c1c0eb915d Mon Sep 17 00:00:00 2001 From: Federico Di Gregorio Date: Mon, 10 Feb 2025 16:35:43 +0100 Subject: [PATCH] Added SPECIAL-USE to list_status Some servers don't return SPECIAL-USE attributes unless they are explicitly requested in the LIST-EXTENDED command. This change makes the `list_status()` method a little bit more useful if SPECIAL-USE is included in the list of capabilities. --- src/extensions/list_status.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/extensions/list_status.rs b/src/extensions/list_status.rs index 1cbaca2..2081e81 100644 --- a/src/extensions/list_status.rs +++ b/src/extensions/list_status.rs @@ -145,10 +145,12 @@ impl Session { data_items: &str, ) -> Result { let reference = validate_str("LIST-STATUS", "reference", reference_name.unwrap_or(""))?; + let capabilities = self.capabilities(); let lines = self.run_command_and_read_response(format!( - "LIST {} {} RETURN (STATUS {})", + "LIST {} {} RETURN ({}STATUS {})", &reference, mailbox_pattern.unwrap_or("\"\""), + if capabilities.is_ok_and(|c| c.has_str("SPECIAL-USE")) { "SPECIAL-USE " } else { "" }, data_items ))?; ExtendedNames::parse(lines, &mut self.unsolicited_responses)