panic when deleting email from other client #110

Closed
opened 2020-10-10 23:55:38 +03:00 by oblitum · 1 comment

I was with meli open and, as I have no idea how to delete emails for its UI (I just get "unimplemented"), I deleted one email from my cellphone mail client. This was the sole email being listed in open folder in meli, as soon as I deleted it in my cellphone, meli panicked with:

thread 'meli-executor-6' panicked at 'removal index (is 1) should be < len (is 1)', src/liballoc/vec.rs:1062:13
I was with meli open and, as I have no idea how to delete emails for its UI (I just get "unimplemented"), I deleted one email from my cellphone mail client. This was the sole email being listed in open folder in meli, as soon as I deleted it in my cellphone, meli panicked with: ``` thread 'meli-executor-6' panicked at 'removal index (is 1) should be < len (is 1)', src/liballoc/vec.rs:1062:13 ```
Manos Pitsidianakis added the
bug
label 2020-10-11 01:12:24 +03:00

I've located the cause here melib/src/backends/imap/untagged.rs:98

IMAP server sent EXPUNGE 1, and here:

self
                    .uid_store
                    .msn_index
                    .lock()
                    .unwrap()
                    .entry(mailbox_hash)
                    .or_default()
                    .remove(n.try_into().unwrap());

The vector is 0-indexed but message sequence numbers in IMAP start from 1. The fix is to subtract 1 from the index.

I've located the cause here [`melib/src/backends/imap/untagged.rs:98`](https://git.meli.delivery/meli/meli/src/branch/master/melib/src/backends/imap/untagged.rs#L98) IMAP server sent `EXPUNGE 1`, and here: ``` self .uid_store .msn_index .lock() .unwrap() .entry(mailbox_hash) .or_default() .remove(n.try_into().unwrap()); ``` The vector is 0-indexed but message sequence numbers in IMAP start from 1. The fix is to subtract 1 from the index.
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: meli/meli#110
There is no content yet.