Browse Source

melib/imap: FETCH comma-sep list on untagged Recent response

FETCHing RECENT messages when receiving an untagged RECENT response from
the server didn't separate the message numbers with comma but with
space, which is invalid.
jmap-eventsource
Manos Pitsidianakis 1 year ago
parent
commit
3004789f32
Signed by untrusted user: epilys GPG Key ID: 73627C2F690DF710
  1. 14
      melib/src/backends/imap/untagged.rs

14
melib/src/backends/imap/untagged.rs

@ -241,12 +241,18 @@ impl ImapConnection {
debug!("UID SEARCH RECENT returned no results");
}
Ok(v) => {
let command = {
let mut iter = v.split(u8::is_ascii_whitespace);
let first = iter.next().unwrap_or(v);
let mut accum = format!("{}", to_str!(first).trim());
for ms in iter {
accum = format!("{},{}", accum, to_str!(ms).trim());
}
format!("UID FETCH {} (FLAGS RFC822)", accum)
};
try_fail!(
mailbox_hash,
self.send_command(
&[b"UID FETCH", v, b"(FLAGS RFC822)"]
.join(&b' '),
).await
self.send_command(command.as_bytes()).await
self.read_response(&mut response, RequiredResponses::FETCH_REQUIRED).await
);
debug!(&response);

Loading…
Cancel
Save