Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Max message UID #195

Open
le-kazankin opened this issue Jul 17, 2023 · 3 comments
Open

Max message UID #195

le-kazankin opened this issue Jul 17, 2023 · 3 comments

Comments

@le-kazankin
Copy link

Hello,
As far as I understand, the uid of the message is returned from the message_idnr (bigint) column.

rfc 3501 (https://datatracker.ietf.org/doc/html/rfc3501#section-2.3.1.1) says that the UID must be 32-bit, the maximum value is 4294967295.

Is there any protection after exceeding the limit?
And is it planned to make a unique uid within one mailbox, and not the system as a whole?

@alan-hicks
Copy link
Member

Version 4rev2 obsoletes 3501, though there is no change in the 32-bit reference in 2.3.1.1
The formal syntax (9) for uid only defines it as "Unique identifiers used instead of message sequence numbers"

What protection are you looking for? Although dbmail is licensed under GPL version 2 and there is no warranty, the dbmail server handles 64 bit numbers and I usually fix bugs.

There are no plans to make uids unique within a mailbox. It would be a significant amount of work to change dbmail.

Clients are outside the scope of dbmail but when I looked at PHP, intval() is os dependent, Python appears unaffected as integers have unlimited precision. Roundcube client has an existing mismatch between cache database (signed) integer storing up to 2147483647 and (unsigned) uid 4294967295. Squirrelmail doesn't use a database so interacts with the server and doesn't appear to be affected.

https://datatracker.ietf.org/doc/html/rfc9051#IMAP-ABNF

@le-kazankin
Copy link
Author

Our email client was designed to work with 32 bit uid, that can be uniq within one mailbox (this behavior is found in dovecot, gmail, hotmail).

Also I am noticed that dbmail spends 2 values from the sequence to receive one message. So do I understand correctly that dbmail can store only 4611686018427387903 emails before receiving errors begin?

@alan-hicks
Copy link
Member

That's a very large number and I'm not aware of any users anywhere close to that limit. It would be straightforward to bump that to a 128 bit integer as MySQL, PostgreSQL and Oracle support it.

I'll need to look into this as 32 bit numbers per user folder is an issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants