Net::IMAP::Server::Connection - Connection to a client
Maintains all of the state for a client connection to the IMAP server.
Creates a new connection; the server will take care of this step.
Returns the Net::IMAP::Server that this connection is on.
Returns the Coro process associated with this connection. For things interacting with this connection, it will probably be the current coroutine, except for interactions coming from event loops.
Returns the IO handle that can be used to read from or write to the client.
Gets or sets the Net::IMAP::Server::DefaultModel or descendant associated with this connection. Note that connections which have not authenticated yet do not have a model.
Gets or sets the Net::IMAP::Server::DefaultAuth or descendant associated with this connection. Note that connections which have not authenticated yet do not have an auth object.
When called with no arguments, returns a hashref of identifying information provided by the client. When key-value pairs are provided, sets the client properties. See RFC 2971.
Gets or sets the currently selected mailbox for this connection. Changing mailboxes triggers the sending of untagged notifications to the client, as well as calling "close" in Net::IMAP::Server::Mailbox and "select" in Net::IMAP::Server::Mailbox.
Returns true of the currently selected mailbox has been forced into read-only mode. Note that the mailbox may be read-only for other reasons, so checking "read_only" in Net::IMAP::Server::Mailbox is suggested instead.
Sends out a one-line untagged greeting to the client.
The main line handling loop. Since we are using Coro, this cedes to other coroutines whenever we block, given them a chance to run. We additionally cede after handling every command.
Updates the inactivity timer.
Returns the EV watcher in charge of the inactivity timer.
Returns the number of client commands the connection has processed.
Handles a single line from the client. This is not quite the same as handling a command, because of client literals and continuation commands. This also handles dispatch of client commands to Net::IMAP::Server::Command subclasses (see "class_for").
Any errors generated while running commands will cause a
NO Server error to be sent to the client -- unless the error message starts with
NO or c<BAD>,
in which case it will be relayed to the client.
Returns the Net::IMAP::Server::Command instance that was run,
undef if it was a continuation line or pending interactive command.
Returns the package name that implements the given
See "add_command" in Net::IMAP::Server.
If a connection has pending state, contains the callback that will receive the next line of input.
Shuts down this connection, also closing the model and mailboxes.
Parses the line into the
Returns undef if parsing fails for some reason.
Returns true if the connection is unauthenticated.
Returns true if the connection is authenticated.
Returns true if the connection has selected a mailbox.
Returns true if the connection is protected by SSL or TLS.
Polls the currently selected mailbox, and resets the poll timer.
Forces a poll of the selected mailbox the next chance we get.
Gets or sets the last time the selected mailbox was polled, in seconds since the epoch.
The high-water mark of how many messages the client has been told are in the mailbox.
Sends any untagged updates about the current mailbox to the client.
Parses and returns messages fitting the given sequence range. This is on the connection and not the mailbox because messages have connection-dependent sequence numbers.
Returns the sequence number for the given message.
Returns the current capability list for this connection,
as a string.
Connections not under TLS or SSL always have the
and no authentication capabilities.
The "auth_class" in Net::IMAP::Server's "sasl_provides" in Net::IMAP::Server::DefaultAuth method is used to list known
Defers to "log" in Net::IMAP::Server.
Sends an untagged response to the client; a newline ia automatically appended.