Class Rfc822Header

Description

MIME header class input: header_string or array You must call parseHeader() function after creating object in order to fill object's parameters.

  • todo: FIXME: there is no constructor function and class should ignore all input args.
  • since: 1.3.0

Located in /class/mime/Rfc822Header.class.php (line 26)


	
			
Variable Summary
array $bcc
array $cc
mixed $content_id
object $content_type
mixed $date
mixed $disposition
mixed $dnt
mixed $drnt
mixed $encoding
array $from
string $in_reply_to
string $message_id
mixed $mime
mixed $mlist
integer $priority
string $references
array $reply_to
mixed $sender
string $subject
array $to
string $xmailer
Method Summary
object AddressStructure createAddressObject ( &$aStack,  &$aComment,  &$sEmail, [string $sGroup = ''], array $aStack, array $aComment, string $sEmail)
mixed findAddress (mixed $address, [boolean $recurs = false])
array getAddressTokens (string $address)
array getAddr_a (mixed $arg, [array $excl_arr = array()], [array $arr = array()])
string getAddr_s (mixed $arr, [string $separator = ', '], [boolean $encoded = false], [boolean $unconditionally_quote = FALSE])
array getContentType (string $type0, string $type1)
void mlist (string $field, string $value)
mixed parseAddress (string $address, [boolean $ar = false], [ $aAddress = array()], [ $sGroup = ''], [ $sHost = ''], [string $lookup = false], array $addr_ar, string $group, string $host)
void parseContentType (string $value)
void parseDisposition (string $value)
void parseField (string $field, string $value)
void parseHeader (mixed $hdr)
integer parsePriority (string $sValue)
array parseProperties (string $value)
void parseSpamStatus (string $value)
array processParameters (array $aParameters)
string stripComments (string $value)
Variables
array $bcc = array() (line 75)

Bcc header

array $cc = array() (line 70)

Cc header

mixed $content_desc = '' (line 135)
mixed $content_id = '' (line 131)
object $content_type = '' (line 99)

Content Type object

mixed $date = -1 (line 31)

Date header

mixed $date_unparsed = '' (line 36)

Original date header as fallback for unparsable dates

mixed $disposition = '' (line 103)
mixed $dnt = '' (line 118)

Disposition notification for requesting message delivery notification (MDN)

mixed $drnt = '' (line 123)

Delivery notification (DR)

mixed $encoding = '' (line 127)
array $from = array() (line 46)

From header

string $in_reply_to = '' (line 80)

In-reply-to header

array $mail_followup_to = array() (line 60)

Mail-Followup-To header

string $message_id = '' (line 85)

Message-ID header

mixed $mime = false (line 94)
mixed $mlist = array() (line 139)
array $more_headers = array() (line 150)

Extra header

only needed for constructing headers in delivery class

integer $priority = 3 (line 113)

Priority header

string $references = '' (line 90)

References header

array $reply_to = array() (line 55)

Reply-To header

mixed $sender = '' (line 50)
string $subject = '' (line 41)

Subject header

array $to = array() (line 65)

To header

string $xmailer = '' (line 108)

X-Mailer header

mixed $x_spam_status = array() (line 144)

SpamAssassin 'x-spam-status' header

Methods
createAddressObject (line 496)
  • return: object
object AddressStructure createAddressObject ( &$aStack,  &$aComment,  &$sEmail, [string $sGroup = ''], array $aStack, array $aComment, string $sEmail)
  • array $aStack
  • array $aComment
  • string $sEmail
  • string $sGroup
  • &$aStack
  • &$aComment
  • &$sEmail
findAddress (line 999)

Looking at the code years after it was written,

this is my (Paul) best guess as to what this function does (note that docs previously claimed that this function returns boolean or an array, but it no longer appears to return an array - an integer instead):

Inspects the TO and CC headers of the message represented by this object, looking for the address(es) given by $address

If $address is a string: Serves as a test (returns boolean) as to whether or not the given address is found anywhere in the TO or CC headers

