Skip to content

Commit

Permalink
Updated manual timestamps and the added stuffing filters to mime.html.
Browse files Browse the repository at this point in the history
  • Loading branch information
Diego Nehab committed Jun 17, 2004
1 parent 613534c commit eac26d2
Show file tree
Hide file tree
Showing 14 changed files with 61 additions and 39 deletions.
2 changes: 1 addition & 1 deletion doc/dns.html
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ <h2 id=dns>DNS</h2>
<p>
<small>
Last modified by Diego Nehab on <br>
Sat Aug 9 01:00:41 PDT 2003
Thu Jun 17 02:46:57 EDT 2004
</small>
</p>
</center>
Expand Down
2 changes: 1 addition & 1 deletion doc/ftp.html
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ <h2 id=ftp>FTP</h2>
<p>
<small>
Last modified by Diego Nehab on <br>
Sat Aug 9 01:00:41 PDT 2003
Thu Jun 17 02:47:04 EDT 2004
</small>
</p>
</center>
Expand Down
2 changes: 1 addition & 1 deletion doc/http.html
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ <h2 id=http>HTTP</h2>
<p>
<small>
Last modified by Diego Nehab on <br>
Sat Aug 9 01:00:41 PDT 2003
Thu Jun 17 02:47:21 EDT 2004
</small>
</p>
</center>
Expand Down
2 changes: 1 addition & 1 deletion doc/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ <h2 id=old>Old Versions</h2>
<p>
<small>
Last modified by Diego Nehab on <br>
Sun Aug 10 01:36:26 PDT 2003
Thu Jun 17 02:47:14 EDT 2004
</small>
</p>
</center>
Expand Down
2 changes: 1 addition & 1 deletion doc/introduction.html
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ <h3 id=udp>UDP</h3>
<p>
<small>
Last modified by Diego Nehab on <br>
Sat Aug 9 01:00:41 PDT 2003
Thu Jun 17 02:47:21 EDT 2004
</small>
</p>
</center>
Expand Down
2 changes: 1 addition & 1 deletion doc/ltn12.html
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ <h3 id="source">Sources</h3>
<p>
<small>
Last modified by Diego Nehab on <br>
Sat Aug 9 01:00:41 PDT 2003
Thu Jun 17 02:47:21 EDT 2004
</small>
</p>
</center>
Expand Down
63 changes: 41 additions & 22 deletions doc/mime.html
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,22 @@ <h3 id=high>High-level filters</h3>
)
</pre>

<!-- stuff +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->

<p class=name id="stuff">
mime.<b>stuff()</b><br>
</p>

<p class=description>
Creates and returns a filter that performs stuffing of SMTP messages.
</p>

<p class=note>
Note: The <a href=smtp.html#send><tt>smtp.send</tt></a> function
uses this filter automatically. You don't need to chain it with your
source, or apply it to your message body.
</p>

<!-- wrap +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->

<p class=name id="wrap">
Expand Down Expand Up @@ -232,33 +248,36 @@ <h3 id=low>Low-level filters</h3>

<!-- dot +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
<p class=name id="dot">
A, B = mime.<b>dot(</b>C [, D]<b>)</b>
A, n = mime.<b>dot(</b>m [, B]<b>)</b>
</p>

<p class=description>
Low-level filter to perform Base64 encoding.
Low-level filter to perform SMTP stuffing and enable transmission of
messages containing the sequence "CRLF.CRLF".
</p>

<p class=description>
<tt>A</tt> is the encoded version of the largest prefix of
<tt>C..D</tt>
that can be encoded unambiguously. <tt>B</tt> has the remaining bytes of
<tt>C..D</tt>, <em>before</em> encoding.
If <tt>D</tt> is <tt><b>nil</b></tt>, <tt>A</tt> is padded with
the encoding of the remaining bytes of <tt>C</tt>.
<p class=parameters>
<tt>A</tt> is the stuffed version of <tt>B</tt>. '<tt>n</tt>' gives the
number of characters from the sequence CRLF seen in the end of <tt>B</tt>.
'<tt>m</tt>' should tell the same, but for the previous chunk.
</p>

<p class=note>
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 <tt>mime.b64</tt>, to discard the second return value.
<p class=note>Note: The message body is defined to begin with
an implicit CRLF. Therefore, to stuff a message correctly, the
first <tt>m</tt> should have the value 2.
</p>

<pre class=example>
print((mime.b64("diego:password")))
--&gt; ZGllZ286cGFzc3dvcmQ=
print((string.gsub(mime.dot(2, ".\r\nStuffing the message.\r\n.\r\n."), "\r\n", "\\n")))
--&gt; ..\nStuffing the message.\n..\n..
</pre>

<p class=note>
Note: The <a href=smtp.html#send><tt>smtp.send</tt></a> function
uses this filter automatically. You don't need to
apply it again.
</p>

<!-- eol ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->

<p class=name id="eol">
Expand All @@ -273,7 +292,7 @@ <h3 id=low>Low-level filters</h3>
the context is returned after each new chunk.
</p>

<p class=description>
<p class=parameters>
<tt>A</tt> is the translated version of <tt>D</tt>. <tt>C</tt> is the
ASCII value of the last character of the previous chunk, if it was a
candidate for line break, or 0 otherwise.
Expand All @@ -296,7 +315,7 @@ <h3 id=low>Low-level filters</h3>
Low-level filter to perform Quoted-Printable encoding.
</p>

