Enum imap_types::state::State
source · pub enum State<'a> {
Greeting,
NotAuthenticated,
Authenticated,
Selected(Mailbox<'a>),
Logout,
IdleAuthenticated(Tag<'a>),
IdleSelected(Tag<'a>, Mailbox<'a>),
}
Expand description
State of the IMAP4rev1 connection.
Variants§
Greeting
NotAuthenticated
The client MUST supply authentication credentials before most commands will be permitted. This state is entered when a connection starts unless the connection has been pre-authenticated.
Authenticated
The client is authenticated and MUST select a mailbox to access before commands that affect messages will be permitted. This state is entered when a pre-authenticated connection starts, when acceptable authentication credentials have been provided, after an error in selecting a mailbox, or after a successful CLOSE command.
Selected(Mailbox<'a>)
A mailbox has been selected to access. This state is entered when a mailbox has been successfully selected.
Logout
The connection is being terminated. This state can be entered as a result of a client request (via the LOGOUT command) or by unilateral action on the part of either the client or server.
If the client requests the logout state, the server MUST send an untagged BYE response and a tagged OK response to the LOGOUT command before the server closes the connection; and the client MUST read the tagged OK response to the LOGOUT command before the client closes the connection.
A server MUST NOT unilaterally close the connection without sending an untagged BYE response that contains the reason for having done so. A client SHOULD NOT unilaterally close the connection, and instead SHOULD issue a LOGOUT command. If the server detects that the client has unilaterally closed the connection, the server MAY omit the untagged BYE response and simply close its connection.