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 2020-12-30 16:19:15 +02:00
parent 1be30968ca
commit 829f1243fb
Signed by: Manos Pitsidianakis
GPG Key ID: 73627C2F690DF710
1 changed files with 1 additions and 1 deletions

View File

@ -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(),
)