Protocol::IMAP::Server - server support for the Internet Message Access Protocol.
package Example::IMAP::Server; use parent qw{Protocol::IMAP::Server}; package main; Example::IMAP::Server->new;
The Protocol::IMAP classes only provides the framework for handling IMAP data. Typically you would need to subclass these to get a usable IMAP implementation.
The following methods are required:
write - called at various points to send data back across to the other side of the IMAP connection
and just about anything relating to the storage and handling of messages.
Read a command from a single line input from the client.
If this is a supported command, calls the relevant request_XXX method with the following data as a hash:
tag - IMAP tag information for this command, used for the final response from the server
command - actual command requested
param - any additional parameters passed after the command
Request a list of all capabilities provided by the server.
These will be returned in a single untagged response, followed by the usual status response.
Note that the capabilities may vary depending on the state of the connection - for example, before STARTTLS negotiation all login types may be disabled via LOGINDISABLED capability.
Instructs the client to begin STARTTLS negotiation.
All implementations should provide this.
Requests SASL authentication. Didn't need it, haven't written it yet.
Returns true if we are authenticated, false if not.
Process a login request - this will be delegated to the subclass validate_user method.
Process a logout request.
Handle a NOOP, which leaves state unchanged other than resetting any timers (as handled by the read_command method).
Select a mailbox.
send_mailbox_info
Return untagged information about the selected mailbox.
Select a mailbox, in readonly mode.
Create a new mailbox.
Delete a given mailbox.
Request renaming a mailbox to something else.
Ask to subscribe to a mailbox.
Ask to unsubscribe from a mailbox.
List mailboxes matching a specification.
List subscriptions matching a spec - see request_list for more details on how this is implemented.
Called when we have multi-line data (fixed size in characters).
Called when there's more data to process for a single-line (standard mode) response.
Set up any callbacks that were available.
Add a new capability to the reported list.
Validate the given user and password information, returning true if they have logged in successfully and false if they are invalid.
Selects the given mailbox.
Expects a hashref indicating mailbox information, e.g.:
my $mailbox = { name => $args{mailbox}, exists => 17, recent => 2, }; return $mailbox;
Creates the given mailbox on the server.
Deletes the given mailbox.
Renames the given mailbox.
Adds the given mailbox to the active subscription list.
Removes the given mailbox from the current user's subscription list.
List mailbox information given a search spec.
List subscriptions given a search spec.
To install Protocol::IMAP, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Protocol::IMAP
CPAN shell
perl -MCPAN -e shell install Protocol::IMAP
For more information on module installation, please visit the detailed CPAN module installation guide.