aboutsummaryrefslogtreecommitdiff
path: root/doc/mime.html
diff options
context:
space:
mode:
authorDiego Nehab <diego@tecgraf.puc-rio.br>2004-06-17 07:00:43 +0000
committerDiego Nehab <diego@tecgraf.puc-rio.br>2004-06-17 07:00:43 +0000
commiteac26d2c8dafab604ef2e97e504326cfaf1033cf (patch)
treea0b53ee062a46c471014b07185229daff2e0162e /doc/mime.html
parent613534c79526e313d6bfd5ffa514797b364dc185 (diff)
downloadluasocket-eac26d2c8dafab604ef2e97e504326cfaf1033cf.tar.gz
luasocket-eac26d2c8dafab604ef2e97e504326cfaf1033cf.tar.bz2
luasocket-eac26d2c8dafab604ef2e97e504326cfaf1033cf.zip
Updated manual timestamps and the added stuffing filters to mime.html.
Diffstat (limited to 'doc/mime.html')
-rw-r--r--doc/mime.html63
1 files changed, 41 insertions, 22 deletions
diff --git a/doc/mime.html b/doc/mime.html
index fe15df3..520c8ff 100644
--- a/doc/mime.html
+++ b/doc/mime.html
@@ -156,6 +156,22 @@ base64 = ltn12.filter.chain(
156) 156)
157</pre> 157</pre>
158 158
159<!-- stuff +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
160
161<p class=name id="stuff">
162mime.<b>stuff()</b><br>
163</p>
164
165<p class=description>
166Creates and returns a filter that performs stuffing of SMTP messages.
167</p>
168
169<p class=note>
170Note: The <a href=smtp.html#send><tt>smtp.send</tt></a> function
171uses this filter automatically. You don't need to chain it with your
172source, or apply it to your message body.
173</p>
174
159<!-- wrap +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> 175<!-- wrap +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
160 176
161<p class=name id="wrap"> 177<p class=name id="wrap">
@@ -232,33 +248,36 @@ print((mime.b64("diego:password")))
232 248
233<!-- dot +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> 249<!-- dot +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
234<p class=name id="dot"> 250<p class=name id="dot">
235A, B = mime.<b>dot(</b>C [, D]<b>)</b> 251A, n = mime.<b>dot(</b>m [, B]<b>)</b>
236</p> 252</p>
237 253
238<p class=description> 254<p class=description>
239Low-level filter to perform Base64 encoding. 255Low-level filter to perform SMTP stuffing and enable transmission of
256messages containing the sequence "CRLF.CRLF".
240</p> 257</p>
241 258
242<p class=description> 259<p class=parameters>
243<tt>A</tt> is the encoded version of the largest prefix of 260<tt>A</tt> is the stuffed version of <tt>B</tt>. '<tt>n</tt>' gives the
244<tt>C..D</tt> 261number of characters from the sequence CRLF seen in the end of <tt>B</tt>.
245that can be encoded unambiguously. <tt>B</tt> has the remaining bytes of 262'<tt>m</tt>' should tell the same, but for the previous chunk.
246<tt>C..D</tt>, <em>before</em> encoding.
247If <tt>D</tt> is <tt><b>nil</b></tt>, <tt>A</tt> is padded with
248the encoding of the remaining bytes of <tt>C</tt>.
249</p> 263</p>
250 264
251<p class=note> 265<p class=note>Note: The message body is defined to begin with
252Note: The simplest use of this function is to encode a string into it's 266an implicit CRLF. Therefore, to stuff a message correctly, the
253Base64 transfer content encoding. Notice the extra parenthesis around the 267first <tt>m</tt> should have the value 2.
254call to <tt>mime.b64</tt>, to discard the second return value.
255</p> 268</p>
256 269
257<pre class=example> 270<pre class=example>
258print((mime.b64("diego:password"))) 271print((string.gsub(mime.dot(2, ".\r\nStuffing the message.\r\n.\r\n."), "\r\n", "\\n")))
259--&gt; ZGllZ286cGFzc3dvcmQ= 272--&gt; ..\nStuffing the message.\n..\n..
260</pre> 273</pre>
261 274
275<p class=note>
276Note: The <a href=smtp.html#send><tt>smtp.send</tt></a> function
277uses this filter automatically. You don't need to
278apply it again.
279</p>
280
262<!-- eol ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> 281<!-- eol ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
263 282
264<p class=name id="eol"> 283<p class=name id="eol">
@@ -273,7 +292,7 @@ context the function receives besides the chunk. An updated version of
273the context is returned after each new chunk. 292the context is returned after each new chunk.
274</p> 293</p>
275 294
276<p class=description> 295<p class=parameters>
277<tt>A</tt> is the translated version of <tt>D</tt>. <tt>C</tt> is the 296<tt>A</tt> is the translated version of <tt>D</tt>. <tt>C</tt> is the
278ASCII value of the last character of the previous chunk, if it was a 297ASCII value of the last character of the previous chunk, if it was a
279candidate for line break, or 0 otherwise. 298candidate for line break, or 0 otherwise.
@@ -296,7 +315,7 @@ A, B = mime.<b>qp(</b>C [, D, marker]<b>)</b>
296Low-level filter to perform Quoted-Printable encoding. 315Low-level filter to perform Quoted-Printable encoding.
297</p> 316</p>
298 317
299<p class=description> 318<p class=parameters>
300<tt>A</tt> is the encoded version of the largest prefix of 319<tt>A</tt> is the encoded version of the largest prefix of
301<tt>C..D</tt> 320<tt>C..D</tt>
302that can be encoded unambiguously. <tt>B</tt> has the remaining bytes of 321that can be encoded unambiguously. <tt>B</tt> has the remaining bytes of
@@ -328,7 +347,7 @@ A, m = mime.<b>qpwrp(</b>n [, B, length]<b>)</b>
328Low-level filter to break Quoted-Printable text into lines. 347Low-level filter to break Quoted-Printable text into lines.
329</p> 348</p>
330 349
331<p class=description> 350<p class=parameters>
332<tt>A</tt> is a copy of <tt>B</tt>, broken into lines of at most 351<tt>A</tt> is a copy of <tt>B</tt>, broken into lines of at most
333<tt>length</tt> bytes (defaults to 76). 352<tt>length</tt> bytes (defaults to 76).
334'<tt>n</tt>' should tell how many bytes are left for the first 353'<tt>n</tt>' should tell how many bytes are left for the first
@@ -352,7 +371,7 @@ A, B = mime.<b>unb64(</b>C [, D]<b>)</b>
352Low-level filter to perform Base64 decoding. 371Low-level filter to perform Base64 decoding.
353</p> 372</p>
354 373
355<p class=description> 374<p class=parameters>
356<tt>A</tt> is the decoded version of the largest prefix of 375<tt>A</tt> is the decoded version of the largest prefix of
357<tt>C..D</tt> 376<tt>C..D</tt>
358that can be decoded unambiguously. <tt>B</tt> has the remaining bytes of 377that can be decoded unambiguously. <tt>B</tt> has the remaining bytes of
@@ -383,7 +402,7 @@ Low-level filter to remove the Quoted-Printable transfer content encoding
383from data. 402from data.
384</p> 403</p>
385 404
386<p class=description> 405<p class=parameters>
387<tt>A</tt> is the decoded version of the largest prefix of 406<tt>A</tt> is the decoded version of the largest prefix of
388<tt>C..D</tt> 407<tt>C..D</tt>
389that can be decoded unambiguously. <tt>B</tt> has the remaining bytes of 408that can be decoded unambiguously. <tt>B</tt> has the remaining bytes of
@@ -414,7 +433,7 @@ Low-level filter to break text into lines with CRLF marker.
414Text is assumed to be in the <a href=#normalize><tt>normalize</tt></a> form. 433Text is assumed to be in the <a href=#normalize><tt>normalize</tt></a> form.
415</p> 434</p>
416 435
417<p class=description> 436<p class=parameters>
418<tt>A</tt> is a copy of <tt>B</tt>, broken into lines of at most 437<tt>A</tt> is a copy of <tt>B</tt>, broken into lines of at most
419<tt>length</tt> bytes (defaults to 76). 438<tt>length</tt> bytes (defaults to 76).
420'<tt>n</tt>' should tell how many bytes are left for the first 439'<tt>n</tt>' should tell how many bytes are left for the first
@@ -443,7 +462,7 @@ marker.
443<p> 462<p>
444<small> 463<small>
445Last modified by Diego Nehab on <br> 464Last modified by Diego Nehab on <br>
446Sat Aug 9 01:00:41 PDT 2003 465Thu Jun 17 02:47:21 EDT 2004
447</small> 466</small>
448</p> 467</p>
449</center> 468</center>