diff options
author | Diego Nehab <diego@tecgraf.puc-rio.br> | 2004-06-17 07:00:43 +0000 |
---|---|---|
committer | Diego Nehab <diego@tecgraf.puc-rio.br> | 2004-06-17 07:00:43 +0000 |
commit | eac26d2c8dafab604ef2e97e504326cfaf1033cf (patch) | |
tree | a0b53ee062a46c471014b07185229daff2e0162e /doc/mime.html | |
parent | 613534c79526e313d6bfd5ffa514797b364dc185 (diff) | |
download | luasocket-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.html | 63 |
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"> | ||
162 | mime.<b>stuff()</b><br> | ||
163 | </p> | ||
164 | |||
165 | <p class=description> | ||
166 | Creates and returns a filter that performs stuffing of SMTP messages. | ||
167 | </p> | ||
168 | |||
169 | <p class=note> | ||
170 | Note: The <a href=smtp.html#send><tt>smtp.send</tt></a> function | ||
171 | uses this filter automatically. You don't need to chain it with your | ||
172 | source, 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"> |
235 | A, B = mime.<b>dot(</b>C [, D]<b>)</b> | 251 | A, n = mime.<b>dot(</b>m [, B]<b>)</b> |
236 | </p> | 252 | </p> |
237 | 253 | ||
238 | <p class=description> | 254 | <p class=description> |
239 | Low-level filter to perform Base64 encoding. | 255 | Low-level filter to perform SMTP stuffing and enable transmission of |
256 | messages 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> | 261 | number of characters from the sequence CRLF seen in the end of <tt>B</tt>. |
245 | that 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. | ||
247 | If <tt>D</tt> is <tt><b>nil</b></tt>, <tt>A</tt> is padded with | ||
248 | the 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 |
252 | Note: The simplest use of this function is to encode a string into it's | 266 | an implicit CRLF. Therefore, to stuff a message correctly, the |
253 | Base64 transfer content encoding. Notice the extra parenthesis around the | 267 | first <tt>m</tt> should have the value 2. |
254 | call 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> |
258 | print((mime.b64("diego:password"))) | 271 | print((string.gsub(mime.dot(2, ".\r\nStuffing the message.\r\n.\r\n."), "\r\n", "\\n"))) |
259 | --> ZGllZ286cGFzc3dvcmQ= | 272 | --> ..\nStuffing the message.\n..\n.. |
260 | </pre> | 273 | </pre> |
261 | 274 | ||
275 | <p class=note> | ||
276 | Note: The <a href=smtp.html#send><tt>smtp.send</tt></a> function | ||
277 | uses this filter automatically. You don't need to | ||
278 | apply 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 | |||
273 | the context is returned after each new chunk. | 292 | the 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 |
278 | ASCII value of the last character of the previous chunk, if it was a | 297 | ASCII value of the last character of the previous chunk, if it was a |
279 | candidate for line break, or 0 otherwise. | 298 | candidate for line break, or 0 otherwise. |
@@ -296,7 +315,7 @@ A, B = mime.<b>qp(</b>C [, D, marker]<b>)</b> | |||
296 | Low-level filter to perform Quoted-Printable encoding. | 315 | Low-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> |
302 | that can be encoded unambiguously. <tt>B</tt> has the remaining bytes of | 321 | that 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> | |||
328 | Low-level filter to break Quoted-Printable text into lines. | 347 | Low-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> | |||
352 | Low-level filter to perform Base64 decoding. | 371 | Low-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> |
358 | that can be decoded unambiguously. <tt>B</tt> has the remaining bytes of | 377 | that 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 | |||
383 | from data. | 402 | from 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> |
389 | that can be decoded unambiguously. <tt>B</tt> has the remaining bytes of | 408 | that 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. | |||
414 | Text is assumed to be in the <a href=#normalize><tt>normalize</tt></a> form. | 433 | Text 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> |
445 | Last modified by Diego Nehab on <br> | 464 | Last modified by Diego Nehab on <br> |
446 | Sat Aug 9 01:00:41 PDT 2003 | 465 | Thu Jun 17 02:47:21 EDT 2004 |
447 | </small> | 466 | </small> |
448 | </p> | 467 | </p> |
449 | </center> | 468 | </center> |