[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [bug-mailutils] mailutils, message uids & maildir
From: |
Stephen Bylo |
Subject: |
Re: [bug-mailutils] mailutils, message uids & maildir |
Date: |
21 Nov 2003 21:54:15 +0800 |
On Fri, 2003-11-21 at 21:44, Sergey Poznyakoff wrote:
> Stephen Bylo <address@hidden> wrote:
>
> > (1)
> > Why is there not any function to retrieve a message_t given a uid ?
> > or have i not been able to find it.
>
> No, libmailbox does not provide such an interface. Our MH implementation
> does provide such function: see mh_get_message in mh/mh_msgset.c.
> It could easily be generalized for any mailbox format.
>
> > Right now we loop through all mails looking for the uid (using
> > libmu_mbox) and then use mailbox_get_message( m_mbox, msgno, &msg ) to
> > retrieve message_t using the "running" number!
> > Q: Can we do this in a better way?
>
> Yes, for example mh_get_message implements binary search, taking
> into account the fact that UIDs increment with the message number.
>
> > (2)
> > We want now to convert from mbox to maildir (we submitted a patch
> > recently!).
> > It seems that only mbox implements the uid "feature" (ie. puts X-UID
> > into email headers).
>
> Not only. For MH, message UID coincides with its sequence number; pop
> and imap mailboxes rely on corresponding protocols.
>
> > We are thinking of using the first 2 fields of the
> > email's file name
>
> What do you mean by "field" in this context, please?
Thanxs,
I mean the maildir file name, ie. <seconds>.<pid> etc. (these are the
first two 'fields')
We are looking into how to "index" these files, or put a "uid" into the
filename. Not yet sure how best to do this. Right now we are using the
first two fields as a uid, but it's a string and not an int.
Steve
>
> Regards,
> Sergey
--