[Package Index | Mudlib Index | Effect Index]

File /obj/handlers/mime.c

A parser for RFC 822 compliant messages, with emphasis on the headers in them, also known as MIME headers.

RFC 822 describes the format of all Internet messages. This includes things like email, usenet news and HTTP protocol messages.

Written by Turrican

Started 22 May 1998

Includes

This class includes the following files /include/mime.h

Method index

Public Functions

These are functions that everyone can access.

get_email_addrs
mixed * get_email_addrs(string arg)

This method extracts valid email adresses from the given header field or string.

Parameters:
arg - the string to parse

Returns:
an array consisting of an array of machine usable email adresses (no whitespace and comments) and an array of the full addresses

See also:
rewrite_field()


parse_headers
class mime_header parse_headers(string message)

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.

Parameters:
message - the message to be parsed

Returns:
a class mime_header with the headers from the message


rewrite_field
string rewrite_field(string header_field)

This method rewrites local email addresses (as found in mudmail) to be usable outside Discworld, for instance from an email client.

Parameters:
header_field - the string to rewrite

Returns:
the new string

See also:
get_email_addrs()


rewrite_header
string rewrite_header(string message)

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:

Parameters:
message - the message to rewrite

Returns:
the possibly modified message, suited for Internet transport

See also:
rewrite_field()