MBOX-Line: From guenther+imap at sendmail.com  Thu Mar  6 17:54:21 2008
To: imap-protocol@u.washington.edu
From: Philip Guenther <guenther+imap@sendmail.com>
Date: Fri Jun  8 12:34:41 2018
Subject: [Imap-protocol] LSUB with the %
In-Reply-To: <47D099C5.9040805@stalker.com>
References: <47D099C5.9040805@stalker.com>
Message-ID: <alpine.BSO.1.00.0803061841540.26647@vanye.mho.net>

On Fri, 7 Mar 2008, Roman Prokhorov wrote:
> Quoting RFC 3501:
>>       A special situation occurs when using LSUB with the % wildcard.
>>       Consider what happens if "foo/bar" (with a hierarchy delimiter of
>>       "/") is subscribed but "foo" is not.  A "%" wildcard to LSUB must
>>       return foo, not foo/bar, in the LSUB response, and it MUST be
>>       flagged with the \Noselect attribute.
>
> Could someone please explain why this exception is needed?
>
> E.g. if I'm subscribed to "User/somedropbox", why would I need to discover 
> that I'm also subscribed to "Users" if I'm not? Assuming that 'LSUB *' will 
> return only User/somedropbox - any client can get confused.

"User" will be returned by LSUB with the \noselect attribute, so the 
client knows that the mailbox isn't really subscribed.  No reason to get 
confused.


> If some client uses a sequence of 'LSUB %', then 'LSUB found/%', etc for 
> reading the tree of subscriptions - this is a problem of the client, and 
> it should not be transferred to all servers and clients.

Okay, imagine this special handling didn't exist.  Please explain how a 
client is to discover that you're subscribed to "Users/somedropbox" 
without doing an 'LSUB "" *' and without iterating over the output of a 
normal LIST.  I.e., how is it supposed to discover that there's a 
subscribed mailbox under "Users" at all?


> If I have lookup right on 'one/two' mailbox but no lookup right on 'one' 
> - does it mean that the same "special situation" should occur for LIST 
> command which on 'LIST "~someuser" "%"' should show me 'one' (despite of 
> the fact that I don't have lookup right for it) if a 'one/two' mailbox 
> exist which for I do have lookup right?

You should probably be sending 'LIST "~someuser/" "%"'.  Note the trailing 
hierarchy delimiter on the reference argument.

With that caveat, you are correct: you should get back
 	* LIST (\Noselect) "/" ~someuser/one

(The \noselect attribute *really* means "no lookup right, doesn't exist, 
or doesn't match the selection criterion")


Philip Guenther

