Hello.

Background: Our mail server functionality currently use Rebex IMAP component. One of the system responsibility is to put INBOX emails in a database. To check if email already is in a database system find FolderId + UniquieId combination in a database table. Our previous Imap provider returned string view of integer value, that was unique per an email account.

Rebex Imap provider returns string unique ids like "ECvRWUABEHN". That could be ok, if Rebex documentation would contain any info about that, and, what actually was critical point, that text representation of Rebex provided UniqueI IS CASE SENSITIVE. That way, in pretty short time range in INBOX email accouint folder can appears two different emails with "ECvRWUABEHN" id and "ECvRWUABEHn" id.

The most database text configurations are CASE INSENSITIVE, so operations like DISTINCT, WHERE MessageUIN = @MessageUIN are CASE INSENSITIVE too, so Rebex style UniquieId values can seriously affects current data access and business logic, and in our case ACTUALLY DID IT.

You MUST provide more detailed documentation about things like described above. Short description like (quote from Rebex documentation) "Gets the message unique ID. " is absolutely not enough.

For now, my question is: can you change UniqueId representation such way that it will be case insensitive. Case sensitive operations on case insensitive databases is serious performance hit.

asked 25 Jun '11, 13:26

_Oz_'s gravatar image

_Oz_
151
accept rate: 0%

edited 25 Jun '11, 18:26


UniqueID in Rebex IMAP is Base64-encoded concatenation of IMAP's "UID" and "validity" values. The UID is assigned by the IMAP server when the message arrives and the combination of UID and validity is guaranteed to be unique in a single IMAP folder. (The server is permitted to change the validity, which invalidates all UIDs, but this doesn't occur very often on the majority of IMAP servers.)

The original values of ImapMessageInfo.UniqueId can be parsed using the ImapMessageSet.ParseUniqueId method as follows:

// get message info
ImapMessageInfo info = ...

// parse original IMAP's "UID" and "validity"
long validity, uid;
ImapMessageSet.ParseUniqueId(info.UniqueId, out validity, out uid);

You can either write your own CASE INSENSITIVE transform LONG -> STRING: {validity, uid} -> UniqueId or use your previous solution (combination of FolderId + uid).

link

answered 27 Jun '11, 10:34

Lukas%20Matyska's gravatar image

Lukas Matyska ♦♦
90117
accept rate: 28%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×76

Asked: 25 Jun '11, 13:26

Seen: 314 times

Last updated: 27 Jun '11, 10:34