You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by Francois-Denis Gonthier <fd...@revolutionlinux.com> on 2010/09/12 04:46:57 UTC

Confused by UID vs message number in James IMAP

Hello all,

As you know I am writing a store to connect an IMAP server to Nuxeo. I'm currently at the point where I can list the content of a virtual mailbox but I have hit a major wall with regard to UID generation. 

For me, the disconnect between UID and message number, as represented by the class UidToMsnConverter, is confusing the hell out of me. I'm not sure how I should generate the IMAP UID I associate with documents in the Nuxeo store. I'm not sure if I should care about generating UIDs matching with IMAP standards. I really need further explanation because I don't believe this is intuitive nor documented. 

This difficulty has been compounded by the fact that I have found difficult to find the right way to inform the processor that a new message was created.

In my opinion, the UidToMsnConverter is a mistake. Caching UIDs should be left as an exercice to the store implementor if they want it, or be provided as an optional service. This layers has made debugging difficult for me. The getMsn method returning -1 has also masked some problem from my view while debugging, problem which were only found by observing the client IMAP trace and debugging the IMAP processor.

-- 
François-Denis Gonthier
Programmeur/analyste
819-780-8955 #1128                http://www.revolutionlinux.com/


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Re: Confused by UID vs message number in James IMAP

Posted by Norman Maurer <no...@apache.org>.
Hi,

Thanks for the feedback :) Beside that you were right with the invalid
UIDs in the FETCH response. I committed a fix for this today to act
like other imapserver do..

Bye
Norman

2010/9/13, Francois-Denis Gonthier <fd...@revolutionlinux.com>:
> Hello Norman and server-dev
>
> With new knowledge in mind, I have reworked my UID management and things
> seem to work better now! There was nothing wrong with the UidToMsnConverter.
>
> --
> François-Denis Gonthier
> Programmeur/analyste
> 819-780-8955 #1128                http://www.revolutionlinux.com/
>
> ----- Mail original -----
>> Hi Francois-Denis,
>>
>>
>> 2010/9/12 Francois-Denis Gonthier <fd...@revolutionlinux.com>:
>> > Now, I still think getMsn returning -1 is a problem. If the
>> > processor asks for a mail which the UidToMsnConverter doesn't know,
>> > it returns -1 and that number happens to be sent down the wire in a
>> > FETCH response. This confuses the IMAP client which usually
>> > disconnects from the server. If you don't happen to have a verbose
>> > IMAP trace running, the problem might be totally invisible by the
>> > client. I would prefer a big fat exception be thrown on unknown
>> > message than this.
>> >
>>
>> I agree we should at least take some care here in FetchProcessor.
>>
>> Could you fill a JIRA issue for it ?
>> https://issues.apache.org/jira/browse/IMAP
>>
>> Thx,
>> Norman
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
>> For additional commands, e-mail: server-dev-help@james.apache.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
> For additional commands, e-mail: server-dev-help@james.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Re: Confused by UID vs message number in James IMAP

Posted by Francois-Denis Gonthier <fd...@revolutionlinux.com>.
Hello Norman and server-dev

With new knowledge in mind, I have reworked my UID management and things seem to work better now! There was nothing wrong with the UidToMsnConverter.

-- 
François-Denis Gonthier
Programmeur/analyste
819-780-8955 #1128                http://www.revolutionlinux.com/

----- Mail original -----
> Hi Francois-Denis,
> 
> 
> 2010/9/12 Francois-Denis Gonthier <fd...@revolutionlinux.com>:
> > Now, I still think getMsn returning -1 is a problem. If the
> > processor asks for a mail which the UidToMsnConverter doesn't know,
> > it returns -1 and that number happens to be sent down the wire in a
> > FETCH response. This confuses the IMAP client which usually
> > disconnects from the server. If you don't happen to have a verbose
> > IMAP trace running, the problem might be totally invisible by the
> > client. I would prefer a big fat exception be thrown on unknown
> > message than this.
> >
> 
> I agree we should at least take some care here in FetchProcessor.
> 
> Could you fill a JIRA issue for it ?
> https://issues.apache.org/jira/browse/IMAP
> 
> Thx,
> Norman
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
> For additional commands, e-mail: server-dev-help@james.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Re: Confused by UID vs message number in James IMAP

Posted by Norman Maurer <no...@apache.org>.
Hi Francois-Denis,


