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

NAME

Mail::POP3Client - Perl 5 module to talk to a POP3 (RFC1081) server

DESCRIPTION

This module implements an Object-Oriented interface to a POP3 server. It is based on RFC1939. Version 1.19 adds some unofficial support for APOP.

USAGE

Here is a simple example to list out the headers in your remote mailbox:

  #!/usr/local/bin/perl
  
  use Mail::POP3Client;
  
  $pop = new Mail::POP3Client("me", "mypassword", "pop3.do.main");
  for ($i = 1; $i <= $pop->Count; $i++) {
        print $pop->Head($i), "\n";
  }

POP3Client Commands

These commands are intended to make writing a POP3 client easier. They do not necessarily map directly to POP3 commands defined in RFC1081. Some commands return multiple lines as an array in an array context, but there may be missing places.

new

Construct a new POP3 connection with this. You should give it at least 2 arguments: username and password. The next 2 optional arguments are the POP3 host and port number. A final fifth argument of a positive integer enables debugging on the object (to STDERR).

Get the headers of the specified message. Here is a simple Biff program:

  #!/usr/local/bin/perl
  
  use Mail::POP3Client;
  
  $pop = new Mail::POP3Client("me", "mypass", "pop3.do.main");
  for ($i = 1; $i <= $pop->Count; $i++) {
        foreach ($pop->Head($i)) {
                /^(From|Subject): / and print $_, "\n";
        }
        print "\n";
  }
Body

Get the body of the specified message.

HeadAndBody

Get the head and body of the specified message.

Retrieve

Same as HeadAndBody.

Delete

Mark the specified message number as DELETED. Becomes effective upon QUIT. Can be reset with a Reset message.

Connect

Start the connection to the POP3 server. You can pass in the host and port.

Close

Close the connection gracefully. POP3 says this will perform any pending deletes on the server.

Alive

Return true or false on whether the connection is active.

Socket

Return the file descriptor for the socket.

Size

Set/Return the size of the remote mailbox. Set by POPStat.

Count

Set/Return the number of remote messages. Set during Login.

Message

The last status message received from the server.

State

The internal state of the connection: DEAD, AUTHORIZATION, TRANSACTION.

POPStat

Return the results of a POP3 STAT command. Sets the size of the mailbox.

List

Return a list of sizes of each message.

Last

Return the number of the last message, retrieved from the server.

Reset

Tell the server to unmark any message marked for deletion.

User

Set/Return the current user name.

Pass

Set/Return the current user name.

Login

Attempt to login to the server connection.

Host

Set/Return the current host.

Port

Set/Return the current port number.

AUTHOR

Sean Dowd <ssd@ticnet.com>

COPYRIGHT

Copyright (c) 1995,1996 Electonic Data Systems, Inc. All rights reserved. This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

CREDITS

Based loosely on News::NNTPClient by Rodger Anderson <rodger@boi.hp.com>.

1 POD Error

The following errors were encountered while parsing the POD:

Around line 158:

You forgot a '=back' before '=head1'