MBOX-Line: From dave at cridland.net  Thu Sep  8 12:58:00 2005
To: imap-protocol@u.washington.edu
From: Dave Cridland <dave@cridland.net>
Date: Fri Jun  8 12:34:36 2018
Subject: [Imap-protocol] SELECT of same mailbox
In-Reply-To: <21888.1126192430.327355@peirce.dave.cridland.net>
References: <UsPqTMxta5Q38J/4ek2JBA.md5@bluegrass.trish.de>
	<5b93232d050907075812659c02@mail.google.com>
	<5b93232d05090708031a898592@mail.google.com>
	<Pine.OSX.4.63.0509070901430.28350@pangtzu.panda.com>
	<20596.1126120360.592254@peirce.dave.cridland.net>
	<1F6D592896B8EBF14F052EB5@ninevah.local>
	<21888.1126192430.327355@peirce.dave.cridland.net>
Message-ID: <21888.1126209480.519052@peirce.dave.cridland.net>

On Thu Sep  8 16:13:50 2005, Dave Cridland wrote:
> On Thu Sep  8 07:29:59 2005, Cyrus Daboo wrote:
>> --On September 7, 2005 8:12:40 PM +0100 Dave Cridland 
>> <dave@cridland.net> wrote:
>> 
>>> Personally I like it. It means that where I need to perform an 
>>> UNSELECT,
>>> but the server doesn't support that, I can issue a known bogus 
>>> SELECT.
>>> (In fact, I do: SELECT "&#-&#/#")
>> 
>> I do 'EXAMINE' then 'CLOSE' - which works without having to force 
>> a server error.
> 
> Yes, that's better.

Actually, I'll retract this, if you don't mind. :-)

I think best would be an EXAMINE "&#-&#/#" pipelined with a CLOSE. 
This will, hopefully, fail, causing the state to switch to 
authenticated. So I'm moving from trying to elicit a NO, to trying to 
elicit a NO followed by a BAD.

An EXAMINE of a real mailbox will cause things like a UID check, etc, 
which may be relatively expensive, and possibly time consuming. A 
CLOSE of an EXAMINEd mailbox is less likely to cause much delay, but 
it'll still be non-zero time adding to the round-trip. So it'll be a 
longer round-trip - on some servers, very much longer.

I think your method is certainly cleaner, which is why I initially 
decided it was better than mine, but when I actually looked at 
changing the code, I decided there were potentially quicker ways of 
emulating UNSELECT. I agree before you say anything that it's a very 
dirty hack. :-)

For the benefit of anyone looking at the mailbox name I use in 
bewilderment, it's the most invalid modified UTF-7 I could come up 
with when I was writing it, and deliberately contains no alphanumeric 
characters to reduce the outside chance someone might have created it.

Dave.

