cs::RFC822 - handle RFC822 data (internet standard email headers)
use cs::RFC822;
This module implements methods for dealing with RFC822 data.
Convert the standard timezone name zone to an offset in minutes from GMT.
Convert a headername into a perl bareword string by uppercasing the letters and translating dashes into underscores.
Convert a hdrkey (or RFC822 header name) into a vanilla header name by lowercasing the letters, translating underscores into dashes and then uppercasing the first letter of any word.
Parse the string addresses and return a hashref mapping user@host to full address.
Extract the full name component from address (i.e. the text outside the ... or within the (...), depending). In a scalar context, return the full name. In an array context return the full name and the remaining address text as two strings.
msgid()
Create an unique message-id.
Create a UNIX envelope ``From_'' line body value from the address and optional UNIX time_t time.
Clean excess whitepsace and leading ``Re: '' prefixes from the string subject.
Create a new csRFC822 object. If the optional parameter source is supplied then if it is an object reference use it as a cs::Source object and extract any headers from it, leaving it positioned at the start of the message body. If source is a scalar consider it a filename and extract headers from that file.
Return an array of the bodies of the header fields named header. If the optional parameter first is true, return only the first such header.
Hdrs()
Return the arrayref storing the headers in a scalar context, or the array itself in a list context.
HdrNames()
Return the names of the fields present in the headers.
Add the specified header to the object in the fashion specified by the optional parameter how (which defaults to ADD). header may be an arrayref to an array of the form (headername,headerbody), a complete header line (``headername: headerbody''), or a header name, in which last case an extra parameter headerbody is expected before how.
headerbody may also be an arrayref in which case the body is the concatenation of the array elements separated by ``,\n\t'', or a hashref in which case the body is the concatenation of the hash values separated by ``,\n\t''.
how is one of the strings: ADD, to append the header to the list; PREPEND, to prepend the header to the list; SUPERCEDE, to rename all existing headers named headername to be ``X-Original-headername'' and the append the header to the list; REPLACE, to discard all existing headers named headername and append the header to the list.
If how is SUPERCEDE an optional prefix string may be supplied after how to use instead of ``X-Original-'' above. Note: a zero length prefix string makes SUPERCEDE act like REPLACE, not ADD.
Extract the headers from the named file.
Extract the headers from the perl filehandle FILE, leaving the file handle positioned at the start of the body.
Extract the headers from the specified source, leaving the source positioned at the start of the body.
Extract the headers from the array of lines.
Delete all headers named headername. If the optional parameter keep is true, just rename the headers to ``X-Deleted-headername''.
Extract the email addresses from the headers specified by the array headenames and return a hashref keyed on the user@host component.
ForceMsgID()
Generate and insert a Message-ID field if none is present.
RFC822 - Standard for the Format of ARPA Internet Text Messages
cs::Source(3), cs::Sink(3), cs::MIME(3)
Cameron Simpson <cs@zip.com.au>