📄 net::pop3.3
字号:
.\" Automatically generated by Pod::Man 2.16 (Pod::Simple 3.05).\".\" Standard preamble:.\" ========================================================================.de Sh \" Subsection heading.br.if t .Sp.ne 5.PP\fB\\$1\fR.PP...de Sp \" Vertical space (when we can't use .PP).if t .sp .5v.if n .sp...de Vb \" Begin verbatim text.ft CW.nf.ne \\$1...de Ve \" End verbatim text.ft R.fi...\" Set up some character translations and predefined strings. \*(-- will.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left.\" double quote, and \*(R" will give a right double quote. \*(C+ will.\" give a nicer C++. Capital omega is used to do unbreakable dashes and.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff,.\" nothing in troff, for use with C<>..tr \(*W-.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'.ie n \{\. ds -- \(*W-. ds PI pi. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch. ds L" "". ds R" "". ds C` "". ds C' ""'br\}.el\{\. ds -- \|\(em\|. ds PI \(*p. ds L" ``. ds R" '''br\}.\".\" Escape single quotes in literal strings from groff's Unicode transform..ie \n(.g .ds Aq \(aq.el .ds Aq '.\".\" If the F register is turned on, we'll generate index entries on stderr for.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index.\" entries marked with X<> in POD. Of course, you'll have to process the.\" output yourself in some meaningful fashion..ie \nF \{\. de IX. tm Index:\\$1\t\\n%\t"\\$2"... nr % 0. rr F.\}.el \{\. de IX...\}.\".\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2)..\" Fear. Run. Save yourself. No user-serviceable parts.. \" fudge factors for nroff and troff.if n \{\. ds #H 0. ds #V .8m. ds #F .3m. ds #[ \f1. ds #] \fP.\}.if t \{\. ds #H ((1u-(\\\\n(.fu%2u))*.13m). ds #V .6m. ds #F 0. ds #[ \&. ds #] \&.\}. \" simple accents for nroff and troff.if n \{\. ds ' \&. ds ` \&. ds ^ \&. ds , \&. ds ~ ~. ds /.\}.if t \{\. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u". ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'.\}. \" troff and (daisy-wheel) nroff accents.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'.ds 8 \h'\*(#H'\(*b\h'-\*(#H'.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#].ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#].ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#].ds ae a\h'-(\w'a'u*4/10)'e.ds Ae A\h'-(\w'A'u*4/10)'E. \" corrections for vroff.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'. \" for low resolution devices (crt and lpr).if \n(.H>23 .if \n(.V>19 \\{\. ds : e. ds 8 ss. ds o a. ds d- d\h'-1'\(ga. ds D- D\h'-1'\(hy. ds th \o'bp'. ds Th \o'LP'. ds ae ae. ds Ae AE.\}.rm #[ #] #H #V #F C.\" ========================================================================.\".IX Title "Net::POP3 3".TH Net::POP3 3 "2007-12-18" "perl v5.10.0" "Perl Programmers Reference Guide".\" For nroff, turn off justification. Always turn off hyphenation; it makes.\" way too many mistakes in technical documents..if n .ad l.nh.SH "NAME"Net::POP3 \- Post Office Protocol 3 Client class (RFC1939).SH "SYNOPSIS".IX Header "SYNOPSIS".Vb 1\& use Net::POP3;\&\& # Constructors\& $pop = Net::POP3\->new(\*(Aqpop3host\*(Aq);\& $pop = Net::POP3\->new(\*(Aqpop3host\*(Aq, Timeout => 60);\&\& if ($pop\->login($username, $password) > 0) {\& my $msgnums = $pop\->list; # hashref of msgnum => size\& foreach my $msgnum (keys %$msgnums) {\& my $msg = $pop\->get($msgnum);\& print @$msg;\& $pop\->delete($msgnum);\& }\& }\&\& $pop\->quit;.Ve.SH "DESCRIPTION".IX Header "DESCRIPTION"This module implements a client interface to the \s-1POP3\s0 protocol, enablinga perl5 application to talk to \s-1POP3\s0 servers. This documentation assumesthat you are familiar with the \s-1POP3\s0 protocol described in \s-1RFC1939\s0..PPA new Net::POP3 object must be created with the \fInew\fR method. Oncethis has been done, all \s-1POP3\s0 commands are accessed via method callson the object..SH "CONSTRUCTOR".IX Header "CONSTRUCTOR".IP "new ( [ \s-1HOST\s0 ] [, \s-1OPTIONS\s0 ] 0" 4.IX Item "new ( [ HOST ] [, OPTIONS ] 0"This is the constructor for a new Net::POP3 object. \f(CW\*(C`HOST\*(C'\fR is thename of the remote host to which an \s-1POP3\s0 connection is required..Sp\&\f(CW\*(C`HOST\*(C'\fR is optional. If \f(CW\*(C`HOST\*(C'\fR is not given then it may instead bepassed as the \f(CW\*(C`Host\*(C'\fR option described below. If neither is given thenthe \f(CW\*(C`POP3_Hosts\*(C'\fR specified in \f(CW\*(C`Net::Config\*(C'\fR will be used..Sp\&\f(CW\*(C`OPTIONS\*(C'\fR are passed in a hash like fashion, using key and value pairs.Possible options are:.Sp\&\fBHost\fR \- \s-1POP3\s0 host to connect to. It may be a single scalar, as defined forthe \f(CW\*(C`PeerAddr\*(C'\fR option in IO::Socket::INET, or a reference toan array with hosts to try in turn. The \*(L"host\*(R" method will return the valuewhich was used to connect to the host..Sp\&\fBResvPort\fR \- If given then the socket for the \f(CW\*(C`Net::POP3\*(C'\fR objectwill be bound to the local port given using \f(CW\*(C`bind\*(C'\fR when the socket iscreated..Sp\&\fBTimeout\fR \- Maximum time, in seconds, to wait for a response from the\&\s-1POP3\s0 server (default: 120).Sp\&\fBDebug\fR \- Enable debugging information.SH "METHODS".IX Header "METHODS"Unless otherwise stated all methods return either a \fItrue\fR or \fIfalse\fRvalue, with \fItrue\fR meaning that the operation was a success. When a methodstates that it returns a value, failure will be returned as \fIundef\fR or anempty list..IP "auth ( \s-1USERNAME\s0, \s-1PASSWORD\s0 )" 4.IX Item "auth ( USERNAME, PASSWORD )"Attempt \s-1SASL\s0 authentication..IP "user ( \s-1USER\s0 )" 4.IX Item "user ( USER )"Send the \s-1USER\s0 command..IP "pass ( \s-1PASS\s0 )" 4.IX Item "pass ( PASS )"Send the \s-1PASS\s0 command. Returns the number of messages in the mailbox..IP "login ( [ \s-1USER\s0 [, \s-1PASS\s0 ]] )" 4.IX Item "login ( [ USER [, PASS ]] )"Send both the \s-1USER\s0 and \s-1PASS\s0 commands. If \f(CW\*(C`PASS\*(C'\fR is not given the\&\f(CW\*(C`Net::POP3\*(C'\fR uses \f(CW\*(C`Net::Netrc\*(C'\fR to lookup the password using the hostand username. If the username is not specified then the current user namewill be used..SpReturns the number of messages in the mailbox. However if there are nomessages on the server the string \f(CW"0E0"\fR will be returned. This iswill give a true value in a boolean context, but zero in a numeric context..SpIf there was an error authenticating the user then \fIundef\fR will be returned..IP "apop ( [ \s-1USER\s0 [, \s-1PASS\s0 ]] )" 4.IX Item "apop ( [ USER [, PASS ]] )"Authenticate with the server identifying as \f(CW\*(C`USER\*(C'\fR with password \f(CW\*(C`PASS\*(C'\fR.Similar to \*(L"login\*(R", but the password is not sent in clear text..SpTo use this method you must have the Digest::MD5 or the \s-1MD5\s0 module installed,otherwise this method will return \fIundef\fR..IP "banner ()" 4.IX Item "banner ()"Return the sever's connection banner.IP "capa ()" 4.IX Item "capa ()"Return a reference to a hash of the capabilities of the server. \s-1APOP\s0is added as a pseudo capability. Note that I've been unable tofind a list of the standard capability values, and some appear tobe multi-word and some are not. We make an attempt at intelligentlyparsing them, but it may not be correct..IP "capabilities ()" 4.IX Item "capabilities ()"Just like capa, but only uses a cache from the last time we askedthe server, so as to avoid asking more than once..IP "top ( \s-1MSGNUM\s0 [, \s-1NUMLINES\s0 ] )" 4.IX Item "top ( MSGNUM [, NUMLINES ] )"Get the header and the first \f(CW\*(C`NUMLINES\*(C'\fR of the body for the message\&\f(CW\*(C`MSGNUM\*(C'\fR. Returns a reference to an array which contains the lines of textread from the server..IP "list ( [ \s-1MSGNUM\s0 ] )" 4.IX Item "list ( [ MSGNUM ] )"If called with an argument the \f(CW\*(C`list\*(C'\fR returns the size of the messagein octets..SpIf called without arguments a reference to a hash is returned. Thekeys will be the \f(CW\*(C`MSGNUM\*(C'\fR's of all undeleted messages and the values willbe their size in octets..IP "get ( \s-1MSGNUM\s0 [, \s-1FH\s0 ] )" 4.IX Item "get ( MSGNUM [, FH ] )"Get the message \f(CW\*(C`MSGNUM\*(C'\fR from the remote mailbox. If \f(CW\*(C`FH\*(C'\fR is not giventhen get returns a reference to an array which contains the lines oftext read from the server. If \f(CW\*(C`FH\*(C'\fR is given then the lines returnedfrom the server are printed to the filehandle \f(CW\*(C`FH\*(C'\fR..IP "getfh ( \s-1MSGNUM\s0 )" 4.IX Item "getfh ( MSGNUM )"As per \fIget()\fR, but returns a tied filehandle. Reading from thisfilehandle returns the requested message. The filehandle will return\&\s-1EOF\s0 at the end of the message and should not be reused..IP "last ()" 4.IX Item "last ()"Returns the highest \f(CW\*(C`MSGNUM\*(C'\fR of all the messages accessed..IP "popstat ()" 4.IX Item "popstat ()"Returns a list of two elements. These are the number of undeletedelements and the size of the mbox in octets..IP "ping ( \s-1USER\s0 )" 4.IX Item "ping ( USER )"Returns a list of two elements. These are the number of new messagesand the total number of messages for \f(CW\*(C`USER\*(C'\fR..IP "uidl ( [ \s-1MSGNUM\s0 ] )" 4.IX Item "uidl ( [ MSGNUM ] )"Returns a unique identifier for \f(CW\*(C`MSGNUM\*(C'\fR if given. If \f(CW\*(C`MSGNUM\*(C'\fR is notgiven \f(CW\*(C`uidl\*(C'\fR returns a reference to a hash where the keys are themessage numbers and the values are the unique identifiers..IP "delete ( \s-1MSGNUM\s0 )" 4.IX Item "delete ( MSGNUM )"Mark message \f(CW\*(C`MSGNUM\*(C'\fR to be deleted from the remote mailbox. All messagesthat are marked to be deleted will be removed from the remote mailboxwhen the server connection closed..IP "reset ()" 4.IX Item "reset ()"Reset the status of the remote \s-1POP3\s0 server. This includes resetting thestatus of all messages to not be deleted..IP "quit ()" 4.IX Item "quit ()"Quit and close the connection to the remote \s-1POP3\s0 server. Any messages markedas deleted will be deleted from the remote mailbox..SH "NOTES".IX Header "NOTES"If a \f(CW\*(C`Net::POP3\*(C'\fR object goes out of scope before \f(CW\*(C`quit\*(C'\fR method is calledthen the \f(CW\*(C`reset\*(C'\fR method will called before the connection is closed. Thismeans that any messages marked to be deleted will not be..SH "SEE ALSO".IX Header "SEE ALSO"Net::Netrc,Net::Cmd.SH "AUTHOR".IX Header "AUTHOR"Graham Barr <gbarr@pobox.com>.SH "COPYRIGHT".IX Header "COPYRIGHT"Copyright (c) 1995\-2003 Graham Barr. All rights reserved.This program is free software; you can redistribute it and/or modifyit under the same terms as Perl itself.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -