Complete.Org: Mailing Lists: Archives: offlineimap: August 2007:
Re: use of UIDs vs. MSGID
Home

Re: use of UIDs vs. MSGID

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: offlineimap@xxxxxxxxxxxx
Cc: martin f krafft <madduck@xxxxxxxxxxx>
Subject: Re: use of UIDs vs. MSGID
From: John Goerzen <jgoerzen@xxxxxxxxxxxx>
Date: Tue, 14 Aug 2007 09:32:22 -0500

On Tue August 14 2007 9:11:17 am martin f krafft wrote:
> OfflineIMAP uses the X-OfflineIMAP-x... header to identify messages,
> and the IMAP server's UID notion to link them to the server copy.
> Since we're dealing with mail all along, and mail messages have
> a unique message-id header, I wonder why that's not being used. It's

Because it is not guaranteed that there will be exactly one copy with a given 
message-id header in any given mailbox.  Think about scenarios where a user 
copies a message from folder A to folder B, and then copies the same message 
from folder B to folder A.  Folder A will now have two copies of the 
message, but each one could have its own flags.  Also, some mailboxes 
contain messages without that header (common examples are Drafts folders).  

> likely to be indexed on the server and could thus increase the speed
> of searches.

I actually would think this would be significantly slower than using UIDs.  
All servers that do any sort of indexing should be indexing UIDs anyway.  
Servers such as Courier index *only* UIDs, and would have to scan every file 
in a maildir for a given header.

> Also, why does OfflineIMAP store headers like
>
>  
> X-OfflineIMAP-x825313192-7365616d75732e6d61646475636b2e6e6574-494e424f58:
> 1186324387-0249694837446-v5.99.0
>
> ?
>
> As in, why is the header label not constant? And what do all these
> numbers mean?

The header label is not constant because a given message could traverse 
multiple OfflineIMAPs, at multiple different times.  I didn't want to add 
code to consider removing/modifying existing headers, but considered it the 
least evil option to add a unique header as a solution to this problem

Both the left and the right side of the header is designed to be unique.  The 
exact code would probably be in offlineimap/folder/IMAP.py.  I think that 
there are bits of UIDs, folder MD5s, timestamps, and perhaps randomness in 
there.

-- John



[Prev in Thread] Current Thread [Next in Thread]