1 <!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.01 Transitional//EN">
4 <META http-equiv=
"Content-Type" content=
"text/html; charset=utf-8">
5 <title>pop3.lsp
</title>
7 <style type=
"text/css" media=
"screen">
15 font-family: Georgia, Times New Roman, Times, serif;
20 font-family: Georgia, Times New Roman, Times, serif;
25 font-family: Andale Mono, "Bitstream Vera Sans Mono", Monaco, "Courier New";
30 font-family: Andale Mono, "Bitstream Vera Sans Mono", Monaco, "Courier New";
37 <body style=
"margin: 20px;" text=
"#333333" bgcolor=
"#FFFFFF"
38 link=
"#376590" vlink=
"#551A8B" alink=
"#ffAA28">
40 <center><h1>pop3.lsp
</h1></center>
41 <p><a href=
"index.html">Module index
</a></p><br/><br/><br/><h2>Module:
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/>
45 <h2>POP3 mail retrieval routines
</h2>
47 Only the module
<tt>pop3.lsp
</tt> is required, not other libraries need to be
48 present. Not all mailservers support all functions.
50 To use the module put a
<tt>load
</tt> statement at the top of your file:
52 (load
"/usr/share/newlisp/modules/pop3.lsp")
55 <h2>Function overview
</h2>
56 Load down all messages and put them in a directory
<tt>messages/
</tt>:
58 (POP3:get-all-mail
"user" "password" "pop.my-isp.com" "messages/")
61 Load down only new messages:
63 (POP3:get-new-mail
"user" "password" "pop.my-isp.com" "messages/")
66 Delete messages, which have not been read:
68 (POP3:delete-old-mail
"user" "password" "pop.my-isp.com")
73 (POP3:delete-all-mail
"user" "password" "pop.my-isp.com")
76 Get a list of status numbers
<tt>(
<em>totalMessages
</em>,
<em>totalBytes
</em>,
<em>lastRead
</em>)
</tt>:
78 (POP3:get-mail-status
"user" "password" "pop.my-isp.com")
81 Get error message for failed all/new/status function:
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.
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>-
§ -
</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>-
§ -
</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>-
§ -
</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>-
§ -
</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>-
§ -
</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>-
§ -
</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>-
∂ -
</center><br/>
166 <center><font face='Arial' size='-
2' color='#
444444'
>
167 generated with
<a href=
"http://newlisp.org">newLISP
</a>
168 and
<a href=
"http://newlisp.org/newLISPdoc.html">newLISPdoc
</a>