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 3 years ago
parent 1be30968ca
commit 829f1243fb
No known key found for this signature in database
GPG Key ID: 73627C2F690DF710

@ -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