The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Mail::Transport::POP3 - receive messages via POP3

CLASS INHERITANCE

Mail::Transport::POP3 is a Mail::Transport::Receive is a Mail::Transport is a Mail::Reporter

SYNOPSIS

 my $receiver = Mail::Transport::POP3->new(...);
 my $message = $receiver->receive($id);

DESCRIPTION

Receive messages via the POP3 protocol. This object handles the contact with one POP3 server, and recovers broken connections automatically.

METHODS

Initiation

new OPTIONS
 OPTION               DEFAULT
 authenticate         'LOGIN'
 hostname             'localhost'
 interval             30
 log                  'WARNINGS'
 password             undef
 port                 undef
 proxy                undef
 retry                <false>
 timeout              120
 trace                'WARNINGS'
 username             undef
 via                  'sendmail'
authenticate => 'LOGIN'|'APOP'

Use the old LOGIN authentication (unencrypted, default) or the newer APOP.

hostname => HOSTNAME|ARRAY-OF-HOSTNAMES

See Mail::Transport::new(hostname)

interval => SECONDS

See Mail::Transport::new(interval)

log => LEVEL

See Mail::Reporter::new(log)

password => STRING

See Mail::Transport::new(password)

port => INTEGER

See Mail::Transport::new(port)

proxy => PATH

See Mail::Transport::new(proxy)

retry => NUMBER|undef

See Mail::Transport::new(retry)

timeout => SECONDS

See Mail::Transport::new(timeout)

trace => LEVEL

See Mail::Reporter::new(trace)

username => STRING

See Mail::Transport::new(username)

via => CLASS|NAME

See Mail::Transport::new(via)

Server Connection

findBinary NAME [, DIRECTORIES]

See Mail::Transport::findBinary()

remoteHost

See Mail::Transport::remoteHost()

retry

See Mail::Transport::retry()

Receiving Mail

contactServer

Contact the server if the connection was lost, or has not been made yet. When connecting fails, undef is returned. If the contact to the server was still present, or could be established, an IO::Socket::INET is returned.

delete UIDLS

Flag the specified message(s) to be deleted on the remote server. The deletion will take place on the moment that the connection is lost, whether this is on purpose or not.

disconnect

Break contact with the server, if that still exists.

header UIDL, [BODYLINES]

Returns a reference to an array which contains the header of the message with the specified UIDL. The optional integer BODYLINES specifies the number of lines from the body which are wanted: by default all.

Examples:

 my $ref_lines = $pop3->header($uidl);
 print @$ref_lines;
messages

Returns a list of all uidl's which are known by the server on this moment.

receive [UNIQUE-MESSAGE-ID]

See Mail::Transport::Receive::receive()

size UIDL

Returns the size of the message which is indicated by the UIDL, in octets. If the message is remotely deleted, this will return undef.

stat

Returns the maildrop of the pop server; a list of two elements: the number of messages followed by the total folder size in octets.

Examples:

 my ($nr_messages, $total_size) = $pop3->stat;
uidl2seqnr UIDL

Translates the unique UIDL of a message into a sequence number which represents the message as long a this connection to the POP3 server exists. When the message has been deleted for some reason, undef is returned.

url

Represent this pop3 connection as URL.

Logging and Tracing

defaultTrace [LEVEL, [LEVEL]

See Mail::Reporter::defaultTrace()

errors

See Mail::Reporter::errors()

log [LEVEL [,STRINGS]]

See Mail::Reporter::log()

report [LEVEL]

See Mail::Reporter::report()

reportAll [LEVEL]

See Mail::Reporter::reportAll()

trace [LEVEL]

See Mail::Reporter::trace()

warnings

See Mail::Reporter::warnings()

Other Methods

AUTOLOAD

See Mail::Reporter::AUTOLOAD()

DESTROY

See Mail::Reporter::DESTROY()

inGlobalDestruction

See Mail::Reporter::inGlobalDestruction()

logPriority LEVEL

See Mail::Reporter::logPriority()

logSettings

See Mail::Reporter::logSettings()

notImplemented

See Mail::Reporter::notImplemented()

SEE ALSO

A good start to read is Mail::Box-Overview. More documentation and a mailinglist are available from the project's website at http://perl.overmeer.net/mailbox/.

AUTHOR

Mark Overmeer (mark@overmeer.net) with the help of many.

VERSION

This code is beta, version 2.022.

Copyright (c) 2001-2002 Mark Overmeer. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.