[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bug-mailutils] mailutils, message uids & maildir

From: Sergey Poznyakoff
Subject: Re: [bug-mailutils] mailutils, message uids & maildir
Date: Fri, 21 Nov 2003 15:44:50 +0200

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?


reply via email to

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