<p class=description>
<p class=parameters>
<tt>A</tt> is the encoded version of the largest prefix of
<tt>C..D</tt>
that can be encoded unambiguously. <tt>B</tt> has the remaining bytes of
Expand Down Expand Up @@ -328,7 +347,7 @@ <h3 id=low>Low-level filters</h3>
Low-level filter to break Quoted-Printable text into lines.
</p>

<p class=description>
<p class=parameters>
<tt>A</tt> is a copy of <tt>B</tt>, broken into lines of at most
<tt>length</tt> bytes (defaults to 76).
'<tt>n</tt>' should tell how many bytes are left for the first
Expand All @@ -352,7 +371,7 @@ <h3 id=low>Low-level filters</h3>
Low-level filter to perform Base64 decoding.
</p>

<p class=description>
<p class=parameters>
<tt>A</tt> is the decoded version of the largest prefix of
<tt>C..D</tt>
that can be decoded unambiguously. <tt>B</tt> has the remaining bytes of
Expand Down Expand Up @@ -383,7 +402,7 @@ <h3 id=low>Low-level filters</h3>
from data.
</p>

<p class=description>
<p class=parameters>
<tt>A</tt> is the decoded version of the largest prefix of
<tt>C..D</tt>
that can be decoded unambiguously. <tt>B</tt> has the remaining bytes of
Expand Down Expand Up @@ -414,7 +433,7 @@ <h3 id=low>Low-level filters</h3>
Text is assumed to be in the <a href=#normalize><tt>normalize</tt></a> form.
</p>

<p class=description>
<p class=parameters>
<tt>A</tt> is a copy of <tt>B</tt>, broken into lines of at most
<tt>length</tt> bytes (defaults to 76).
'<tt>n</tt>' should tell how many bytes are left for the first
Expand Down Expand Up @@ -443,7 +462,7 @@ <h3 id=low>Low-level filters</h3>
<p>
<small>
Last modified by Diego Nehab on <br>
Sat Aug 9 01:00:41 PDT 2003
Thu Jun 17 02:47:21 EDT 2004
</small>
</p>
</center>
Expand Down
8 changes: 5 additions & 3 deletions doc/reference.html
Original file line number Diff line number Diff line change
Expand Up @@ -107,17 +107,19 @@ <h2>Reference</h2>
<a href="mime.html#normalize">normalize</a>,
<a href="mime.html#decode">decode</a>,
<a href="mime.html#encode">encode</a>,
<a href="mime.html#stuff">stuff</a>,
<a href="mime.html#wrap">wrap</a>.
</blockquote>
<blockquote>
<a href="mime.html#low">low-level</a>:
<a href="mime.html#b64">b64</a>,
<a href="mime.html#unb64">unb64</a>,
<a href="mime.html#dot">dot</a>,
<a href="mime.html#eol">eol</a>,
<a href="mime.html#qp">qp</a>,
<a href="mime.html#unqp">unqp</a>,
<a href="mime.html#wrp">wrp</a>,
<a href="mime.html#qpwrp">qpwrp</a>.
<a href="mime.html#unb64">unb64</a>,
<a href="mime.html#unqp">unqp</a>,
</blockquote>
</blockquote>

Expand Down Expand Up @@ -218,7 +220,7 @@ <h2>Reference</h2>
<p>
<small>
Last modified by Diego Nehab on <br>
Thu Sep 27 16:18:27 EST 2001
Thu Jun 17 02:47:21 EDT 2004
</small>
</p>
</center>
Expand Down
7 changes: 4 additions & 3 deletions doc/smtp.html
Original file line number Diff line number Diff line change
Expand Up @@ -347,8 +347,9 @@ <h2 id=smtp>SMTP</h2>
[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,
Expand Down Expand Up @@ -397,7 +398,7 @@ <h2 id=smtp>SMTP</h2>
<p>
<small>
Last modified by Diego Nehab on <br>
Sat Aug 9 01:00:41 PDT 2003
Thu Jun 17 02:47:21 EDT 2004
</small>
</p>
</center>
Expand Down
2 changes: 1 addition & 1 deletion doc/socket.html
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ <h2 id=socket>The socket namespace</h2>
<p>
<small>
Last modified by Diego Nehab on <br>
Sat Aug 9 01:00:41 PDT 2003
Thu Jun 17 02:47:21 EDT 2004
</small>
</p>
</center>
Expand Down
2 changes: 1 addition & 1 deletion doc/tcp.html
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ <h2 id=tcp>TCP</h2>
<p>
<small>
Last modified by Diego Nehab on <br>
Sat Aug 9 01:00:41 PDT 2003
Thu Jun 17 02:47:21 EDT 2004
</small>
</p>
</center>
Expand Down
2 changes: 1 addition & 1 deletion doc/udp.html
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ <h2 id=udp>UDP</h2>
<p>
<small>
Last modified by Diego Nehab on <br>
Sat Aug 9 01:00:41 PDT 2003
Thu Jun 17 02:48:14 EDT 2004
</small>
</p>
</center>
Expand Down
2 changes: 1 addition & 1 deletion doc/url.html
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ <h2 id=url>URL</h2>
<p>
<small>
Last modified by Diego Nehab on <br>
Sat Aug 9 01:00:41 PDT 2003
Thu Jun 17 02:48:14 EDT 2004
</small>
</p>
</center>
Expand Down
2 changes: 1 addition & 1 deletion test/testmesg.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit eac26d2

Please sign in to comment.