Browse Source

melib/imap: fix invalid FETCH edge case

If mailbox was empty, this FETCH would request "0:*" which is an invalid
message set since message sequence numbers start with 1.
jmap-eventsource
Manos Pitsidianakis 11 months ago
parent
commit
829f1243fb
Signed by: epilys GPG Key ID: 73627C2F690DF710
  1. 2
      melib/src/backends/imap/watch.rs

2
melib/src/backends/imap/watch.rs

@ -345,7 +345,7 @@ pub async fn examine_updates(
conn.send_command(
format!(
"FETCH {}:* (UID FLAGS ENVELOPE BODY.PEEK[HEADER.FIELDS (REFERENCES)] BODYSTRUCTURE)",
mailbox.exists.lock().unwrap().len()
std::cmp::max(mailbox.exists.lock().unwrap().len(), 1)
)
.as_bytes(),
)

Loading…
Cancel
Save