source: project/pop3/pop3.html @ 1270

Last change on this file since 1270 was 1270, checked in by felix winkelmann, 14 years ago

all simple eggs have proper setup script, now

File size: 4.3 KB
Line 
1<html>
2<head><title>Eggs Unlimited - pop3</title></head>
3<body>
4
5<center><img src="egg.jpg"></center>
6<center><a href="index.html">back</a></center>
7
8<h2>pop3</h2>
9
10<h3>Description:</h3>
11Retrieve e-mails using the POP3 protocol (RFC1939).
12
13<h3>Author:</h3>
14<a href="mailto:felix@call-with-current-continuation.org">felix</a>
15
16<h3>Version:</h3>
17<ul>
18<li>1.2
19Replaced use of <code>(end-of-file)</code> with <code>#!eof</code>
20<li>1.1
21Fixed bug that caused an unbound variable error if connection failed.
22<li>1.0
23</ul>
24
25<h3>Usage:</h3>
26<pre>
27(require-extension pop3)
28</pre>
29
30<h3>Download:</h3>
31<a href="pop3.egg">pop3.egg</a>
32
33<h3>Documentation:</h3>
34
35Errors triggered by invalid or negative replies from the POP3 server are signalled
36by raising a compound condition of the kinds <code>exn</code> and <code>pop3</code>.
37
38<dl>
39<dt><pre><b>[procedure] (pop3:connect HOSTNAME USERNAME PASSWORD [VERBOSE [PORT]])</b></pre>
40<dd>Connects to the server <code>HOSTNAME</code> using the POP3 protocol and identifies
41this client with <code>USERNAME</code> and <code>PASSWORD</code>. If the optional argument <code>VERBOSE</code> is
42given and not <code>#f</code>, then a protocol of the communication with the server is
43written to the value of <code>(current-error-port)</code>. <code>PORT</code> specifies
44the port-number and defaults to <code>110</code>.
45<bt>This procedure returns an object representing the POP3 session.
46
47<dt><pre><b>[procedure] (pop3:disconnect POP3)</b></pre>
48<dd>Closes the connection identified by the session object <code>POP3</code>.
49
50<dt><pre><b>[procedure] (pop3:pop3? X)</b></pre>
51<dd>Returns <code>#t</code> if <code>X</code> is an POP3 session object, or <code>#f</code>
52otherwise.
53
54<dt><pre><b>[procedure] (pop3:list POP3)</b></pre>
55<dd>Returns the list of all available messages as an a-list, where each element in the
56list is a pair of the form <code>(MESSAGE-ID . SIZE)</code> representing the message-identifier
57and the size of the message in bytes.
58
59<dt><pre><b>[procedure] (pop3:open POP3 INDEX [DELETE])</b></pre>
60<dd>Returns a port for the message with id <code>INDEX</code> and returns an input-port that can
61be used to retrieve the header and the contents of the message.
62If the optional argument <code>DELETE</code> is given and not <code>#f</code>, then the
63message will be deleted on the server, when the port is closed.
64<br>It is not possible to call <code>pop3:open</code> before the port returned by a previously invoked call has been closed.
65</dl>
66
67
68<p><h3>Examples:</h3>
69
70<pre>
71; Download and print all messages:
72
73(define p (pop3:connect "pop3.your-isp.net" "myname" "secret"))
74(for-each
75  (match-lambda
76    [(id . bytes)
77      (print "Retrieving message " id ", " bytes " bytes:")
78      (let ([port (pop3:open p id)])
79        (display (read-string #f port))
80        (close-input-port port) ) ] )
81  (pop3:list p) )
82(smtp:disconnect s)
83</pre>
84
85<h3>License:</h3>
86<pre>
87Copyright (c) 2003, Felix L. Winkelmann
88All rights reserved.
89
90Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following
91conditions are met:
92
93  Redistributions of source code must retain the above copyright notice, this list of conditions and the following
94    disclaimer.
95  Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following
96    disclaimer in the documentation and/or other materials provided with the distribution.
97  Neither the name of the author nor the names of its contributors may be used to endorse or promote
98    products derived from this software without specific prior written permission.
99
100THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
101OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
102AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR
103CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
104CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
105SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
106THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
107OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
108POSSIBILITY OF SUCH DAMAGE.
109</pre>
110
111
112<hr><a href="index.html">back</a>
113
114</body>
115</html>
Note: See TracBrowser for help on using the repository browser.