[MlMt] Possible overflow in variable that stores UIDNEXT

Aryeh Goldsmith aryeh at sightserve.com
Wed Nov 9 19:33:31 EST 2022


I’ve been trying to track down an issue in which when MailMate tries to sync with the IMAP server it does a UID FETCH of a negative number.

I’m guessing that number is being generated from the last UIDNEXT and stored in a variable that is a Int32 but should be an UInt32.

Some lines from my log:


22:51:19 S: * 0 RECENT
22:51:19 S: * OK [UNSEEN 28] First unseen.
22:51:19 S: * OK [UIDVALIDITY 1584965498] UIDs valid
22:51:19 S: * OK [UIDNEXT 2206296242] Predicted next UID
22:51:19 S: * OK [HIGHESTMODSEQ 7] Highest
22:51:19 S: D3 OK [READ-WRITE] Select completed (0.007 + 0.000 + 0.006 secs).
22:51:19 Condstore-based check (7 > 7) means fast synchronization is enabled
22:51:19 Attempting fast synchronization.
22:51:19 C: D4 UID FETCH -2088671054:* (UID)
22:51:19 S: D4 BAD Error in IMAP command UID FETCH: Invalid uidset (0.001 + 0.000 secs).
22:51:19 Error: Server response: “D4 BAD Error in IMAP command UID FETCH: Invalid uidset (0.001 + 0.000 secs).”.

Here the server states the next UID would be 2206296242.

Mailmate tries to do a UID FETCH -2088671054:* (UID)

2206296242 | 0   happens to equal -2088671054  which isn’t a coincidence, so there’s your overflow.

I’d assume it is when Mailmate stores the UIDNEXT from the previous session (it gets mangled) and then uses the mangled value in the new session to fetch new messages since the last session.


Also, why is my account on the ticketing system flagged as a spammer and my tickets/comments all flagged as spam?



Thanks,
Aryeh


More information about the mailmate mailing list