is uid in database unique?

Use this forum if you have installed hMailServer and want to ask a question related to a production release of hMailServer. Before posting, please read the troubleshooting guide. A large part of all reported issues are already described in detail here.
Post Reply
opto
New user
New user
Posts: 22
Joined: 2009-01-27 10:32

is uid in database unique?

Post by opto » 2020-01-01 19:59

'UID' implies it is unique, but in my mysql database, it is not. Messageid seems to be unique at first view.

What happens if uid is not unique? We had emails disappearing, but that was due to the eml files missing. Would double uid's also make emails disappear?

If I look at the uid's for the six most recent messages, they are 308862, 117002, 34069, (for account 1), 34068, 16466, 308860 (for account 28). Is that to be expected? Messageid's are nicely consecutive.


Multiple uid's happens mostly for older emails. We started at hmailserver 4 and went over a few versions and a few PCs to 5.3.3 (with mysql 4.1.18).
I am just upgrading to mysql5 and had a look at the tables in MYSQL Workbench, that is where I noticed this.

Any help is appreciated,

Klaus

opto
New user
New user
Posts: 22
Joined: 2009-01-27 10:32

Re: is uid in database unique?

Post by opto » 2020-01-01 20:10

I found a foldercurrentuid in the table imapfolders. So is uid only unique inside a certain folder? Some other forum posts denote uid as unique. I am well below the 4 billion that are allowed (ca. 380000).

User avatar
jimimaseye
Moderator
Moderator
Posts: 8306
Joined: 2011-09-08 17:48

Re: is uid in database unique?

Post by jimimaseye » 2020-01-01 21:04

Do you actually have a problem? Or are you planning to manipulate the data?

If the answer is no and no: then don't worry. Let things 'just work' and don't worry.

If the answer is no and yes: then don't. Let things 'just work' and don't mess as you will break something.

If the answer is yes (to a problem): then explain what it is so we can offer targeted help.

[Entered by mobile. Excuse my spelling.]
5.7 on test.
SpamassassinForWindows 3.4.0 spamd service
AV: Clamwin + Clamd service + sanesecurity defs : https://www.hmailserver.com/forum/viewtopic.php?f=21&t=26829

opto
New user
New user
Posts: 22
Joined: 2009-01-27 10:32

Re: is uid in database unique?

Post by opto » 2020-01-01 22:01

do I have a problem? Don't know. That is what I want to find out.

I do have emails disappearing. Upon upgrade, I found uid not unique. May that be related?

Thanks,

Klaus

User avatar
Dravion
Senior user
Senior user
Posts: 1611
Joined: 2015-09-26 11:50
Location: Germany
Contact:

Re: is uid in database unique?

Post by Dravion » 2020-01-01 22:36

opto wrote:
2020-01-01 22:01
do I have a problem? Don't know. That is what I want to find out.

I do have emails disappearing. Upon upgrade, I found uid not unique. May that be related?

Thanks,

Klaus

The UID are not Random numbers and collision is possible but not likely because they are only valid for a specific inbox user account. The UID are IMAP specific and explained in the IMAP RFC.

opto
New user
New user
Posts: 22
Joined: 2009-01-27 10:32

Re: is uid in database unique?

Post by opto » 2020-01-01 23:10

thanks, Dravion. I have many users and folders, so this is probably ok. I will also have a look at the rfc, thanks for pointing me there.
Klaus

Post Reply