From eac26d2c8dafab604ef2e97e504326cfaf1033cf Mon Sep 17 00:00:00 2001 From: Diego Nehab Date: Thu, 17 Jun 2004 07:00:43 +0000 Subject: Updated manual timestamps and the added stuffing filters to mime.html. --- doc/mime.html | 63 ++++++++++++++++++++++++++++++++++++++--------------------- 1 file changed, 41 insertions(+), 22 deletions(-) (limited to 'doc/mime.html') 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( ) + + +

+mime.stuff()
+

+ +

+Creates and returns a filter that performs stuffing of SMTP messages. +

+ +

+Note: The smtp.send function +uses this filter automatically. You don't need to chain it with your +source, or apply it to your message body. +

+

@@ -232,33 +248,36 @@ print((mime.b64("diego:password")))

-A, B = mime.dot(C [, D]) +A, n = mime.dot(m [, B])

-Low-level filter to perform Base64 encoding. +Low-level filter to perform SMTP stuffing and enable transmission of +messages containing the sequence "CRLF.CRLF".

-

-A is the encoded version of the largest prefix of -C..D -that can be encoded unambiguously. B has the remaining bytes of -C..D, before encoding. -If D is nil, A is padded with -the encoding of the remaining bytes of C. +

+A is the stuffed version of B. 'n' gives the +number of characters from the sequence CRLF seen in the end of B. +'m' should tell the same, but for the previous chunk.

-

-Note: The simplest use of this function is to encode a string into it's -Base64 transfer content encoding. Notice the extra parenthesis around the -call to mime.b64, to discard the second return value. +

Note: The message body is defined to begin with +an implicit CRLF. Therefore, to stuff a message correctly, the +first m should have the value 2.

-print((mime.b64("diego:password")))
---> ZGllZ286cGFzc3dvcmQ=
+print((string.gsub(mime.dot(2, ".\r\nStuffing the message.\r\n.\r\n."), "\r\n", "\\n")))
+--> ..\nStuffing the message.\n..\n..
 
+

+Note: The smtp.send function +uses this filter automatically. You don't need to +apply it again. +

+

@@ -273,7 +292,7 @@ context the function receives besides the chunk. An updated version of the context is returned after each new chunk.

-

+

A is the translated version of D. C is the ASCII value of the last character of the previous chunk, if it was a candidate for line break, or 0 otherwise. @@ -296,7 +315,7 @@ A, B = mime.qp(C [, D, marker]) Low-level filter to perform Quoted-Printable encoding.

-

+

A is the encoded version of the largest prefix of C..D that can be encoded unambiguously. B has the remaining bytes of @@ -328,7 +347,7 @@ A, m = mime.qpwrp(n [, B, length]) Low-level filter to break Quoted-Printable text into lines.

-

+

A is a copy of B, broken into lines of at most length bytes (defaults to 76). 'n' should tell how many bytes are left for the first @@ -352,7 +371,7 @@ A, B = mime.unb64(C [, D]) Low-level filter to perform Base64 decoding.

-

+

A is the decoded version of the largest prefix of C..D that can be decoded unambiguously. B has the remaining bytes of @@ -383,7 +402,7 @@ Low-level filter to remove the Quoted-Printable transfer content encoding from data.

-

+

A is the decoded version of the largest prefix of C..D that can be decoded unambiguously. B has the remaining bytes of @@ -414,7 +433,7 @@ Low-level filter to break text into lines with CRLF marker. Text is assumed to be in the normalize form.

-

+

A is a copy of B, broken into lines of at most length bytes (defaults to 76). 'n' should tell how many bytes are left for the first @@ -443,7 +462,7 @@ marker.

Last modified by Diego Nehab on
-Sat Aug 9 01:00:41 PDT 2003 +Thu Jun 17 02:47:21 EDT 2004

-- cgit v1.2.3-55-g6feb