diff --git a/melib/src/backends/imap/connection.rs b/melib/src/backends/imap/connection.rs index 49f9a59d0..b9bc33bf5 100644 --- a/melib/src/backends/imap/connection.rs +++ b/melib/src/backends/imap/connection.rs @@ -425,7 +425,7 @@ impl ImapStream { if !termination_string.is_empty() && ret[last_line_idx..].starts_with(termination_string) { - debug!(&ret[last_line_idx..]); + debug!(String::from_utf8_lossy(&ret[last_line_idx..])); if !keep_termination_string { ret.splice(last_line_idx.., std::iter::empty::()); } @@ -562,7 +562,7 @@ impl ImapConnection { } else { debug!( "connect(): connection is probably alive, NOOP returned {:?}", - &ret + &String::from_utf8_lossy(&ret) ); return Ok(()); } @@ -675,12 +675,17 @@ impl ImapConnection { { debug!( "Received expected NO response: {:?} {:?}", - response_code, response + response_code, + String::from_utf8_lossy(&response) ); } ImapResponse::No(ref response_code) => { //FIXME return error - debug!("Received NO response: {:?} {:?}", response_code, response); + debug!( + "Received NO response: {:?} {:?}", + response_code, + String::from_utf8_lossy(&response) + ); (self.uid_store.event_consumer)( self.uid_store.account_hash, crate::backends::BackendEvent::Notice { @@ -694,7 +699,11 @@ impl ImapConnection { } ImapResponse::Bad(ref response_code) => { //FIXME return error - debug!("Received BAD response: {:?} {:?}", response_code, response); + debug!( + "Received BAD response: {:?} {:?}", + response_code, + String::from_utf8_lossy(&response) + ); (self.uid_store.event_consumer)( self.uid_store.account_hash, crate::backends::BackendEvent::Notice { diff --git a/melib/src/backends/imap/protocol_parser.rs b/melib/src/backends/imap/protocol_parser.rs index 0aaf8bcf8..b4c5d6bed 100644 --- a/melib/src/backends/imap/protocol_parser.rs +++ b/melib/src/backends/imap/protocol_parser.rs @@ -829,7 +829,10 @@ pub fn untagged_responses(input: &[u8]) -> ImapParseResult(&b"\r\n"[..])(input)?; let (input, _) = tag::<_, &[u8], (&[u8], nom::error::ErrorKind)>(b"\r\n")(input)?; - debug!("Parse untagged response from {:?}", orig_input); + debug!( + "Parse untagged response from {:?}", + String::from_utf8_lossy(&orig_input) + ); Ok(( input, {