diff --git a/doc/dns.html b/doc/dns.html index fa4c230..67b24ca 100644 --- a/doc/dns.html +++ b/doc/dns.html @@ -118,7 +118,7 @@ message.

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

diff --git a/doc/ftp.html b/doc/ftp.html index 7ad5e4d..14a3601 100644 --- a/doc/ftp.html +++ b/doc/ftp.html @@ -267,7 +267,7 @@ f, e = ftp.put{

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

diff --git a/doc/http.html b/doc/http.html index 9125df7..a98915c 100644 --- a/doc/http.html +++ b/doc/http.html @@ -303,7 +303,7 @@ r, c = http.request {

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

diff --git a/doc/index.html b/doc/index.html index f6d37ac..b96385e 100644 --- a/doc/index.html +++ b/doc/index.html @@ -284,7 +284,7 @@ those that have compatibility issues.

Last modified by Diego Nehab on
-Sun Aug 10 01:36:26 PDT 2003 +Thu Jun 17 02:47:14 EDT 2004

diff --git a/doc/introduction.html b/doc/introduction.html index 63a7d84..8706c83 100644 --- a/doc/introduction.html +++ b/doc/introduction.html @@ -330,7 +330,7 @@ io.write(socket.try((udp:receive())))

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

diff --git a/doc/ltn12.html b/doc/ltn12.html index 9029b9c..23b9ff8 100644 --- a/doc/ltn12.html +++ b/doc/ltn12.html @@ -415,7 +415,7 @@ Creates and returns a source that produces the contents of a

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

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

diff --git a/doc/reference.html b/doc/reference.html index 9ff6004..607958b 100644 --- a/doc/reference.html +++ b/doc/reference.html @@ -107,17 +107,19 @@ normalize, decode, encode, +stuff, wrap.
low-level: b64, -unb64, +dot, eol, qp, -unqp, wrp, qpwrp. +unb64, +unqp,
@@ -218,7 +220,7 @@

Last modified by Diego Nehab on
-Thu Sep 27 16:18:27 EST 2001 +Thu Jun 17 02:47:21 EDT 2004

diff --git a/doc/smtp.html b/doc/smtp.html index 6b348e0..89f4757 100644 --- a/doc/smtp.html +++ b/doc/smtp.html @@ -347,8 +347,9 @@ source = smtp.message{ [1] = { body = mime.eol(0, [[ Lines in a message body should always end with CRLF. - The smtp module will *NOT* perform translation. It will - perform necessary stuffing or '.' characters, though. + The smtp module will *NOT* perform translation. However, the + send function *DOES* perform SMTP stuffing, whereas the message + function does *NOT*. ]]) }, -- second part: headers describe content to be a png image, @@ -397,7 +398,7 @@ r, e = smtp.send{

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

diff --git a/doc/socket.html b/doc/socket.html index cf65704..d7739f8 100644 --- a/doc/socket.html +++ b/doc/socket.html @@ -251,7 +251,7 @@ This constant has a string describing the current LuaSocket version.

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

diff --git a/doc/tcp.html b/doc/tcp.html index 7a49660..781ec6f 100644 --- a/doc/tcp.html +++ b/doc/tcp.html @@ -462,7 +462,7 @@ This function returns 1.

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

diff --git a/doc/udp.html b/doc/udp.html index 5ae0a89..6f2e607 100644 --- a/doc/udp.html +++ b/doc/udp.html @@ -395,7 +395,7 @@ imperative nature obvious.

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

diff --git a/doc/url.html b/doc/url.html index 1dbee52..46e6e09 100644 --- a/doc/url.html +++ b/doc/url.html @@ -315,7 +315,7 @@ The function returns the decoded string.

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

diff --git a/test/testmesg.lua b/test/testmesg.lua index 3e4c28f..d43c189 100644 --- a/test/testmesg.lua +++ b/test/testmesg.lua @@ -23,7 +23,7 @@ source = smtp.message{ Lines in a message body should always end with CRLF. The smtp module will *NOT* perform translation. It will perform necessary stuffing, though. - ]]) + ]]) }, -- second part: Headers describe content the to be an image, -- sent under the base64 transfer content encoding.