Initial commit of newLISP.
[newlisp.git] / modules / pop3.lsp.html
blob16be1ec582ec141ee2462018217b7ffd91a26e21
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2 <html>
3 <head>
4 <META http-equiv="Content-Type" content="text/html; charset=utf-8">
5 <title>pop3.lsp</title>
7 <style type="text/css" media="screen">
8 <!--
9 span.arw {
10 color:#666666;
11 font-size: 100%;
14 body, p {
15 font-family: Georgia, Times New Roman, Times, serif;
16 line-height: 115%;
19 h1, h2, h3, h4 {
20 font-family: Georgia, Times New Roman, Times, serif;
21 font-size: 110%;
24 pre {
25 font-family: Andale Mono, "Bitstream Vera Sans Mono", Monaco, "Courier New";
26 font-size: 100%;
29 tt {
30 font-family: Andale Mono, "Bitstream Vera Sans Mono", Monaco, "Courier New";
31 font-size: 100%;
33 -->
34 </style>
35 </head>
37 <body style="margin: 20px;" text="#333333" bgcolor="#FFFFFF"
38 link="#376590" vlink="#551A8B" alink="#ffAA28">
39 <blockquote>
40 <center><h1>pop3.lsp</h1></center>
41 <p><a href="index.html">Module index</a></p><br/><br/><br/><h2>Module:&nbsp;pop3.lsp</h2><p>POP3 mail retrieval routines</p>
42 <b>Version: </b>1.9 - comments redone for automatic documentation<br/>
43 <b>Author: </b>Lutz Mueller et al., 2001, 2002<br/>
44 <p></p>
45 <h2>POP3 mail retrieval routines</h2>
46 <p></p>
47 Only the module <tt>pop3.lsp</tt> is required, not other libraries need to be
48 present. Not all mailservers support all functions.
49 <p></p>
50 To use the module put a <tt>load</tt> statement at the top of your file:
51 <pre>
52 (load "/usr/share/newlisp/modules/pop3.lsp")
53 </pre>
54 <p></p>
55 <h2>Function overview</h2>
56 Load down all messages and put them in a directory <tt>messages/</tt>:
57 <pre>
58 (POP3:get-all-mail "user" "password" "pop.my-isp.com" "messages/")
59 </pre>
60 <p></p>
61 Load down only new messages:
62 <pre>
63 (POP3:get-new-mail "user" "password" "pop.my-isp.com" "messages/")
64 </pre>
65 <p></p>
66 Delete messages, which have not been read:
67 <pre>
68 (POP3:delete-old-mail "user" "password" "pop.my-isp.com")
69 </pre>
70 <p></p>
71 Delete all messages:
72 <pre>
73 (POP3:delete-all-mail "user" "password" "pop.my-isp.com")
74 </pre>
75 <p></p>
76 Get a list of status numbers <tt>(<em>totalMessages</em>, <em>totalBytes</em>, <em>lastRead</em>)</tt>:
77 <pre>
78 (POP3:get-mail-status "user" "password" "pop.my-isp.com")
79 </pre>
80 <p></p>
81 Get error message for failed all/new/status function:
82 <pre>
83 (POP3:get-error-text)
84 </pre>
85 All functions return <tt>nil</tt> on error and <tt>POP3:get-error-text</tt> can be used to
86 retrieve the error text.
87 <p></p>
88 The variable <tt>POP3:debug-flag</tt> can be set to <tt>true</tt> to display all of the
89 dialog with the pop2 mail server.
93 <p></p><center>- &sect; -</center><p></p>
94 <a name="POP3_get-all-mail"></a><h3><font color=#CC0000>POP3:get-all-mail</font></h3>
95 <b>syntax: (<font color=#CC0000>POP3:get-all-mail</font> <em>str-user</em> <em>str-password</em> <em>str-server</em> <em>str-dir</em>)</b><br/>
96 <b>parameter: </b><em>str-user</em> - The user ID.<br/>
97 <b>parameter: </b><em>str-password</em> - The password for the user ID.<br/>
98 <b>parameter: </b><em>str-dir</em> - The local directory for the retrieved mail.<br/>
99 <p><b>return: </b>On success <tt>true</tt> else <tt>nil</tt>.</p>
102 <p></p><center>- &sect; -</center><p></p>
103 <a name="POP3_get-new-mail"></a><h3><font color=#CC0000>POP3:get-new-mail</font></h3>
104 <b>syntax: (<font color=#CC0000>POP3:get-new-mail</font> <em>str-user</em> <em>str-password</em> <em>str-server</em> <em>str-dir</em>)</b><br/>
105 <b>parameter: </b><em>str-user</em> - The user ID.<br/>
106 <b>parameter: </b><em>str-password</em> - The password for the user ID.<br/>
107 <b>parameter: </b><em>str-dir</em> - The local directory for the retrieved mail.<br/>
108 <p><b>return: </b>On success returns <tt>true</tt> else <tt>nil</tt>.</p>
109 On failure use <tt>POP3:get-error-text</tt> to retrieve the text of
110 the last error which occured.
113 <p></p><center>- &sect; -</center><p></p>
114 <a name="POP3_get-mail-status"></a><h3><font color=#CC0000>POP3:get-mail-status</font></h3>
115 <b>syntax: (<font color=#CC0000>POP3:get-mail-status</font> <em>str-user</em> <em>str-password</em> <em>str-server</em>)</b><br/>
116 <b>parameter: </b><em>str-user</em> - The user ID.<br/>
117 <b>parameter: </b><em>str-password</em> - The password for the user ID.<br/>
118 <p><b>return: </b>A list of status information.</p>
119 The list of status information returned contains the following items:
120 (<em>totalMessages</em>, <em>totalBytes</em>, <em>lastRead</em>)
123 <p></p><center>- &sect; -</center><p></p>
124 <a name="POP3_delete-old-mail"></a><h3><font color=#CC0000>POP3:delete-old-mail</font></h3>
125 <b>syntax: (<font color=#CC0000>POP3:delete-old-mail</font> <em>str-user</em> <em>str-password</em> <em>str-server</em>)</b><br/>
126 <b>parameter: </b><em>str-user</em> - The user ID.<br/>
127 <b>parameter: </b><em>str-password</em> - The password for the user ID.<br/>
128 <p><b>return: </b>The number of messages left on the server.</p>
131 <p></p><center>- &sect; -</center><p></p>
132 <a name="POP3_delete-all-mail"></a><h3><font color=#CC0000>POP3:delete-all-mail</font></h3>
133 <b>syntax: (<font color=#CC0000>POP3:delete-all-mail</font> <em>str-user</em> <em>str-password</em> <em>str-server</em>)</b><br/>
134 <b>parameter: </b><em>str-user</em> - The user ID.<br/>
135 <b>parameter: </b><em>str-password</em> - The password for the user ID.<br/>
136 <p><b>return: </b>The number of the message last read.</p>
154 <p></p><center>- &sect; -</center><p></p>
155 <a name="POP3_get-error-text"></a><h3><font color=#CC0000>POP3:get-error-text</font></h3>
156 <b>syntax: (<font color=#CC0000>POP3:get-error-text</font>)</b><br/>
157 <p><b>return: </b>The text of the last error occurred.</p>
165 <p></p><center>- &part; -</center><br/>
166 <center><font face='Arial' size='-2' color='#444444'>
167 generated with <a href="http://newlisp.org">newLISP</a>&nbsp;
168 and <a href="http://newlisp.org/newLISPdoc.html">newLISPdoc</a>
169 </font></center>
170 </blockquote>
171 </body>
172 </html>