One of the extensions to IMAP is the UID extension, which gives every email something akin to a UUID. It's technically not mandatory, but virtually every email client is going to try to use it if possible, and likely some email clients don't even attempt to use message sequence numbers.
So you don't need to maintain message sequence numbers, except for the few places in the protocol where only the message sequence number is reported (e.g., the unsolicited message deleted alerts). In practice, I would actually expect that trying to use message sequence numbers would be buggier than not using them. But servers still have to support them!
So you don't need to maintain message sequence numbers, except for the few places in the protocol where only the message sequence number is reported (e.g., the unsolicited message deleted alerts). In practice, I would actually expect that trying to use message sequence numbers would be buggier than not using them. But servers still have to support them!