2010/9/12 Francois-Denis Gonthier <fd...@revolutionlinux.com>:
> Now, I still think getMsn returning -1 is a problem. If the processor asks for a mail which the UidToMsnConverter doesn't know, it returns -1 and that number happens to be sent down the wire in a FETCH response. This confuses the IMAP client which usually disconnects from the server. If you don't happen to have a verbose IMAP trace running, the problem might be totally invisible by the client. I would prefer a big fat exception be thrown on unknown message than this.
>

I agree we should at least take some care here in FetchProcessor.

Could you fill a JIRA issue for it ?
https://issues.apache.org/jira/browse/IMAP

Thx,
Norman

---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Re: Confused by UID vs message number in James IMAP

Posted by Francois-Denis Gonthier <fd...@revolutionlinux.com>.
Hello Norman,

> 
> >
> > This difficulty has been compounded by the fact that I have found
> > difficult to find the right way to inform the processor that a new
> > message was created.
> 
> Why this ? I mean this should get handled via the MailboxListener
> stuff. Can you give me some more informations about your problems ?

It just took me a while to figure that part out because it's hidden inside the hierarchy of . I think I have it figured out though.

> >
> > In my opinion, the UidToMsnConverter is a mistake. Caching UIDs
> > should be left as an exercice to the store implementor if they want
> > it, or be provided as an optional service. This layers has made
> > debugging difficult for me. The getMsn method returning -1 has also
> > masked some problem from my view while debugging, problem which were
> > only found by observing the client IMAP trace and debugging the IMAP
> > processor.
> 
> Well the "caching" is mostly done to make sure the UID to MSN mapping
> will be correct while have the mailbox selected. Not sure how you
> would handle this otherwise..

I had neglected paying attention to the "Message Sequence Number Message Attribute" in the IMAP standard. Now that I understand UidToMsnConverter is really about that, I need to check my stuff again with that new information in mind.

The high level view of my problem happens at the arrival of a new message inside a selected mailbox. The IMAP client asks for message UIDs which are not known by my store. The UID it asks could not possibly have been generated by me as far as I know. I first though this discrepancy was due to a intermediate layer that I did not fully understand, but I might have been mistaken by a long day of debugging.

Now, I still think getMsn returning -1 is a problem. If the processor asks for a mail which the UidToMsnConverter doesn't know, it returns -1 and that number happens to be sent down the wire in a FETCH response. This confuses the IMAP client which usually disconnects from the server. If you don't happen to have a verbose IMAP trace running, the problem might be totally invisible by the client. I would prefer a big fat exception be thrown on unknown message than this.

F-D

---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Re: Confused by UID vs message number in James IMAP

Posted by Norman Maurer <no...@apache.org>.
Hi there,

comments included..


2010/9/12 Francois-Denis Gonthier <fd...@revolutionlinux.com>:
> Hello all,
>
> As you know I am writing a store to connect an IMAP server to Nuxeo. I'm currently at the point where I can list the content of a virtual mailbox but I have hit a major wall with regard to UID generation.

Could you explain what gives you so much trouble with generating UID's ?

>
> For me, the disconnect between UID and message number, as represented by the class UidToMsnConverter, is confusing the hell out of me. I'm not sure how I should generate the IMAP UID I associate with documents in the Nuxeo store. I'm not sure if I should care about generating UIDs matching with IMAP standards. I really need further explanation because I don't believe this is intuitive nor documented.

For more information on the uid stuff I would suggest to read the rfc:
http://www.faqs.org/rfcs/rfc3501.html#  (2.3.1.1.        Unique
Identifier (UID) Message Attribute)


>
> This difficulty has been compounded by the fact that I have found difficult to find the right way to inform the processor that a new message was created.

Why this ? I mean this should get handled via the MailboxListener
stuff. Can you give me some more informations about your problems ?

>
> In my opinion, the UidToMsnConverter is a mistake. Caching UIDs should be left as an exercice to the store implementor if they want it, or be provided as an optional service. This layers has made debugging difficult for me. The getMsn method returning -1 has also masked some problem from my view while debugging, problem which were only found by observing the client IMAP trace and debugging the IMAP processor.

Well the "caching" is mostly done to make sure the UID to MSN mapping
will be correct while have the mailbox selected. Not sure how you
would handle this otherwise..

>
> --
> François-Denis Gonthier
> Programmeur/analyste
> 819-780-8955 #1128                http://www.revolutionlinux.com/
>

But as always we are very happy with any comment/question to improve
the code more :)

Bye,
Norman

---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org