Commit | Line | Data |
---|---|---|
920dae64 AT |
1 | .\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.32 |
2 | .\" | |
3 | .\" Standard preamble: | |
4 | .\" ======================================================================== | |
5 | .de Sh \" Subsection heading | |
6 | .br | |
7 | .if t .Sp | |
8 | .ne 5 | |
9 | .PP | |
10 | \fB\\$1\fR | |
11 | .PP | |
12 | .. | |
13 | .de Sp \" Vertical space (when we can't use .PP) | |
14 | .if t .sp .5v | |
15 | .if n .sp | |
16 | .. | |
17 | .de Vb \" Begin verbatim text | |
18 | .ft CW | |
19 | .nf | |
20 | .ne \\$1 | |
21 | .. | |
22 | .de Ve \" End verbatim text | |
23 | .ft R | |
24 | .fi | |
25 | .. | |
26 | .\" Set up some character translations and predefined strings. \*(-- will | |
27 | .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left | |
28 | .\" double quote, and \*(R" will give a right double quote. | will give a | |
29 | .\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to | |
30 | .\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C' | |
31 | .\" expand to `' in nroff, nothing in troff, for use with C<>. | |
32 | .tr \(*W-|\(bv\*(Tr | |
33 | .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' | |
34 | .ie n \{\ | |
35 | . ds -- \(*W- | |
36 | . ds PI pi | |
37 | . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch | |
38 | . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch | |
39 | . ds L" "" | |
40 | . ds R" "" | |
41 | . ds C` "" | |
42 | . ds C' "" | |
43 | 'br\} | |
44 | .el\{\ | |
45 | . ds -- \|\(em\| | |
46 | . ds PI \(*p | |
47 | . ds L" `` | |
48 | . ds R" '' | |
49 | 'br\} | |
50 | .\" | |
51 | .\" If the F register is turned on, we'll generate index entries on stderr for | |
52 | .\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index | |
53 | .\" entries marked with X<> in POD. Of course, you'll have to process the | |
54 | .\" output yourself in some meaningful fashion. | |
55 | .if \nF \{\ | |
56 | . de IX | |
57 | . tm Index:\\$1\t\\n%\t"\\$2" | |
58 | .. | |
59 | . nr % 0 | |
60 | . rr F | |
61 | .\} | |
62 | .\" | |
63 | .\" For nroff, turn off justification. Always turn off hyphenation; it makes | |
64 | .\" way too many mistakes in technical documents. | |
65 | .hy 0 | |
66 | .if n .na | |
67 | .\" | |
68 | .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). | |
69 | .\" Fear. Run. Save yourself. No user-serviceable parts. | |
70 | . \" fudge factors for nroff and troff | |
71 | .if n \{\ | |
72 | . ds #H 0 | |
73 | . ds #V .8m | |
74 | . ds #F .3m | |
75 | . ds #[ \f1 | |
76 | . ds #] \fP | |
77 | .\} | |
78 | .if t \{\ | |
79 | . ds #H ((1u-(\\\\n(.fu%2u))*.13m) | |
80 | . ds #V .6m | |
81 | . ds #F 0 | |
82 | . ds #[ \& | |
83 | . ds #] \& | |
84 | .\} | |
85 | . \" simple accents for nroff and troff | |
86 | .if n \{\ | |
87 | . ds ' \& | |
88 | . ds ` \& | |
89 | . ds ^ \& | |
90 | . ds , \& | |
91 | . ds ~ ~ | |
92 | . ds / | |
93 | .\} | |
94 | .if t \{\ | |
95 | . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" | |
96 | . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' | |
97 | . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' | |
98 | . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' | |
99 | . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' | |
100 | . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' | |
101 | .\} | |
102 | . \" troff and (daisy-wheel) nroff accents | |
103 | .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' | |
104 | .ds 8 \h'\*(#H'\(*b\h'-\*(#H' | |
105 | .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] | |
106 | .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' | |
107 | .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' | |
108 | .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] | |
109 | .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] | |
110 | .ds ae a\h'-(\w'a'u*4/10)'e | |
111 | .ds Ae A\h'-(\w'A'u*4/10)'E | |
112 | . \" corrections for vroff | |
113 | .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' | |
114 | .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' | |
115 | . \" for low resolution devices (crt and lpr) | |
116 | .if \n(.H>23 .if \n(.V>19 \ | |
117 | \{\ | |
118 | . ds : e | |
119 | . ds 8 ss | |
120 | . ds o a | |
121 | . ds d- d\h'-1'\(ga | |
122 | . ds D- D\h'-1'\(hy | |
123 | . ds th \o'bp' | |
124 | . ds Th \o'LP' | |
125 | . ds ae ae | |
126 | . ds Ae AE | |
127 | .\} | |
128 | .rm #[ #] #H #V #F C | |
129 | .\" ======================================================================== | |
130 | .\" | |
131 | .IX Title "Net::POP3 3" | |
132 | .TH Net::POP3 3 "2001-09-21" "perl v5.8.8" "Perl Programmers Reference Guide" | |
133 | .SH "NAME" | |
134 | Net::POP3 \- Post Office Protocol 3 Client class (RFC1939) | |
135 | .SH "SYNOPSIS" | |
136 | .IX Header "SYNOPSIS" | |
137 | .Vb 1 | |
138 | \& use Net::POP3; | |
139 | .Ve | |
140 | .PP | |
141 | .Vb 3 | |
142 | \& # Constructors | |
143 | \& $pop = Net::POP3->new('pop3host'); | |
144 | \& $pop = Net::POP3->new('pop3host', Timeout => 60); | |
145 | .Ve | |
146 | .PP | |
147 | .Vb 8 | |
148 | \& if ($pop->login($username, $password) > 0) { | |
149 | \& my $msgnums = $pop->list; # hashref of msgnum => size | |
150 | \& foreach my $msgnum (keys %$msgnums) { | |
151 | \& my $msg = $pop->get($msgnum); | |
152 | \& print @$msg; | |
153 | \& $pop->delete($msgnum); | |
154 | \& } | |
155 | \& } | |
156 | .Ve | |
157 | .PP | |
158 | .Vb 1 | |
159 | \& $pop->quit; | |
160 | .Ve | |
161 | .SH "DESCRIPTION" | |
162 | .IX Header "DESCRIPTION" | |
163 | This module implements a client interface to the \s-1POP3\s0 protocol, enabling | |
164 | a perl5 application to talk to \s-1POP3\s0 servers. This documentation assumes | |
165 | that you are familiar with the \s-1POP3\s0 protocol described in \s-1RFC1939\s0. | |
166 | .PP | |
167 | A new Net::POP3 object must be created with the \fInew\fR method. Once | |
168 | this has been done, all \s-1POP3\s0 commands are accessed via method calls | |
169 | on the object. | |
170 | .SH "CONSTRUCTOR" | |
171 | .IX Header "CONSTRUCTOR" | |
172 | .IP "new ( [ \s-1HOST\s0 ] [, \s-1OPTIONS\s0 ] 0" 4 | |
173 | .IX Item "new ( [ HOST ] [, OPTIONS ] 0" | |
174 | This is the constructor for a new Net::POP3 object. \f(CW\*(C`HOST\*(C'\fR is the | |
175 | name of the remote host to which an \s-1POP3\s0 connection is required. | |
176 | .Sp | |
177 | \&\f(CW\*(C`HOST\*(C'\fR is optional. If \f(CW\*(C`HOST\*(C'\fR is not given then it may instead be | |
178 | passed as the \f(CW\*(C`Host\*(C'\fR option described below. If neither is given then | |
179 | the \f(CW\*(C`POP3_Hosts\*(C'\fR specified in \f(CW\*(C`Net::Config\*(C'\fR will be used. | |
180 | .Sp | |
181 | \&\f(CW\*(C`OPTIONS\*(C'\fR are passed in a hash like fashion, using key and value pairs. | |
182 | Possible options are: | |
183 | .Sp | |
184 | \&\fBHost\fR \- \s-1POP3\s0 host to connect to. It may be a single scalar, as defined for | |
185 | the \f(CW\*(C`PeerAddr\*(C'\fR option in IO::Socket::INET, or a reference to | |
186 | an array with hosts to try in turn. The \*(L"host\*(R" method will return the value | |
187 | which was used to connect to the host. | |
188 | .Sp | |
189 | \&\fBResvPort\fR \- If given then the socket for the \f(CW\*(C`Net::POP3\*(C'\fR object | |
190 | will be bound to the local port given using \f(CW\*(C`bind\*(C'\fR when the socket is | |
191 | created. | |
192 | .Sp | |
193 | \&\fBTimeout\fR \- Maximum time, in seconds, to wait for a response from the | |
194 | \&\s-1POP3\s0 server (default: 120) | |
195 | .Sp | |
196 | \&\fBDebug\fR \- Enable debugging information | |
197 | .SH "METHODS" | |
198 | .IX Header "METHODS" | |
199 | Unless otherwise stated all methods return either a \fItrue\fR or \fIfalse\fR | |
200 | value, with \fItrue\fR meaning that the operation was a success. When a method | |
201 | states that it returns a value, failure will be returned as \fIundef\fR or an | |
202 | empty list. | |
203 | .IP "auth ( \s-1USERNAME\s0, \s-1PASSWORD\s0 )" 4 | |
204 | .IX Item "auth ( USERNAME, PASSWORD )" | |
205 | Attempt \s-1SASL\s0 authentication. | |
206 | .IP "user ( \s-1USER\s0 )" 4 | |
207 | .IX Item "user ( USER )" | |
208 | Send the \s-1USER\s0 command. | |
209 | .IP "pass ( \s-1PASS\s0 )" 4 | |
210 | .IX Item "pass ( PASS )" | |
211 | Send the \s-1PASS\s0 command. Returns the number of messages in the mailbox. | |
212 | .IP "login ( [ \s-1USER\s0 [, \s-1PASS\s0 ]] )" 4 | |
213 | .IX Item "login ( [ USER [, PASS ]] )" | |
214 | Send both the \s-1USER\s0 and \s-1PASS\s0 commands. If \f(CW\*(C`PASS\*(C'\fR is not given the | |
215 | \&\f(CW\*(C`Net::POP3\*(C'\fR uses \f(CW\*(C`Net::Netrc\*(C'\fR to lookup the password using the host | |
216 | and username. If the username is not specified then the current user name | |
217 | will be used. | |
218 | .Sp | |
219 | Returns the number of messages in the mailbox. However if there are no | |
220 | messages on the server the string \f(CW"0E0"\fR will be returned. This is | |
221 | will give a true value in a boolean context, but zero in a numeric context. | |
222 | .Sp | |
223 | If there was an error authenticating the user then \fIundef\fR will be returned. | |
224 | .IP "apop ( [ \s-1USER\s0 [, \s-1PASS\s0 ]] )" 4 | |
225 | .IX Item "apop ( [ USER [, PASS ]] )" | |
226 | Authenticate with the server identifying as \f(CW\*(C`USER\*(C'\fR with password \f(CW\*(C`PASS\*(C'\fR. | |
227 | Similar to \*(L"login\*(R", but the password is not sent in clear text. | |
228 | .Sp | |
229 | To use this method you must have the Digest::MD5 or the \s-1MD5\s0 module installed, | |
230 | otherwise this method will return \fIundef\fR. | |
231 | .IP "banner ()" 4 | |
232 | .IX Item "banner ()" | |
233 | Return the sever's connection banner | |
234 | .IP "capa ()" 4 | |
235 | .IX Item "capa ()" | |
236 | Return a reference to a hash of the capabilties of the server. \s-1APOP\s0 | |
237 | is added as a pseudo capability. Note that I've been unable to | |
238 | find a list of the standard capability values, and some appear to | |
239 | be multi-word and some are not. We make an attempt at intelligently | |
240 | parsing them, but it may not be correct. | |
241 | .IP "capabilities ()" 4 | |
242 | .IX Item "capabilities ()" | |
243 | Just like capa, but only uses a cache from the last time we asked | |
244 | the server, so as to avoid asking more than once. | |
245 | .IP "top ( \s-1MSGNUM\s0 [, \s-1NUMLINES\s0 ] )" 4 | |
246 | .IX Item "top ( MSGNUM [, NUMLINES ] )" | |
247 | Get the header and the first \f(CW\*(C`NUMLINES\*(C'\fR of the body for the message | |
248 | \&\f(CW\*(C`MSGNUM\*(C'\fR. Returns a reference to an array which contains the lines of text | |
249 | read from the server. | |
250 | .IP "list ( [ \s-1MSGNUM\s0 ] )" 4 | |
251 | .IX Item "list ( [ MSGNUM ] )" | |
252 | If called with an argument the \f(CW\*(C`list\*(C'\fR returns the size of the message | |
253 | in octets. | |
254 | .Sp | |
255 | If called without arguments a reference to a hash is returned. The | |
256 | keys will be the \f(CW\*(C`MSGNUM\*(C'\fR's of all undeleted messages and the values will | |
257 | be their size in octets. | |
258 | .IP "get ( \s-1MSGNUM\s0 [, \s-1FH\s0 ] )" 4 | |
259 | .IX Item "get ( MSGNUM [, FH ] )" | |
260 | Get the message \f(CW\*(C`MSGNUM\*(C'\fR from the remote mailbox. If \f(CW\*(C`FH\*(C'\fR is not given | |
261 | then get returns a reference to an array which contains the lines of | |
262 | text read from the server. If \f(CW\*(C`FH\*(C'\fR is given then the lines returned | |
263 | from the server are printed to the filehandle \f(CW\*(C`FH\*(C'\fR. | |
264 | .IP "getfh ( \s-1MSGNUM\s0 )" 4 | |
265 | .IX Item "getfh ( MSGNUM )" | |
266 | As per \fIget()\fR, but returns a tied filehandle. Reading from this | |
267 | filehandle returns the requested message. The filehandle will return | |
268 | \&\s-1EOF\s0 at the end of the message and should not be reused. | |
269 | .IP "last ()" 4 | |
270 | .IX Item "last ()" | |
271 | Returns the highest \f(CW\*(C`MSGNUM\*(C'\fR of all the messages accessed. | |
272 | .IP "popstat ()" 4 | |
273 | .IX Item "popstat ()" | |
274 | Returns a list of two elements. These are the number of undeleted | |
275 | elements and the size of the mbox in octets. | |
276 | .IP "ping ( \s-1USER\s0 )" 4 | |
277 | .IX Item "ping ( USER )" | |
278 | Returns a list of two elements. These are the number of new messages | |
279 | and the total number of messages for \f(CW\*(C`USER\*(C'\fR. | |
280 | .IP "uidl ( [ \s-1MSGNUM\s0 ] )" 4 | |
281 | .IX Item "uidl ( [ MSGNUM ] )" | |
282 | Returns a unique identifier for \f(CW\*(C`MSGNUM\*(C'\fR if given. If \f(CW\*(C`MSGNUM\*(C'\fR is not | |
283 | given \f(CW\*(C`uidl\*(C'\fR returns a reference to a hash where the keys are the | |
284 | message numbers and the values are the unique identifiers. | |
285 | .IP "delete ( \s-1MSGNUM\s0 )" 4 | |
286 | .IX Item "delete ( MSGNUM )" | |
287 | Mark message \f(CW\*(C`MSGNUM\*(C'\fR to be deleted from the remote mailbox. All messages | |
288 | that are marked to be deleted will be removed from the remote mailbox | |
289 | when the server connection closed. | |
290 | .IP "reset ()" 4 | |
291 | .IX Item "reset ()" | |
292 | Reset the status of the remote \s-1POP3\s0 server. This includes reseting the | |
293 | status of all messages to not be deleted. | |
294 | .IP "quit ()" 4 | |
295 | .IX Item "quit ()" | |
296 | Quit and close the connection to the remote \s-1POP3\s0 server. Any messages marked | |
297 | as deleted will be deleted from the remote mailbox. | |
298 | .SH "NOTES" | |
299 | .IX Header "NOTES" | |
300 | If a \f(CW\*(C`Net::POP3\*(C'\fR object goes out of scope before \f(CW\*(C`quit\*(C'\fR method is called | |
301 | then the \f(CW\*(C`reset\*(C'\fR method will called before the connection is closed. This | |
302 | means that any messages marked to be deleted will not be. | |
303 | .SH "SEE ALSO" | |
304 | .IX Header "SEE ALSO" | |
305 | Net::Netrc, | |
306 | Net::Cmd | |
307 | .SH "AUTHOR" | |
308 | .IX Header "AUTHOR" | |
309 | Graham Barr <gbarr@pobox.com> | |
310 | .SH "COPYRIGHT" | |
311 | .IX Header "COPYRIGHT" | |
312 | Copyright (c) 1995\-2003 Graham Barr. All rights reserved. | |
313 | This program is free software; you can redistribute it and/or modify | |
314 | it under the same terms as Perl itself. |