From 472f77de55029c5699b25731dfd9d8e10acc8e1e Mon Sep 17 00:00:00 2001 From: Matt McCoy Date: Fri, 24 Jun 2016 21:20:50 -0400 Subject: [PATCH] Adding LSUB command --- src/client.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/client.rs b/src/client.rs index c80fb12..cf2ed01 100644 --- a/src/client.rs +++ b/src/client.rs @@ -155,6 +155,15 @@ impl Client { } } + /// The LSUB command returns a subset of names from the set of names + /// that the user has declared as being "active" or "subscribed". + pub fn lsub(&mut self, reference_name: &str, mailbox_search_pattern: &str) -> Result> { + match self.run_command(&format!("LSUB {} {}", reference_name, mailbox_search_pattern)) { + Ok(lines) => parse_response(lines), + Err(e) => Err(e) + } + } + /// Runs a command and checks if it returns OK. pub fn run_command_and_check_ok(&mut self, command: &str) -> Result<()> { match self.run_command(command) {