[Net-IMAP-Server] way for mailbox to tell it has been selected?

Richard Russo russor_work at yahoo.com
Sat Dec 12 16:54:54 EST 2009



--- On Fri, 12/11/09, Alex Vandiver <alexmv at bestpractical.com> wrote:

> From: Alex Vandiver <alexmv at bestpractical.com>
> Subject: Re: [Net-IMAP-Server] way for mailbox to tell it has been selected?
> To: "Richard Russo" <russor_work at yahoo.com>
> Cc: "net-imap-server" <net-imap-server at bestpractical.com>
> Date: Friday, December 11, 2009, 10:40 PM
> On Fri, 2009-12-11 at 08:46 -0800,
> Richard Russo wrote:
> > I was testing this this morning, and I'm seeing some
> weird behavior...
> > when I do a select, I'm getting back OK [READ-ONLY]
> Completed.  I'll
> > plan to track it down this weekend.
> 
> I happened to have a spare tuit this evening, and found it
> -- it was a
> precedence bug.  Should be fixed in 833c1e7.
> 

Ah, that makes sense now.

> >   Also, I may send a patch to support
> the mailbox denying a select, I
> > have an account on a server which does this for a
> specific mailbox
> > (that it does not list with \Noselect); this is
> totally gross however,
> > so I want to make sure that telling the client NO on
> the select would
> > be the best way to handle it.
> 
> Hm.  That's kinda a, euh, specific need, and one that
> we don't exactly
> want to encourage -- that's what ->is_selectable is
> _supposed_ to be
> for, and it rightly sets \Noselect.  Possible more
> palatable workarounds
> in my mind would be either allowing mailboxes to filter
> their attributes
> in LIST, or storing the current Net::IMAP::Server::Command
> on the
> connection, and then your is_selectable could check
> Net::IMAP::Server->connection->current_command and
> lie appropriately.

OK.  I think I'll skip this for now; if I'm proxying to a server that can't tell me a mailbox is unselectable until I've selected it, I will force it read only, and have no messages in it.  In the example case I have, a particular mailbox* is never selectable, and has no messages (that I can see) anyway.  I'll bring it up again if I run into a case where a real world server does not consistently allow selecting mailboxes, and if that server is not borken. :D

*The mailbox in question is a 'Internet Newsgroup' mailbox on Exchange.  I don't really know why it's not listed as unselectable.



More information about the Net-IMAP-Server mailing list