Your UID is type LONG or STRING?
because in your link https://www.limilabs.com/blog/unique-id-in-pop3-protocol you refers to RFC 1939; there is String/VarChar(70)
In Pop3 client (and POP3 protocol in general) UIDs are strings.
In Imap client (and IMAP protocol) UIDs are ascending longs.