
Net::IMAP::Server::Mailbox - A user's view of a mailbox

This class encapsulates the view of messages in a mailbox. You may wish to subclass this class in order to source our messages from, say, a database.

Creates a new mailbox; returns undef if a mailbox with the same full path already exists.
It calls "init",
then "load_data".
Sets up basic properties of the mailbox:
This default mailbox implementation attempts to find a mbox file whose name is based on the full path of the mailbox,
and load messages from that file.
It makes no attempt to write back any changes to the file.
Subclasses will probably wish to override this method.
Gets or sets the name of the mailbox. This includes a workaround for Zimbra, which doesn't understand mailbox names with colons in them -- so we substitute dashes.
Called when the server wishes the mailbox to update its state. By default, does nothing. Subclasses will probably wish to override this method.
Adds the gven Net::IMAP::Server::Message MESSAGE to the mailbox,
setting its "sequence" in Net::IMAP::Server::Message and "mailbox" in Net::IMAP::Server::Message.
"uid" in Net::IMAP::Server::Message is set to "uidnext" if the message does not already have a uid.
Creates a mailbox under this mailbox, of the same class as this mailbox is. Any arguments are passed to "new". Returns the newly added subfolder, or undef if a folder with that name already exists.
Identical to "add_child". Should return false if the create is denied or fails.
Reparents this mailbox to be a child of the given Net::IMAP::Server::Mailbox MAILBOX.
Shold return 0 if the reparenting is denied or fails.
Deletes this mailbox, removing it from its parent's list of children. Should return false if the deletion is denied or fails.
Expunges messages marked as \Deleted.
If an arrayref of message sequence numbers is provided,
only expunges message from that set.
Appends,
and returns,
the given MESSAGE,
which should be a string containing the message.
Returns false is the append is denied or fails.
Called when the client selects a different mailbox, or when the client's connection closes. By default, does nothing.
Returns the path seperator. Note that only the path seperator of the root mailbox matters. Defaults to a forward slash.
Returns the full path to this mailbox.
Returns the list of flags that this mailbox supports.
Returns true if the client is allowed to set the given flag in this mailbox; this simply scans "flags" to check.
Returns the number of messages in this mailbox. Observing this also sets the "high water mark" for notifying the client of messages added.
Returns the number of messages which have the \Recent flag set.
Returns the number of messages which do not have the \Seen flag set.
Returns the flags which will be stored permanently for this mailbox; defaults to the same set as "flags" returns.
Returns true if this mailbox is read-only. By default, always returns false.
Returns true if this mailbox is the mailbox selected by the current Net::IMAP::Server::Connection.
Parses and returns messages fitting the given UID range.
Parses and returns messages fitting the given sequence range. Note that since sequence numbers are connection-dependent, this simply passes the buck to "Net::IMAP::Server::Connection/get_messages".
Called before the model's children are listed to the client. This is the right place to hook into for mailboxes whose children shift with time.
Called before the mailbox is destroyed; this deals with cleaning up the several circular references involved. In turn, it calls "prep_for_destroy" on all child mailboxes, as well as all messages it has.