File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -20,10 +20,20 @@ type Select struct {
2020
2121func (cmd * Select ) Handle (conn Conn ) error {
2222 ctx := conn .Context ()
23+
24+ // As per RFC1730#6.3.1,
25+ // The SELECT command automatically deselects any
26+ // currently selected mailbox before attempting the new selection.
27+ // Consequently, if a mailbox is selected and a SELECT command that
28+ // fails is attempted, no mailbox is selected.
29+ // For example, some clients (e.g. Apple Mail) perform SELECT "" when the
30+ // server doesn't announce the UNSELECT capability.
31+ ctx .Mailbox = nil
32+ ctx .MailboxReadOnly = false
33+
2334 if ctx .User == nil {
2435 return ErrNotAuthenticated
2536 }
26-
2737 mbox , err := ctx .User .GetMailbox (cmd .Mailbox )
2838 if err != nil {
2939 return err
@@ -149,7 +159,7 @@ func (cmd *List) Handle(conn Conn) error {
149159 go (func () {
150160 done <- conn .WriteResp (res )
151161 // Make sure to drain the channel.
152- for _ = range ch {
162+ for range ch {
153163 }
154164 })()
155165
You can’t perform that action at this time.
0 commit comments