SEARCH
NEW RPMS
DIRECTORIES
ABOUT
FAQ
VARIOUS
BLOG

BotDetect - Real-Time Bot Detection API
 
 

MAN page from Old RedHat 6.X perl-POP3Client-2.5-6.i386.rpm

POP3Client

Section: User Contributed Perl Documentation (3)
Updated: perl 5.005, patch 03
Index 

NAME

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

SYNOPSIS

  use Mail::POP3Client;  $pop = new Mail::POP3Client( USER     => "me",                               PASSWORD => "mypassword",                               HOST     => "pop3.do.main" );  for( $i = 1; $i <= $pop->Count(); $i++ ) {    foreach( $pop->Head( $i ) ) {      /^(From|Subject):\s+/i && print $_, "\n";    }  }  $pop->Close();  # OR  $pop2 = new Mail::POP3Client( HOST  => "pop3.otherdo.main" );  $pop2->User( "somebody" );  $pop2->Pass( "doublesecret" );  $pop2->Connect() || die $pop2->Message();  $pop2->Close();
 

DESCRIPTION

This module implements an Object-Oriented interface to a POP3 server.It implements RFC1939 (http://www.faqs.org/rfcs/rfc1939.html) 

EXAMPLES

Here is a simple example to list out the From: and Subject: headers inyour remote mailbox:

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

CONSTRUCTORS

Old style (deprecated):
   new Mail::POP3Client( USER, PASSWORD [, HOST, PORT, DEBUG, AUTH_MODE] );

New style (shown with defaults):
   new Mail::POP3Client( USER      => "",
                         PASSWORD  => "",
                         HOST      => "pop3",
                         PORT      => 110,
                         AUTH_MODE => 'PASS',
                         DEBUG     => 0,
                         TIMEOUT   => 60,
                       );

* USER is the userID of the account on the POP server

* PASSWORD is the cleartext password for the userID

* HOST is the POP server name or IP address (default = `pop3')

* PORT is the POP server port (default = 110)

* DEBUG - any non-null, non-zero value turns on debugging (default = 0)

* AUTH_MODE - pass `APOP' to attempt APOP (MD5) authorization. (default is `PASS')

* TIMEOUT - set a timeout value for socket operations (default = 60)
 

METHODS

These commands are intended to make writing a POP3 client easier.They do not necessarily map directly to POP3 commands defined inRFC1081 or RFC1939, although all commands should be supported. Somecommands return multiple lines as an array in an array context.
new( USER => `user', PASSWORD => `password', HOST => `host', PORT => 110, DEBUG => 0, AUTH_MODE => `PASS', TIMEOUT => 60 )
Construct a new POP3 connection with this. You should use thehash-style constructor. The old positional constructor isdeprecated and will be removed in a future release. It is stronglyrecommended that you convert your code to the new version.

You should give it at least 2 arguments: USER and PASSWORD. Thedefault HOST is `pop3' which may or may not work for you. You canspecify a different PORT (be careful here).

new will attempt to Connect to and Login to the POP3 server if yousupply a USER and PASSWORD. If you do not supply them in theconstructor, you will need to call Connect yourself.

The valid values for AUTH_MODE are `PASS' and `APOP'. APOP impliesthat an MD5 checksum will be used instrad of passing your password incleartext. However, if the server does not support APOP, thecleartext method will be used. Be careful.

If you enable debugging with DEBUG => 1, messages about command willgo to STDERR.

Another warning, it's impossible to differentiate between a timeoutand a failure.

Head( MESSAGE_NUMBER )
Get the headers of the specified message, either as an array or as astring, depending on context.

You can also specify a number of preview lines which will be returnedwith the headers. This may not be supported by all POP3 serverimplementations as it is marked as optional in the RFC. Submitted byDennis Moroney <dennisAATThub.iwl.net>.

Body( MESSAGE_NUMBER )
Get the body of the specified message, either as an array of lines oras a string, depending on context.
HeadAndBody( MESSAGE_NUMBER [, PREVIEW_LINES ] )
Get the head and body of the specified message, either as an array oflines or as a string, depending on context.
Example
foreach ( $pop->HeadAndBody( 1, 10 ) )
   print $_, ``\n'';

prints out a preview of each message, with the full header and thefirst 10 lines of the message (if supported by the POP3 server).

Retrieve( MESSAGE_NUMBER )
Same as HeadAndBody.
Delete( MESSAGE_NUMBER )
Mark the specified message number as DELETED. Becomes effective uponQUIT. Can be reset with a Reset message.
Connect
Start the connection to the POP3 server. You can pass in the host andport.
Close
Close the connection gracefully. POP3 says this will perform anypending 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 themailbox.
List
Return a list of sizes of each message.
ListArray
Return a list of sizes of each message. This returns an indexedarray, with each message number as an index (starting from 1) and thevalue as the next entry on the line. Beware that some servers sendadditional info for each message for the list command. That info maybe lost.
Uidl( [MESSAGE_NUMBER] )
Return the unique ID for the given message (or all of them). Returnsan indexed array with an entry for each valid message number.Indexing begins at 1 to coincide with the server's indexing.
Last
Return the number of the last message, retrieved from the server.
Reset
Tell the server to unmark any message marked for deletion.
User( [USER_NAME] )
Set/Return the current user name.
Pass( [PASSWORD] )
Set/Return the current user name.
Login
Attempt to login to the server connection.
Host( [HOSTNAME] )
Set/Return the current host.
Port( [PORT_NUMBER] )
Set/Return the current port number.
 

AUTHOR

Sean Dowd <pop3clientAATTdowds.net> 

CREDITS

Based loosely on News::NNTPClient by Rodger Anderson<rodgerAATTboi.hp.com>. 

SEE ALSO

perl(1).


 

Index

NAME
SYNOPSIS
DESCRIPTION
EXAMPLES
CONSTRUCTORS
METHODS
AUTHOR
CREDITS
SEE ALSO

This document was created byman2html,using the manual pages.
 
ICM Bot detect detector