home *** CD-ROM | disk | FTP | other *** search
-
- <HTML>
- <HEAD>
- <TITLE>Mail::POP3Client - Perl 5 module to talk to a POP3 server</TITLE>
- <LINK REL="stylesheet" HREF="../../../Active.css" TYPE="text/css">
- <LINK REV="made" HREF="mailto:">
- </HEAD>
-
- <BODY>
- <TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%>
- <TR><TD CLASS=block VALIGN=MIDDLE WIDTH=100% BGCOLOR="#cccccc">
- <STRONG><P CLASS=block> Mail::POP3Client - Perl 5 module to talk to a POP3 server</P></STRONG>
- </TD></TR>
- </TABLE>
-
- <A NAME="__index__"></A>
- <!-- INDEX BEGIN -->
-
- <UL>
-
- <LI><A HREF="#name">NAME</A></LI><LI><A HREF="#supportedplatforms">SUPPORTED PLATFORMS</A></LI>
-
- <LI><A HREF="#synopsis">SYNOPSIS</A></LI>
- <LI><A HREF="#description">DESCRIPTION</A></LI>
- <LI><A HREF="#examples">EXAMPLES</A></LI>
- <LI><A HREF="#constructors">CONSTRUCTORS</A></LI>
- <LI><A HREF="#methods">METHODS</A></LI>
- <LI><A HREF="#author">AUTHOR</A></LI>
- <LI><A HREF="#credits">CREDITS</A></LI>
- <LI><A HREF="#see also">SEE ALSO</A></LI>
- </UL>
- <!-- INDEX END -->
-
- <HR>
- <P>
- <H1><A NAME="name">NAME</A></H1>
- <P>Mail::POP3Client - Perl 5 module to talk to a POP3 (RFC1939) server</P>
- <P>
- <HR>
- <H1><A NAME="supportedplatforms">SUPPORTED PLATFORMS</A></H1>
- <UL>
- <LI>Linux</LI>
- <LI>Solaris</LI>
- <LI>Windows</LI>
- </UL>
- <HR>
- <H1><A NAME="synopsis">SYNOPSIS</A></H1>
- <PRE>
- 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();</PRE>
- <P>
- <HR>
- <H1><A NAME="description">DESCRIPTION</A></H1>
- <P>This module implements an Object-Oriented interface to a POP3 server.
- It implements RFC1939 (http://www.faqs.org/rfcs/rfc1939.html)</P>
- <P>
- <HR>
- <H1><A NAME="examples">EXAMPLES</A></H1>
- <P>Here is a simple example to list out the From: and Subject: headers in
- your remote mailbox:</P>
- <PRE>
- #!/usr/local/bin/perl
- </PRE>
- <PRE>
-
- use Mail::POP3Client;</PRE>
- <PRE>
-
- $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";
- }</PRE>
- <P>
- <HR>
- <H1><A NAME="constructors">CONSTRUCTORS</A></H1>
- <P>Old style (deprecated):
- new Mail::POP3Client( USER, PASSWORD [, HOST, PORT, DEBUG, AUTH_MODE] );</P>
- <P>New style (shown with defaults):
- new Mail::POP3Client( USER => ``'',
- PASSWORD => ``'',
- HOST => ``pop3'',
- PORT => 110,
- AUTH_MODE => 'PASS',
- DEBUG => 0,
- TIMEOUT => 60,
- );</P>
- <UL>
- <LI><STRONG><A NAME="item_USER_is_the_userID_of_the_account_on_the_POP_serve">USER is the userID of the account on the POP server</A></STRONG><BR>
-
- <LI><STRONG><A NAME="item_PASSWORD_is_the_cleartext_password_for_the_userID">PASSWORD is the cleartext password for the userID</A></STRONG><BR>
-
- <LI><STRONG><A NAME="item_address">HOST is the POP server name or IP address (default = 'pop3')</A></STRONG><BR>
-
- <LI><STRONG><A NAME="item_port">PORT is the POP server port (default = 110)</A></STRONG><BR>
-
- <LI><STRONG><A NAME="item_debugging">DEBUG - any non-null, non-zero value turns on debugging (default = 0)</A></STRONG><BR>
-
- <LI><STRONG><A NAME="item_APOP">AUTH_MODE - pass 'APOP' to attempt APOP (MD5) authorization. (default is 'PASS')</A></STRONG><BR>
-
- <LI><STRONG><A NAME="item_operations">TIMEOUT - set a timeout value for socket operations (default = 60)</A></STRONG><BR>
-
- </UL>
- <P>
- <HR>
- <H1><A NAME="methods">METHODS</A></H1>
- <P>These commands are intended to make writing a POP3 client easier.
- They do not necessarily map directly to POP3 commands defined in
- RFC1081 or RFC1939, although all commands should be supported. Some
- commands return multiple lines as an array in an array context.</P>
- <DL>
- <DT><STRONG><A NAME="item_new"><EM>new</EM>( USER => 'user', PASSWORD => 'password', HOST => 'host',
- PORT => 110, DEBUG => 0, AUTH_MODE => 'PASS', TIMEOUT => 60 )</A></STRONG><BR>
- <DD>
- Construct a new POP3 connection with this. You should use the
- hash-style constructor. <STRONG>The old positional constructor is
- deprecated and will be removed in a future release. It is strongly
- recommended that you convert your code to the new version.</STRONG>
- <P>You should give it at least 2 arguments: USER and PASSWORD. The
- default HOST is 'pop3' which may or may not work for you. You can
- specify a different PORT (be careful here).</P>
- <P>new will attempt to Connect to and Login to the POP3 server if you
- supply a USER and PASSWORD. If you do not supply them in the
- constructor, you will need to call Connect yourself.</P>
- <P>The valid values for AUTH_MODE are 'PASS' and 'APOP'. APOP implies
- that an MD5 checksum will be used instrad of passing your password in
- cleartext. However, <STRONG>if the server does not support APOP, the
- cleartext method will be used. Be careful.</STRONG></P>
- <P>If you enable debugging with DEBUG => 1, messages about command will
- go to STDERR.</P>
- <P>Another warning, it's impossible to differentiate between a timeout
- and a failure.</P>
- <P></P>
- <DT><STRONG><A NAME="item_Head"><EM>Head</EM>( MESSAGE_NUMBER )</A></STRONG><BR>
- <DD>
- Get the headers of the specified message, either as an array or as a
- string, depending on context.
- <P>You can also specify a number of preview lines which will be returned
- with the headers. This may not be supported by all POP3 server
- implementations as it is marked as optional in the RFC. Submitted by
- Dennis Moroney <<A HREF="mailto:dennis@hub.iwl.net">dennis@hub.iwl.net</A>>.</P>
- <P></P>
- <DT><STRONG><A NAME="item_Body"><EM>Body</EM>( MESSAGE_NUMBER )</A></STRONG><BR>
- <DD>
- Get the body of the specified message, either as an array of lines or
- as a string, depending on context.
- <P></P>
- <DT><STRONG><A NAME="item_HeadAndBody"><EM>HeadAndBody</EM>( MESSAGE_NUMBER [, PREVIEW_LINES ] )</A></STRONG><BR>
- <DD>
- Get the head and body of the specified message, either as an array of
- lines or as a string, depending on context.
- <DL>
- <DT><STRONG><A NAME="item_Example">Example</A></STRONG><BR>
- <DD>
- foreach ( $pop->HeadAndBody( 1, 10 ) )
- print $_, ``\n'';
- <P>prints out a preview of each message, with the full header and the
- first 10 lines of the message (if supported by the POP3 server).</P>
- <P></P></DL>
- <DT><STRONG><A NAME="item_Retrieve"><EM>Retrieve</EM>( MESSAGE_NUMBER )</A></STRONG><BR>
- <DD>
- Same as HeadAndBody.
- <P></P>
- <DT><STRONG><A NAME="item_Delete"><EM>Delete</EM>( MESSAGE_NUMBER )</A></STRONG><BR>
- <DD>
- Mark the specified message number as DELETED. Becomes effective upon
- QUIT. Can be reset with a Reset message.
- <P></P>
- <DT><STRONG><A NAME="item_Connect"><EM>Connect</EM></A></STRONG><BR>
- <DD>
- Start the connection to the POP3 server. You can pass in the host and
- port.
- <P></P>
- <DT><STRONG><A NAME="item_Close"><EM>Close</EM></A></STRONG><BR>
- <DD>
- Close the connection gracefully. POP3 says this will perform any
- pending deletes on the server.
- <P></P>
- <DT><STRONG><A NAME="item_Alive"><EM>Alive</EM></A></STRONG><BR>
- <DD>
- Return true or false on whether the connection is active.
- <P></P>
- <DT><STRONG><A NAME="item_Socket"><EM>Socket</EM></A></STRONG><BR>
- <DD>
- Return the file descriptor for the socket.
- <P></P>
- <DT><STRONG><A NAME="item_Size"><EM>Size</EM></A></STRONG><BR>
- <DD>
- Set/Return the size of the remote mailbox. Set by POPStat.
- <P></P>
- <DT><STRONG><A NAME="item_Count"><EM>Count</EM></A></STRONG><BR>
- <DD>
- Set/Return the number of remote messages. Set during Login.
- <P></P>
- <DT><STRONG><A NAME="item_Message"><EM>Message</EM></A></STRONG><BR>
- <DD>
- The last status message received from the server.
- <P></P>
- <DT><STRONG><A NAME="item_State"><EM>State</EM></A></STRONG><BR>
- <DD>
- The internal state of the connection: DEAD, AUTHORIZATION, TRANSACTION.
- <P></P>
- <DT><STRONG><A NAME="item_POPStat"><EM>POPStat</EM></A></STRONG><BR>
- <DD>
- Return the results of a POP3 STAT command. Sets the size of the
- mailbox.
- <P></P>
- <DT><STRONG><A NAME="item_List"><EM>List</EM></A></STRONG><BR>
- <DD>
- Return a list of sizes of each message.
- <P></P>
- <DT><STRONG><A NAME="item_ListArray"><EM>ListArray</EM></A></STRONG><BR>
- <DD>
- Return a list of sizes of each message. This returns an indexed
- array, with each message number as an index (starting from 1) and the
- value as the next entry on the line. Beware that some servers send
- additional info for each message for the list command. That info may
- be lost.
- <P></P>
- <DT><STRONG><A NAME="item_Uidl"><EM>Uidl</EM>( [MESSAGE_NUMBER] )</A></STRONG><BR>
- <DD>
- Return the unique ID for the given message (or all of them). Returns
- an indexed array with an entry for each valid message number.
- Indexing begins at 1 to coincide with the server's indexing.
- <P></P>
- <DT><STRONG><A NAME="item_Last"><EM>Last</EM></A></STRONG><BR>
- <DD>
- Return the number of the last message, retrieved from the server.
- <P></P>
- <DT><STRONG><A NAME="item_Reset"><EM>Reset</EM></A></STRONG><BR>
- <DD>
- Tell the server to unmark any message marked for deletion.
- <P></P>
- <DT><STRONG><A NAME="item_User"><EM>User</EM>( [USER_NAME] )</A></STRONG><BR>
- <DD>
- Set/Return the current user name.
- <P></P>
- <DT><STRONG><A NAME="item_Pass"><EM>Pass</EM>( [PASSWORD] )</A></STRONG><BR>
- <DD>
- Set/Return the current user name.
- <P></P>
- <DT><STRONG><A NAME="item_Login"><EM>Login</EM></A></STRONG><BR>
- <DD>
- Attempt to login to the server connection.
- <P></P>
- <DT><STRONG><A NAME="item_Host"><EM>Host</EM>( [HOSTNAME] )</A></STRONG><BR>
- <DD>
- Set/Return the current host.
- <P></P>
- <DT><STRONG><A NAME="item_Port"><EM>Port</EM>( [PORT_NUMBER] )</A></STRONG><BR>
- <DD>
- Set/Return the current port number.
- <P></P></DL>
- <P>
- <HR>
- <H1><A NAME="author">AUTHOR</A></H1>
- <P>Sean Dowd <<A HREF="mailto:pop3client@dowds.net">pop3client@dowds.net</A>></P>
- <P>
- <HR>
- <H1><A NAME="credits">CREDITS</A></H1>
- <P>Based loosely on News::NNTPClient by Rodger Anderson
- <<A HREF="mailto:rodger@boi.hp.com">rodger@boi.hp.com</A>>.</P>
- <P>
- <HR>
- <H1><A NAME="see also">SEE ALSO</A></H1>
- <P>perl(1).</P>
- <TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%>
- <TR><TD CLASS=block VALIGN=MIDDLE WIDTH=100% BGCOLOR="#cccccc">
- <STRONG><P CLASS=block> Mail::POP3Client - Perl 5 module to talk to a POP3 server</P></STRONG>
- </TD></TR>
- </TABLE>
-
- </BODY>
-
- </HTML>
-