If $address is an array: Looks through this list of addresses and returns the array index (an integer even if the array is given with keys of a different type) of the *last* matching $address found in this message's TO or CC headers, unless there is an exact match (meaning that the "personal information" in addition to the email address also matches), in which case that index (the first one found) is returned

  • return: Boolean when $address is a scalar, indicating whether or not the address was found in the TO or CC headers. An integer when $address is an array, containing the index of the value in that array that was found in the TO or CC headers, or boolean FALSE if there were no matches at all
  • since: 1.3.2
mixed findAddress (mixed $address, [boolean $recurs = false])
  • mixed $address: Address(es) to search for in this message's TO and CC headers - please see above how the format of this argument affects the return value of this function
  • boolean $recurs: FOR INTERNAL USE ONLY
getAddressTokens (line 364)
array getAddressTokens (string $address)
  • string $address
getAddr_a (line 916)

function to get the array of addresses out of the header.

array getAddr_a (mixed $arg, [array $excl_arr = array()], [array $arr = array()])
  • mixed $arg: string or array of strings
  • array $excl_arr: array of excluded email addresses
  • array $arr: array of added email addresses
getAddr_s (line 873)

function to get the address strings out of the header.

example1: header->getAddr_s('to'). example2: header->getAddr_s(array('to', 'cc', 'bcc'))

string getAddr_s (mixed $arr, [string $separator = ', '], [boolean $encoded = false], [boolean $unconditionally_quote = FALSE])
  • mixed $arr: string or array of strings
  • string $separator
  • boolean $encoded: (since 1.4.0) return encoded or plain text addresses
  • boolean $unconditionally_quote: (since 1.4.21/1.5.2) When TRUE, always quote the personal part, whether or not it is encoded, otherwise quoting is only added if the personal part is not encoded
getContentType (line 1065)
  • return: media properties
  • todo: check use of media type arguments
array getContentType (string $type0, string $type1)
  • string $type0: media type
  • string $type1: media subtype
mlist (line 794)

Fills mlist array keys in rfc822Header object

void mlist (string $field, string $value)
  • string $field
  • string $value
parseAddress (line 549)

recursive function for parsing address strings and storing them in an address stucture object.

personal name: encoded: =?charset?Q|B?string?= quoted: "string" normal: string email : <mailbox@host> : mailbox@host This function is also used for validating addresses returned from compose That's also the reason that the function became a little bit huge

  • return: array with AddressStructure objects or only one address_structure object.
mixed parseAddress (string $address, [boolean $ar = false], [ $aAddress = array()], [ $sGroup = ''], [ $sHost = ''], [string $lookup = false], array $addr_ar, string $group, string $host)
  • string $address
  • boolean $ar: return array instead of only the first element
  • array $addr_ar: (obsolete) array with parsed addresses
  • string $group: (obsolete)
  • string $host: default domainname in case of addresses without a domainname
  • string $lookup: (since) callback function for lookup of address strings which are probably nicks (without @)
  • $aAddress
  • $sGroup
  • $sHost
parseContentType (line 686)
void parseContentType (string $value)
  • string $value: content type header
parseDisposition (line 774)

Fills disposition object in rfc822Header object

void parseDisposition (string $value)
  • string $value
parseField (line 234)

Parse header field according to field type

void parseField (string $field, string $value)
  • string $field: field name
  • string $value: field value
parseHeader (line 155)
void parseHeader (mixed $hdr)
  • mixed $hdr: string or array with message headers
parsePriority (line 666)

Normalise the different Priority headers into a uniform value, namely that of the X-Priority header (1, 3, 5). Supports: Priority, X-Priority, Importance.

X-MS-Mail-Priority is not parsed because it always coincides with one of the other headers.

NOTE: this is actually a duplicate from the code in functions/imap_messages:parseFetch(). I'm not sure if it's ok here to call that function?

integer parsePriority (string $sValue)
  • string $sValue: literal priority name
parseProperties (line 752)
array parseProperties (string $value)
  • string $value
parseSpamStatus (line 815)

Parses the X-Spam-Status header

void parseSpamStatus (string $value)
  • string $value
processParameters (line 711)

RFC2184

array processParameters (array $aParameters)
  • array $aParameters
stripComments (line 185)
string stripComments (string $value)
  • string $value

Documentation generated on Fri, 25 Jul 2014 04:19:18 +0200 by phpDocumentor 1.4.3