News for hackers. Stuff that matters.
Re:Protonmail can delete the wrong email and nobody cares by cryptonector on Wednesday November 02, 2022 @04:15PM (#33442325)
The fundamental problem is that `UID`s in IMAP kinda suck because assigning persistent, unique IDs to emails in a store is a hard problem because doing that for mbox- or maildir-like stores is hard because those predated any notion of remote email access protocols.

Thus in practice IMAP servers generally assign `UID`s ephemerally per-session, which means that clients can't rely on the stability of `UID`s, which means that clients have to re-obtain `UID`s before operating on emails via IMAP even if they have cached those emails locally. `UIDVALIDITY` exists to help clients cache and invalidate `UID`s. The RFC has text about this.

A bridge from IMAP to something else (which is basically what every IMAP server ever is) needs to deal with this. To make `UID`s stable requires keeping state.

Clients should really not assume stable `UID`s. Instead clients should `SEARCH` or list to get [temporarily] valid `UID`s then use those to delete etc.

Re:Protonmail can delete the wrong email and nobody cares by survirtual on Thursday November 03, 2022 @11:59AM (#33453066)
Why is this complex…just take a sha3 hash of the email body + timestamp, then b58 it or format any way you want. Instant uuid per email.
Re:Protonmail can delete the wrong email and nobody cares by cryptonector on Thursday November 03, 2022 @02:03PM (#33454926)
Yes, that's what I say elsewhere. Digest some of the headers (not all) and the body. If you do it right you can even use that for dedup.