The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Net::Async::IMAP::Client - asynchronous IMAP client based on Protocol::IMAP::Client and IO::Async::Protocol::Stream.

SYNOPSIS

 use IO::Async::Loop;
 use Net::Async::IMAP;
 my $loop = IO::Async::Loop->new;
 my $imap = Net::Async::IMAP::Client->new(
        loop => $loop,
        host => 'mailserver.com',
        service => 10143, # custom port number example
        user => 'user@mailserver.com',
        pass => 'password',

# Automatically retrieve any new messages that arrive on the server on_message_received => sub { my ($self, $id) = @_; $self->fetch($id); },

# Display the subject whenever we have a successful FETCH command on_message => sub { my ($self, $msg) = @_; warn "Had message " . Email::Simple->new($msg)->header('Subject') . "\n"; }, ); $loop->loop_forever;

DESCRIPTION

Provides support for communicating with IMAP servers under IO::Async.

See Protocol::IMAP for more details on this implementation of IMAP, and RFC3501 for the official protocol specification.

METHODS

new

Instantiate a new object. Will add to the event loop if the loop parameter is passed.

on_read_line

Pass any new data into the protocol handler.

configure

Apply callbacks and other parameters, preparing state for event loop start.

on_connection_established

Prepare and activate a new transport.

on_starttls

Upgrade the underlying stream to use TLS.

start_idle_timer

Restart the idle timer.

stop_idle_timer

Disable the timer if it's running.

_add_to_loop

Set up the connection automatically when we are added to the loop.

TODO: this is probably the wrong way to go about things, move this somewhere more appropriate.

TODO(pe): Ish... It would be nice if the IO::Async::Protocol could manage an automatic ->connect call

connect

AUTHOR

Tom Molesworth <net-async-imap@entitymodel.com>

LICENSE

Copyright Tom Molesworth 2010-2011. Licensed under the same terms as Perl itself.