Copyright (c) 1999-2006 The SquirrelMail Project Team Copyright (c) 2006-2008 The NaSMail Project This file is part of NaSMail webmail interface.
This script stores functions necessary to detect and decode MIME messages.
This script contains modifications ported from SquirrelMail 1.4.9+. See commits tagged with SM-PATCH keyword. Modifications are copyrighted by the SquirrelMail Project Team. Copyright (c) 2007 The SquirrelMail Project Team
Decodes encoded message body
This function decodes the body depending on the encoding type. Currently quoted-printable and base64 encodings are supported.
Function executes decode_body hook.
Decodes MIME headers
This function decodes strings that are encoded according to RFC2047 (MIME Part Three: Message Header Extensions for Non-ASCII Text).
Function is not fully compatible with SquirrelMail decodeHeader() function. It should act same way only in SquirrelMail decoding environment. In SquirrelMail message composition uses fourth option. This option is not needed in utf-8 only environment and can be combined with second function argument. Modifications reduce number of function operation modes and simplifies testing.
Encodes header
Encodes a string according to RFC 2045 for use in headers if string contains 8bit characters or anything that looks like it should be encoded.
Function switches to encodeHeaderBase64() with multibyte character set is used and PHP mbstring extension supports it. Q encoding is used as fallback encoding and when text is not 8bit.
WARNING: Function does not fold header. Encoded string is divided into atoms that are suitable for folding.
Encodes string according to rfc2047 B encoding header formating rules
It is recommended way to encode headers with character sets that store symbols in more than one byte.
Function requires mbstring support. If required mbstring functions are missing, function returns false and sets E_USER_WARNING level error message.
Minimal requirements - php 4.0.6 with mbstring extension. Please note, that mbstring functions will generate E_WARNING errors, if unsupported character set is used. mb_encode_mimeheader function provided by php mbstring extension is not used in order to get better control of header encoding.
Used php code functions - function_exists(), trigger_error(), strlen() (is used with charset names and base64 strings). Used php mbstring functions - mb_strlen and mb_substr.
Related documents: rfc 2045 (BASE64 encoding), rfc 2047 (mime header encoding), rfc 2822 (header folding)
WARNING: Function does not fold header. Encoded string is divided into atoms that are suitable for folding.
This function trys to locate the entity_id of a specific mime element
Format attachment block
This returns a parsed string called $body. That string can then be displayed as the actual message in the HTML. It contains everything needed, including HTML Tags, Attachments at the bottom, etc.
returns a $message object for a particular entity id
Converts priority to human readable string
Prints message entities
This is here for debugging purposes. It will print out a list of all the entity IDs that are in the $message object.
This starts the parsing of a particular structure. It is called recursively, so it can be passed different structures. It returns an object of type $message.
First, it checks to see if it is a multipart message. If it is, then it handles that as it sees is necessary. If it is just a regular entity, then it parses it and adds the necessary header information (by calling out to mime_get_elements()
Get the MIME structure
This function gets the structure of a message and stores it in the "message" class. It will return this object for use with all relevant header information and fully parsed into the standard "message" object format.
function SendDownloadHeaders - send file to the browser
Original Source: SM core src/download.php moved here to make it available to other code, and separate front end from back end functionality.
Decodes base64 string
Checks, if message contains image attachment
translateText
Documentation generated on Sun, 22 Nov 2009 17:36:42 +0200 by phpDocumentor 1.4.3