[an error occurred while processing this directive]
[<a href="index.shtml">Package Index</a></code> | <a href="index_std.shtml">Mudlib Index</a></code> | <a href="index_eff.shtml">Effect Index</a></code>]<br><h2>File /obj/handlers/mime.c</h2>
A parser for RFC 822 compliant messages, with emphasis on
the headers in them, also known as MIME headers.
<p>
RFC 822 describes the format of all Internet messages. This
includes things like email, usenet news and HTTP protocol
messages.<p>Written by Turrican<p>Started 22 May 1998
<h2>Includes</h2>
This class includes the following files /include/mime.h<h2>Method index</h2>
<ul>
<li><a href="#get_email_addrs">get_email_addrs</a>(string)<br/>
This method extracts valid email adresses from the given
header field or string.
<li><a href="#parse_headers">parse_headers</a>(string)<br/>
This method parses an RFC 822 compliant message and extracts all
the headers into a class mime_header.
<li><a href="#rewrite_field">rewrite_field</a>(string)<br/>
This method rewrites local email addresses (as found in mudmail)
to be usable outside Discworld, for instance from an email client.
<li><a href="#rewrite_header">rewrite_header</a>(string)<br/>
This method rewrites all the fields from an RFC 822 compliant message
to make the message suited for Internet transport.
</ul>
<h2>Public Functions</h2>
These are functions that everyone can access.<p>
<dl>
<dt class="autodocfuncname"><a name="get_email_addrs">
get_email_addrs</a><pre class="autodocfuncdef">
mixed * get_email_addrs(string arg)
</pre><dd><br />
This method extracts valid email adresses from the given
header field or string.
<br />
<br /><dl>
<dd><b>Parameters:</b><br />
arg - the string to parse<br />
<br />
<dd><b>Returns:</b>
<br />an array consisting of an array of machine usable email adresses
(no whitespace and comments) and an array of the full addresses<br /><br />
<dd><b>See also:</b>
<br /><a href="#rewrite_field">rewrite_field()
</a><br /><br /><br /></dl>

<dt class="autodocfuncname"><a name="parse_headers">
parse_headers</a><pre class="autodocfuncdef">
class mime_header parse_headers(string message)
</pre><dd><br />
This method parses an RFC 822 compliant message and extracts all
the headers into a class mime_header. This class contains a mapping
with the header field names as keys, so you can easily select
the headers you need.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
message - the message to be parsed<br />
<br />
<dd><b>Returns:</b>
<br />a class mime_header with the headers from the message
<br /><br />
<br /></dl>

<dt class="autodocfuncname"><a name="rewrite_field">
rewrite_field</a><pre class="autodocfuncdef">
string rewrite_field(string header_field)
</pre><dd><br />
This method rewrites local email addresses (as found in mudmail)
to be usable outside Discworld, for instance from an email client.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
header_field - the string to rewrite<br />
<br />
<dd><b>Returns:</b>
<br />the new string<br /><br />
<dd><b>See also:</b>
<br /><a href="#get_email_addrs">get_email_addrs()
</a><br /><br /><br /></dl>

<dt class="autodocfuncname"><a name="rewrite_header">
rewrite_header</a><pre class="autodocfuncdef">
string rewrite_header(string message)
</pre><dd><br />
This method rewrites all the fields from an RFC 822 compliant message
to make the message suited for Internet transport. It uses the
rewrite_field() method to achieve this. The affected header fields
are:
<UL>
<LI> To:
<LI> From:
<LI> Cc:
<LI> Bcc:
<LI> Reply-To:
</UL><br />
<br /><dl>
<dd><b>Parameters:</b><br />
message - the message to rewrite<br />
<br />
<dd><b>Returns:</b>
<br />the possibly modified message, suited for Internet transport<br /><br />
<dd><b>See also:</b>
<br /><a href="#rewrite_field">rewrite_field()
</a><br /><br /><br /></dl>

</dl>
[an error occurred while processing this directive]

