Internet Message Access Protocol (IMAP) UNSELECT command
Extracted elements (8)
IMAP4 lacked a command to close the selected mailbox without expunging it; the existing workarounds (SELECT with a nonexistent mailbox or EXAMINE to reselect) were functional but inelegant. UNSELECT was introduced to provide a clean solution for clients that need to release resources without triggering message deletion.
A server that supports this extension MUST advertise the capability name 'UNSELECT' in its CAPABILITY response. Clients should check for this capability before issuing the command.
Implementations MUST accept the UNSELECT command string in a case-insensitive fashion.
The UNSELECT command frees server resources associated with the selected mailbox and returns the server to the authenticated state. It performs the same actions as CLOSE, except that no messages are permanently removed from the currently selected mailbox. It takes no arguments and produces no specific responses beyond the tagged OK or BAD result.
This document registers the 'UNSELECT' capability in the IMAP4 capabilities registry maintained by IANA at http://www.iana.org/assignments/imap4-capabilities. IMAP4 capabilities are registered by publishing a standards-track or IESG-approved experimental RFC.
The UNSELECT extension is believed not to raise any additional security concerns beyond those already discussed in RFC 3501 (IMAP4rev1).
Successful execution of UNSELECT transitions the server from the Selected state to the Authenticated state. On failure (no mailbox selected, or an argument is supplied), the server returns BAD and remains in its current state.
The formal ABNF grammar extends the IMAP4 command-select rule as: command-select /= 'UNSELECT'. The command takes no arguments and is case-insensitive.