MCPcopy Create free account
hub / github.com/clawshell/clawshell / expect_greeting

Method expect_greeting

src/email.rs:319–329  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

317 }
318
319 fn expect_greeting(&mut self) -> Result<(), EmailServiceError> {
320 let line = self.read_line()?;
321 let upper = line.to_ascii_uppercase();
322 if upper.starts_with("* OK") || upper.starts_with("* PREAUTH") {
323 Ok(())
324 } else {
325 Err(EmailServiceError::ClientSetup(format!(
326 "unexpected IMAP greeting: {line}"
327 )))
328 }
329 }
330
331 fn login(&mut self, username: &str, password: &str) -> Result<(), EmailServiceError> {
332 let command = format!("LOGIN {} {}", imap_quote(username), imap_quote(password));

Callers 1

connect_and_loginFunction · 0.80

Calls 1

read_lineMethod · 0.80

Tested by

no test coverage detected