sequence.
* DEFAULT: false
* - defserver: (string) The default server to use when creating the
* header string.
* DEFAULT: none
* - encode: (integer) A mask of allowable encodings.
* DEFAULT: self::ENCODE_7BIT
* - headers: (mixed) Include the MIME headers? If true, create a new
* headers object. If a Horde_Mime_Headers object, add MIME
* headers to this object. If a string, use the string
* verbatim.
* DEFAULT: true
* - id: (string) Return only this MIME ID part.
* DEFAULT: Returns the base part.
* - stream: (boolean) Return a stream resource.
* DEFAULT: false
*
* @return mixed The MIME string (returned as a resource if $stream is
* true).
*/
public function toString($options = array())
{
$eol = $this->getEOL();
$isbase = true;
$oldbaseptr = null;
$parts = $parts_close = array();
if (isset($options['id'])) {
$id = $options['id'];
if (!($part = $this->getPart($id))) {
return $part;
}
unset($options['id']);
$contents = $part->toString($options);
$prev_id = Horde_Mime::mimeIdArithmetic($id, 'up', array('norfc822' => true));
$prev_part = ($prev_id == $this->getMimeId())
? $this
: $this->getPart($prev_id);
if (!$prev_part) {
return $contents;
}
$boundary = trim($this->getContentTypeParameter('boundary'), '"');
$parts = array(
$eol . '--' . $boundary . $eol,
$contents
);
if (!$this->getPart(Horde_Mime::mimeIdArithmetic($id, 'next'))) {
$parts[] = $eol . '--' . $boundary . '--' . $eol;
}
} else {
if ($isbase = empty($options['_notbase'])) {
$headers = !empty($options['headers'])
? $options['headers']
: false;
if (empty($options['encode'])) {
$options['encode'] = null;
}
if (empty($options['defserver'])) {
$options['defserver'] = null;
}
$options['headers'] = true;
$options['_notbase'] = true;
} else {
$headers = true;
$oldbaseptr = &$options['_baseptr'];
}
$this->_temp['toString'] = '';
$options['_baseptr'] = &$this->_temp['toString'];
/* Any information about a message is embedded in the message
* contents themself. Simply output the contents of the part
* directly and return. */
$ptype = $this->getPrimaryType();
if ($ptype == 'message') {
$parts[] = $this->_contents;
} else {
if (!empty($this->_contents)) {
$encoding = $this->_getTransferEncoding($options['encode']);
switch ($encoding) {
case '8bit':
if (empty($options['_baseptr'])) {
$options['_baseptr'] = '8bit';
}
break;
case 'binary':
$options['_baseptr'] = 'binary';
break;
}
$parts[] = $this->_transferEncode($this->_contents, $encoding);
/* If not using $this->_contents, we can close the stream
* when finished. */
if ($this->_temp['transferEncodeClose']) {
$parts_close[] = end($parts);
}
}
/* Deal with multipart messages. */
if ($ptype == 'multipart') {
if (empty($this->_contents)) {
$parts[] = 'This message is in MIME format.' . $eol;
}
$boundary = trim($this->getContentTypeParameter('boundary'), '"');
reset($this->_parts);
while (list(,$part) = each($this->_parts)) {
$parts[] = $eol . '--' . $boundary . $eol;
$tmp = $part->toString($options);
if ($part->getEOL() != $eol) {
$tmp = $this->replaceEOL($tmp, $eol, !empty($options['stream']));
}
if (!empty($options['stream'])) {
$parts_close[] = $tmp;
}
$parts[] = $tmp;
}
$parts[] = $eol . '--' . $boundary . '--' . $eol;
}
}
if (is_string($headers)) {
array_unshift($parts, $headers);
} elseif ($headers) {
$hdr_ob = $this->addMimeHeaders(array('encode' => $options['encode'], 'headers' => ($headers === true) ? null : $headers));
$hdr_ob->setEOL($eol);
if (!empty($this->_temp['toString'])) {
$hdr_ob->replaceHeader('Content-Transfer-Encoding', $this->_temp['toString']);
}
array_unshift($parts, $hdr_ob->toString(array('charset' => $this->getHeaderCharset(), 'defserver' => $options['defserver'])));
}
}
$newfp = $this->_writeStream($parts);
array_map('fclose', $parts_close);
if (!is_null($oldbaseptr)) {
switch ($this->_temp['toString']) {
case '8bit':
if (empty($oldbaseptr)) {
$oldbaseptr = '8bit';
}
break;
case 'binary':
$oldbaseptr = 'binary';
break;
}
}
if ($isbase && !empty($options['canonical'])) {
return $this->replaceEOL($newfp, self::RFC_EOL, !empty($options['stream']));
}
return empty($options['stream'])
? $this->_readStream($newfp)
: $newfp;
}
/**
* Get the transfer encoding for the part based on the user requested
* transfer encoding and the current contents of the part.
*
* @param integer $encode A mask of allowable encodings.
*
* @return string The transfer-encoding of this part.
*/
protected function _getTransferEncoding($encode = self::ENCODE_7BIT)
{
if (!empty($this->_temp['sendEncoding'])) {
return $this->_temp['sendEncoding'];
} elseif (!empty($this->_temp['sendTransferEncoding'][$encode])) {
return $this->_temp['sendTransferEncoding'][$encode];
}
if (empty($this->_contents)) {
$encoding = '7bit';
} else {
$nobinary = false;
switch ($this->getPrimaryType()) {
case 'message':
case 'multipart':
/* RFC 2046 [5.2.1] - message/rfc822 messages only allow 7bit,
* 8bit, and binary encodings. If the current encoding is
* either base64 or q-p, switch it to 8bit instead.
* RFC 2046 [5.2.2, 5.2.3, 5.2.4] - All other message/*
* messages only allow 7bit encodings.
*
* TODO: What if message contains 8bit characters and we are
* in strict 7bit mode? Not sure there is anything we can do
* in that situation, especially for message/rfc822 parts.
*
* These encoding will be figured out later (via toString()).
* They are limited to 7bit, 8bit, and binary. Default to
* '7bit' per RFCs. */
$encoding = '7bit';
$nobinary = true;
break;
case 'text':
$eol = $this->getEOL();
if ($this->_scanStream($this->_contents, '8bit')) {
$encoding = ($encode & self::ENCODE_8BIT || $encode & self::ENCODE_BINARY)
? '8bit'
: 'quoted-printable';
} elseif ($this->_scanStream($this->_contents, 'preg', "/(?:" . $eol . "|^)[^" . $eol . "]{999,}(?:" . $eol . "|$)/")) {
/* If the text is longer than 998 characters between
* linebreaks, use quoted-printable encoding to ensure the
* text will not be chopped (i.e. by sendmail if being
* sent as mail text). */
$encoding = 'quoted-printable';
} else {
$encoding = '7bit';
}
break;
default:
/* If transfer encoding has changed from the default, use that
* value. */
if ($this->_transferEncoding != self::DEFAULT_ENCODING) {
$encoding = $this->_transferEncoding;
} else {
$encoding = ($encode & self::ENCODE_8BIT || $encode & self::ENCODE_BINARY)
? '8bit'
: 'base64';
}
break;
}
/* Need to do one last check for binary data if encoding is 7bit
* or 8bit. If the message contains a NULL character at all, the
* message MUST be in binary format. RFC 2046 [2.7, 2.8, 2.9]. Q-P
* and base64 can handle binary data fine so no need to switch
* those encodings. */
if (!$nobinary &&
in_array($encoding, array('8bit', '7bit')) &&
$this->_scanStream($this->_contents, 'binary')) {
$encoding = ($encode & self::ENCODE_BINARY)
? 'binary'
: 'base64';
}
}
$this->_temp['sendTransferEncoding'][$encode] = $encoding;
return $encoding;
}
/**
* Replace newlines in this part's contents with those specified by either
* the given newline sequence or the part's current EOL setting.
*
* @param mixed $text The text to replace. Either a string or a
* stream resource. If a stream, and returning
* a string, will close the stream when done.
* @param string $eol The EOL sequence to use. If not present, uses
* the part's current EOL setting.
* @param boolean $stream If true, returns a stream resource.
*
* @return string The text with the newlines replaced by the desired
* newline sequence (returned as a stream resource if
* $stream is true).
*/
public function replaceEOL($text, $eol = null, $stream = false)
{
if (is_null($eol)) {
$eol = $this->getEOL();
}
stream_filter_register('horde_eol', 'Horde_Stream_Filter_Eol');
$fp = $this->_writeStream($text, array(
'filter' => array(
'horde_eol' => array('eol' => $eol)
)
));
return $stream ? $fp : $this->_readStream($fp, true);
}
/**
* Determine the size of this MIME part and its child members.
*
* @param boolean $approx If true, determines an approximate size for
* parts consisting of base64 encoded data.
*
* @return integer Size of the part, in bytes.
*/
public function getBytes($approx = false)
{
$bytes = 0;
if (isset($this->_bytes)) {
$bytes = $this->_bytes;
/* Base64 transfer encoding is approx. 33% larger than original
* data size (RFC 2045 [6.8]). */
if ($approx && ($this->_transferEncoding == 'base64')) {
$bytes *= 0.75;
}
} elseif ($this->getPrimaryType() == 'multipart') {
reset($this->_parts);
while (list(,$part) = each($this->_parts)) {
$bytes += $part->getBytes($approx);
}
} elseif ($this->_contents) {
fseek($this->_contents, 0, SEEK_END);
$bytes = ftell($this->_contents);
/* Base64 transfer encoding is approx. 33% larger than original
* data size (RFC 2045 [6.8]). */
if ($approx && ($this->_transferEncoding == 'base64')) {
$bytes *= 0.75;
}
}
return $bytes;
}
/**
* Explicitly set the size (in bytes) of this part. This value will only
* be returned (via getBytes()) if there are no contents currently set.
* This function is useful for setting the size of the part when the
* contents of the part are not fully loaded (i.e. creating a
* Horde_Mime_Part object from IMAP header information without loading the
* data of the part).
*
* @param integer $bytes The size of this part in bytes.
*/
public function setBytes($bytes)
{
$this->setDispositionParameter('size', $bytes);
}
/**
* Output the size of this MIME part in KB.
*
* @param boolean $approx If true, determines an approximate size for
* parts consisting of base64 encoded data.
*
* @return string Size of the part in KB.
*/
public function getSize($approx = false)
{
if (!($bytes = $this->getBytes($approx))) {
return 0;
}
$localeinfo = Horde_Nls::getLocaleInfo();
// TODO: Workaround broken number_format() prior to PHP 5.4.0.
return str_replace(
array('X', 'Y'),
array($localeinfo['decimal_point'], $localeinfo['thousands_sep']),
number_format(ceil($bytes / 1024), 0, 'X', 'Y')
);
}
/**
* Sets the Content-ID header for this part.
*
* @param string $cid Use this CID (if not already set). Else, generate
* a random CID.
*
* @return string The Content-ID for this part.
*/
public function setContentId($cid = null)
{
if (is_null($this->_contentid)) {
$this->_contentid = is_null($cid)
? (strval(new Horde_Support_Randomid()) . '@' . $_SERVER['SERVER_NAME'])
: trim($cid, '<>');
}
return $this->_contentid;
}
/**
* Returns the Content-ID for this part.
*
* @return string The Content-ID for this part.
*/
public function getContentId()
{
return $this->_contentid;
}
/**
* Alter the MIME ID of this part.
*
* @param string $mimeid The MIME ID.
*/
public function setMimeId($mimeid)
{
$this->_mimeid = $mimeid;
}
/**
* Returns the MIME ID of this part.
*
* @return string The MIME ID.
*/
public function getMimeId()
{
return $this->_mimeid;
}
/**
* Build the MIME IDs for this part and all subparts.
*
* @param string $id The ID of this part.
* @param boolean $rfc822 Is this a message/rfc822 part?
*/
public function buildMimeIds($id = null, $rfc822 = false)
{
if (is_null($id)) {
$rfc822 = true;
$id = '';
}
if ($rfc822) {
if (empty($this->_parts) &&
($this->getPrimaryType() != 'multipart')) {
$this->setMimeId($id . '1');
} else {
if (empty($id) && ($this->getType() == 'message/rfc822')) {
$this->setMimeId('1');
$id = '1.';
} else {
$this->setMimeId($id . '0');
}
$i = 1;
foreach (array_keys($this->_parts) as $val) {
$this->_parts[$val]->buildMimeIds($id . ($i++));
}
}
} else {
$this->setMimeId($id);
$id = $id
? $id . '.'
: '';
if ($this->getType() == 'message/rfc822') {
if (count($this->_parts)) {
reset($this->_parts);
$this->_parts[key($this->_parts)]->buildMimeIds($id, true);
}
} elseif (!empty($this->_parts)) {
$i = 1;
foreach (array_keys($this->_parts) as $val) {
$this->_parts[$val]->buildMimeIds($id . ($i++));
}
}
}
$this->_reindex = false;
}
/**
* Generate the unique boundary string (if not already done).
*
* @return string The boundary string.
*/
protected function _generateBoundary()
{
if (is_null($this->_boundary)) {
$this->_boundary = '=_' . strval(new Horde_Support_Randomid());
}
return $this->_boundary;
}
/**
* Returns a mapping of all MIME IDs to their content-types.
*
* @param boolean $sort Sort by MIME ID?
*
* @return array Keys: MIME ID; values: content type.
*/
public function contentTypeMap($sort = true)
{
$map = array($this->getMimeId() => $this->getType());
foreach ($this->_parts as $val) {
$map += $val->contentTypeMap(false);
}
if ($sort) {
uksort($map, 'strnatcmp');
}
return $map;
}
/**
* Is this the base MIME part?
*
* @param boolean $base True if this is the base MIME part.
*/
public function isBasePart($base)
{
$this->_basepart = $base;
}
/**
* Set a piece of metadata on this object.
*
* @param string $key The metadata key.
* @param mixed $data The metadata. If null, clears the key.
*/
public function setMetadata($key, $data = null)
{
if (is_null($data)) {
unset($this->_metadata[$key]);
} else {
$this->_metadata[$key] = $data;
}
}
/**
* Retrieves metadata from this object.
*
* @param string $key The metadata key.
*
* @return mixed The metadata, or null if it doesn't exist.
*/
public function getMetadata($key)
{
return isset($this->_metadata[$key])
? $this->_metadata[$key]
: null;
}
/**
* Sends this message.
*
* @param string $email The address list to send to.
* @param Horde_Mime_Headers $headers The Horde_Mime_Headers object
* holding this message's headers.
* @param Horde_Mail_Transport $mailer A Horde_Mail_Transport object.
* @param array $opts Additional options:
* - encode: (integer) The encoding to use. A mask of self::ENCODE_*
* values.
* DEFAULT: Auto-determined based on transport driver.
*
* @throws Horde_Mime_Exception
* @throws InvalidArgumentException
*/
public function send($email, $headers, Horde_Mail_Transport $mailer,
array $opts = array())
{
$old_basepart = $this->_basepart;
$this->_basepart = true;
/* Does the SMTP backend support 8BITMIME (RFC 1652)? */
$canonical = true;
$encode = self::ENCODE_7BIT;
if (isset($opts['encode'])) {
/* Always allow 7bit encoding. */
$encode |= $opts['encode'];
} elseif ($mailer instanceof Horde_Mail_Transport_Smtp) {
try {
$smtp_ext = $mailer->getSMTPObject()->getServiceExtensions();
if (isset($smtp_ext['8BITMIME'])) {
$encode |= self::ENCODE_8BIT;
}
} catch (Horde_Mail_Exception $e) {}
$canonical = false;
} elseif ($mailer instanceof Horde_Mail_Transport_Smtphorde) {
try {
if ($mailer->getSMTPObject()->data_8bit) {
$encode |= self::ENCODE_8BIT;
}
} catch (Horde_Mail_Exception $e) {}
$canonical = false;
}
$msg = $this->toString(array(
'canonical' => $canonical,
'encode' => $encode,
'headers' => false,
'stream' => true
));
/* Add MIME Headers if they don't already exist. */
if (!$headers->getValue('MIME-Version')) {
$headers = $this->addMimeHeaders(array('encode' => $encode, 'headers' => $headers));
}
if (!empty($this->_temp['toString'])) {
$headers->replaceHeader('Content-Transfer-Encoding', $this->_temp['toString']);
switch ($this->_temp['toString']) {
case '8bit':
if ($mailer instanceof Horde_Mail_Transport_Smtp) {
$mailer->addServiceExtensionParameter('BODY', '8BITMIME');
} elseif ($mailer instanceof Horde_Mail_Transport_Smtphorde) {
$mailer->send8bit = true;
}
break;
}
}
$this->_basepart = $old_basepart;
$rfc822 = new Horde_Mail_Rfc822();
try {
$mailer->send($rfc822->parseAddressList($email)->writeAddress(array(
'encode' => $this->getHeaderCharset(),
'idn' => true
)), $headers->toArray(array(
'canonical' => $canonical,
'charset' => $this->getHeaderCharset()
)), $msg);
} catch (Horde_Mail_Exception $e) {
throw new Horde_Mime_Exception($e);
}
}
/**
* Finds the main "body" text part (if any) in a message.
* "Body" data is the first text part under this part.
*
* @param string $subtype Specifically search for this subtype.
*
* @return mixed The MIME ID of the main body part, or null if a body
* part is not found.
*/
public function findBody($subtype = null)
{
$initial_id = $this->getMimeId();
$this->buildMimeIds();
foreach ($this->contentTypeMap() as $mime_id => $mime_type) {
if ((strpos($mime_type, 'text/') === 0) &&
(!$initial_id || (intval($mime_id) == 1)) &&
(is_null($subtype) || (substr($mime_type, 5) == $subtype)) &&
($part = $this->getPart($mime_id)) &&
($part->getDisposition() != 'attachment')) {
return $mime_id;
}
}
return null;
}
/**
* Write data to a stream.
*
* @param array $data The data to write. Either a stream resource or
* a string.
* @param array $options Additional options:
* - error: (boolean) Catch errors when writing to the stream. Throw an
* ErrorException if an error is found.
* DEFAULT: false
* - filter: (array) Filter(s) to apply to the string. Keys are the
* filter names, values are filter params.
* - fp: (resource) Use this stream instead of creating a new one.
*
* @return resource The stream resource.
* @throws ErrorException
*/
protected function _writeStream($data, $options = array())
{
if (empty($options['fp'])) {
$fp = fopen('php://temp/maxmemory:' . self::$memoryLimit, 'r+');
} else {
$fp = $options['fp'];
fseek($fp, 0, SEEK_END);
}
if (!is_array($data)) {
$data = array($data);
}
if (!empty($options['filter'])) {
$append_filter = array();
foreach ($options['filter'] as $key => $val) {
$append_filter[] = stream_filter_append($fp, $key, STREAM_FILTER_WRITE, $val);
}
}
if (!empty($options['error'])) {
set_error_handler(array($this, '_writeStreamErrorHandler'));
$error = null;
}
try {
reset($data);
while (list(,$d) = each($data)) {
if (is_resource($d)) {
rewind($d);
while (!feof($d)) {
fwrite($fp, fread($d, 8192));
}
} else {
$len = strlen($d);
$i = 0;
while ($i < $len) {
fwrite($fp, substr($d, $i, 8192));
$i += 8192;
}
}
}
} catch (ErrorException $e) {
$error = $e;
}
if (!empty($options['filter'])) {
foreach ($append_filter as $val) {
stream_filter_remove($val);
}
}
if (!empty($options['error'])) {
restore_error_handler();
if ($error) {
throw $error;
}
}
return $fp;
}
/**
* Error handler for _writeStream().
*
* @param integer $errno Error code.
* @param string $errstr Error text.
*
* @throws ErrorException
*/
protected function _writeStreamErrorHandler($errno, $errstr)
{
throw new ErrorException($errstr, $errno);
}
/**
* Read data from a stream.
*
* @param resource $fp An active stream.
* @param boolean $close Close the stream when done reading?
*
* @return string The data from the stream.
*/
protected function _readStream($fp, $close = false)
{
$out = '';
if (!is_resource($fp)) {
return $out;
}
rewind($fp);
while (!feof($fp)) {
$out .= fread($fp, 8192);
}
if ($close) {
fclose($fp);
}
return $out;
}
/**
* Scans a stream for the requested data.
*
* @param resource $fp A stream resource.
* @param string $type Either '8bit', 'binary', or 'preg'.
* @param mixed $data Any additional data needed to do the scan.
*
* @param boolean The result of the scan.
*/
protected function _scanStream($fp, $type, $data = null)
{
rewind($fp);
while (is_resource($fp) && !feof($fp)) {
$line = fread($fp, 8192);
switch ($type) {
case '8bit':
if (Horde_Mime::is8bit($line)) {
return true;
}
break;
case 'binary':
if (strpos($line, "\0") !== false) {
return true;
}
break;
case 'preg':
if (preg_match($data, $line)) {
return true;
}
break;
}
}
return false;
}
/**
* Attempts to build a Horde_Mime_Part object from message text.
* This function can be called statically via:
* $mime_part = Horde_Mime_Part::parseMessage();
*
* @param string $text The text of the MIME message.
* @param array $opts Additional options:
* - forcemime: (boolean) If true, the message data is assumed to be
* MIME data. If not, a MIME-Version header must exist (RFC
* 2045 [4]) to be parsed as a MIME message.
* DEFAULT: false
* - level: (integer) Current nesting level of the MIME data.
* DEFAULT: 0
* - no_body: (boolean) If true, don't set body contents of parts (since
* 2.2.0).
* DEFAULT: false
*
* @return Horde_Mime_Part A MIME Part object.
* @throws Horde_Mime_Exception
*/
static public function parseMessage($text, array $opts = array())
{
/* Mini-hack to get a blank Horde_Mime part so we can call
* replaceEOL(). Convert to EOL, since that is the expected EOL for
* use internally within a Horde_Mime_Part object. */
$part = new Horde_Mime_Part();
$rawtext = $part->replaceEOL($text, self::EOL);
/* Find the header. */
$hdr_pos = self::_findHeader($rawtext, self::EOL);
unset($opts['ctype']);
$ob = self::_getStructure(substr($rawtext, 0, $hdr_pos), substr($rawtext, $hdr_pos + 2), $opts);
$ob->buildMimeIds();
return $ob;
}
/**
* Creates a MIME object from the text of one part of a MIME message.
*
* @param string $header The header text.
* @param string $body The body text.
* @param array $opts Additional options:
*
* - ctype: (string) The default content-type.
* - forcemime: (boolean) If true, the message data is assumed to be
* MIME data. If not, a MIME-Version header must exist to
* be parsed as a MIME message.
* - level: (integer) Current nesting level.
* - no_body: (boolean) If true, don't set body contents of parts.
*
*
* @return Horde_Mime_Part The MIME part object.
*/
static protected function _getStructure($header, $body,
array $opts = array())
{
$opts = array_merge(array(
'ctype' => 'application/octet-stream',
'forcemime' => false,
'level' => 0,
'no_body' => false
), $opts);
/* Parse headers text into a Horde_Mime_Headers object. */
$hdrs = Horde_Mime_Headers::parseHeaders($header);
$ob = new Horde_Mime_Part();
/* This is not a MIME message. */
if (!$opts['forcemime'] && !$hdrs->getValue('mime-version')) {
$ob->setType('text/plain');
if (!$opts['no_body'] && !empty($body)) {
$ob->setContents($body);
}
return $ob;
}
/* Content type. */
if ($tmp = $hdrs->getValue('content-type', Horde_Mime_Headers::VALUE_BASE)) {
$ob->setType($tmp);
$ctype_params = $hdrs->getValue('content-type', Horde_Mime_Headers::VALUE_PARAMS);
foreach ($ctype_params as $key => $val) {
$ob->setContentTypeParameter($key, $val);
}
} else {
$ob->setType($opts['ctype']);
}
/* Content transfer encoding. */
if ($tmp = $hdrs->getValue('content-transfer-encoding')) {
$ob->setTransferEncoding($tmp);
}
/* Content-Description. */
if ($tmp = $hdrs->getValue('content-description')) {
$ob->setDescription($tmp);
}
/* Content-Disposition. */
if ($tmp = $hdrs->getValue('content-disposition', Horde_Mime_Headers::VALUE_BASE)) {
$ob->setDisposition($tmp);
foreach ($hdrs->getValue('content-disposition', Horde_Mime_Headers::VALUE_PARAMS) as $key => $val) {
$ob->setDispositionParameter($key, $val);
}
}
/* Content-Duration */
if ($tmp = $hdrs->getValue('content-duration')) {
$ob->setDuration($tmp);
}
/* Content-ID. */
if ($tmp = $hdrs->getValue('content-id')) {
$ob->setContentId($tmp);
}
if (!$opts['no_body'] &&
!empty($body) &&
($ob->getPrimaryType() != 'multipart')) {
$ob->setContents($body);
}
if (++$opts['level'] >= self::NESTING_LIMIT) {
return $ob;
}
/* Process subparts. */
switch ($ob->getPrimaryType()) {
case 'message':
if ($ob->getSubType() == 'rfc822') {
$ob->addPart(self::parseMessage($body, array('forcemime' => true)));
}
break;
case 'multipart':
$boundary = $ob->getContentTypeParameter('boundary');
if (!is_null($boundary)) {
foreach (self::_findBoundary($body, 0, $boundary) as $val) {
if (!isset($val['length'])) {
break;
}
$subpart = substr($body, $val['start'], $val['length']);
$hdr_pos = self::_findHeader($subpart, self::EOL);
$ob->addPart(self::_getStructure(substr($subpart, 0, $hdr_pos), substr($subpart, $hdr_pos + 2), array(
'ctype' => ($ob->getSubType() == 'digest') ? 'message/rfc822' : 'text/plain',
'forcemime' => true,
'level' => $opts['level'],
'no_body' => $opts['no_body']
)));
}
}
break;
}
return $ob;
}
/**
* Attempts to obtain the raw text of a MIME part.
* This function can be called statically via:
* $data = Horde_Mime_Part::getRawPartText();
*
* @param mixed $text The full text of the MIME message. The text is
* assumed to be MIME data (no MIME-Version checking
* is performed). It can be either a stream or a
* string.
* @param string $type Either 'header' or 'body'.
* @param string $id The MIME ID.
*
* @return string The raw text.
* @throws Horde_Mime_Exception
*/
static public function getRawPartText($text, $type, $id)
{
/* Mini-hack to get a blank Horde_Mime part so we can call
* replaceEOL(). From an API perspective, getRawPartText() should be
* static since it is not working on MIME part data. */
$part = new Horde_Mime_Part();
$rawtext = $part->replaceEOL($text, self::RFC_EOL);
/* We need to carry around the trailing "\n" because this is needed
* to correctly find the boundary string. */
$hdr_pos = self::_findHeader($rawtext, self::RFC_EOL);
$curr_pos = $hdr_pos + 3;
if ($id == 0) {
switch ($type) {
case 'body':
return substr($rawtext, $curr_pos + 1);
case 'header':
return trim(substr($rawtext, 0, $hdr_pos));
}
}
$hdr_ob = Horde_Mime_Headers::parseHeaders(trim(substr($rawtext, 0, $hdr_pos)));
/* If this is a message/rfc822, pass the body into the next loop.
* Don't decrement the ID here. */
if ($hdr_ob->getValue('Content-Type', Horde_Mime_Headers::VALUE_BASE) == 'message/rfc822') {
return self::getRawPartText(substr($rawtext, $curr_pos + 1), $type, $id);
}
$base_pos = strpos($id, '.');
$orig_id = $id;
if ($base_pos !== false) {
$base_pos = substr($id, 0, $base_pos);
$id = substr($id, $base_pos);
} else {
$base_pos = $id;
$id = 0;
}
$params = $hdr_ob->getValue('Content-Type', Horde_Mime_Headers::VALUE_PARAMS);
if (!isset($params['boundary'])) {
if ($orig_id == '1') {
return substr($rawtext, $curr_pos + 1);
}
throw new Horde_Mime_Exception('Could not find MIME part.');
}
$b_find = self::_findBoundary($rawtext, $curr_pos, $params['boundary'], $base_pos);
if (!isset($b_find[$base_pos])) {
throw new Horde_Mime_Exception('Could not find MIME part.');
}
return self::getRawPartText(substr($rawtext, $b_find[$base_pos]['start'], $b_find[$base_pos]['length'] - 1), $type, $id);
}
/**
* Find the location of the end of the header text.
*
* @param string $text The text to search.
* @param string $eol The EOL string.
*
* @return integer Header position.
*/
static protected function _findHeader($text, $eol)
{
$hdr_pos = strpos($text, $eol . $eol);
return ($hdr_pos === false)
? strlen($text)
: $hdr_pos;
}
/**
* Find the location of the next boundary string.
*
* @param string $text The text to search.
* @param integer $pos The current position in $text.
* @param string $boundary The boundary string.
* @param integer $end If set, return after matching this many
* boundaries.
*
* @return array Keys are the boundary number, values are an array with
* two elements: 'start' and 'length'.
*/
static protected function _findBoundary($text, $pos, $boundary,
$end = null)
{
$i = 0;
$out = array();
$search = "--" . $boundary;
$search_len = strlen($search);
while (($pos = strpos($text, $search, $pos)) !== false) {
/* Boundary needs to appear at beginning of string or right after
* a LF. */
if (($pos != 0) && ($text[$pos - 1] != "\n")) {
continue;
}
if (isset($out[$i])) {
$out[$i]['length'] = $pos - $out[$i]['start'] - 1;
}
if (!is_null($end) && ($end == $i)) {
break;
}
$pos += $search_len;
if (isset($text[$pos])) {
switch ($text[$pos]) {
case "\r":
$pos += 2;
$out[++$i] = array('start' => $pos);
break;
case "\n":
$out[++$i] = array('start' => ++$pos);
break;
case '-':
return $out;
}
}
}
return $out;
}
/* ArrayAccess methods. */
public function offsetExists($offset)
{
return ($this->getPart($offset) !== null);
}
public function offsetGet($offset)
{
return $this->getPart($offset);
}
public function offsetSet($offset, $value)
{
$this->alterPart($offset, $value);
}
public function offsetUnset($offset)
{
$this->removePart($offset);
}
/* Countable methods. */
/**
* Returns the number of message parts.
*
* @return integer Number of message parts.
*/
public function count()
{
return count($this->_parts);
}
/* Serializable methods. */
/**
* Serialization.
*
* @return string Serialized data.
*/
public function serialize()
{
$data = array(
// Serialized data ID.
self::VERSION
);
foreach ($this->_serializedVars as $val) {
switch ($val) {
case '_contentTypeParams':
$data[] = $this->$val->getArrayCopy();
break;
default:
$data[] = $this->$val;
break;
}
}
if (!empty($this->_contents)) {
$data[] = $this->_readStream($this->_contents);
}
return serialize($data);
}
/**
* Unserialization.
*
* @param string $data Serialized data.
*
* @throws Exception
*/
public function unserialize($data)
{
$data = @unserialize($data);
if (!is_array($data) ||
!isset($data[0]) ||
(array_shift($data) != self::VERSION)) {
throw new Exception('Cache version change');
}
$this->_init();
foreach ($this->_serializedVars as $key => $val) {
switch ($val) {
case '_contentTypeParams':
$this->$val = new Horde_Support_CaseInsensitiveArray($data[$key]);
break;
default:
$this->$val = $data[$key];
break;
}
}
// $key now contains the last index of _serializedVars.
if (isset($data[++$key])) {
$this->setContents($data[$key]);
}
}
}
Horde_Mime-2.2.8/lib/Horde/Mime/Related.php 0000644 0001750 0000764 00000010261 12243576212 020322 0 ustar slusarz slusarz
* @category Horde
* @license http://www.horde.org/licenses/lgpl21 LGPL 2.1
* @package Mime
*/
class Horde_Mime_Related implements IteratorAggregate
{
/**
* Content IDs.
*
* @var array
*/
protected $_cids = array();
/**
* Start ID.
*
* @var string
*/
protected $_start;
/**
* Constructor.
*
* @param Horde_Mime_Part $mime_part A MIME part object. Must be of
* type multipart/related.
*/
public function __construct(Horde_Mime_Part $mime_part)
{
if ($mime_part->getType() != 'multipart/related') {
throw new InvalidArgumentException('MIME part must be of type multipart/related');
}
$ids = array_keys($mime_part->contentTypeMap());
$related_id = $mime_part->getMimeId();
$id = null;
/* Build a list of parts -> CIDs. */
foreach ($ids as $val) {
if ((strcmp($related_id, $val) !== 0) &&
($cid = $mime_part->getPart($val)->getContentId())) {
$this->_cids[$val] = $cid;
}
}
/* Look at the 'start' parameter to determine which part to start
* with. If no 'start' parameter, use the first part (RFC 2387
* [3.1]). */
$start = $mime_part->getContentTypeParameter('start');
if (!empty($start)) {
$id = $this->cidSearch($start);
}
if (empty($id)) {
reset($ids);
$id = next($ids);
}
$this->_start = $id;
}
/**
* Return the start ID.
*
* @return string The start ID.
*/
public function startId()
{
return $this->_start;
}
/**
* Search for a CID in the related part.
*
* @param string $cid The CID to search for.
*
* @return string The MIME ID or false if not found.
*/
public function cidSearch($cid)
{
return array_search($cid, $this->_cids);
}
/**
* Scan for CID strings in HTML data and replace with data returned from
* a callback method.
*
* @param mixed $text The HTML text (can be Horde_Domhtml object).
* @param callback $callback Callback method. Receives three arguments:
* MIME ID, the attribute name containing the
* content ID, and the node object. Expects
* return value of URL to display the data.
* @param string $charset HTML data charset.
*
* @return Horde_Domhtml A Horde_Domhtml object.
*/
public function cidReplace($text, $callback, $charset = 'UTF-8')
{
$dom = ($text instanceof Horde_Domhtml)
? $text
: new Horde_Domhtml($text, $charset);
foreach ($dom as $node) {
if ($node instanceof DOMElement) {
switch (Horde_String::lower($node->tagName)) {
case 'body':
case 'td':
$this->_cidReplace($node, 'background', $callback);
break;
case 'img':
$this->_cidReplace($node, 'src', $callback);
break;
}
}
}
return $dom;
}
/**
*/
protected function _cidReplace($node, $attribute, $callback)
{
if ($node->hasAttribute($attribute)) {
$val = $node->getAttribute($attribute);
if ((strpos($val, 'cid:') === 0) &&
($id = $this->cidSearch(substr($val, 4)))) {
$node->setAttribute($attribute, call_user_func($callback, $id, $attribute, $node));
}
}
}
/* IteratorAggregate method. */
public function getIterator()
{
return new ArrayIterator($this->_cids);
}
}
Horde_Mime-2.2.8/lib/Horde/Mime/Translation.php 0000644 0001750 0000764 00000003551 12243576212 021244 0 ustar slusarz slusarz
* @category Mime
* @copyright 2010-2013 Horde LLC
* @license http://www.horde.org/licenses/lgpl21 LGPL 2.1
* @package Mime
*/
class Horde_Mime_Translation extends Horde_Translation
{
/**
* Returns the translation of a message.
*
* @var string $message The string to translate.
*
* @return string The string translation, or the original string if no
* translation exists.
*/
static public function t($message)
{
self::$_domain = 'Horde_Mime';
self::$_directory = '@data_dir@' == '@'.'data_dir'.'@' ? __DIR__ . '/../../../locale' : '@data_dir@/Horde_Mime/locale';
return parent::t($message);
}
/**
* Returns the plural translation of a message.
*
* @param string $singular The singular version to translate.
* @param string $plural The plural version to translate.
* @param integer $number The number that determines singular vs. plural.
*
* @return string The string translation, or the original string if no
* translation exists.
*/
static public function ngettext($singular, $plural, $number)
{
self::$_domain = 'Horde_Mime';
self::$_directory = '@data_dir@' == '@'.'data_dir'.'@' ? __DIR__ . '/../../../locale' : '@data_dir@/Horde_Mime/locale';
return parent::ngettext($singular, $plural, $number);
}
}
Horde_Mime-2.2.8/lib/Horde/Mime.php 0000644 0001750 0000764 00000060020 12243576212 016740 0 ustar slusarz slusarz
* Copyright (c) 2003-2006, PEAR
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or
* without modification, are permitted provided that the following
* conditions are met:
*
* - Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* - Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* - Neither the name of the authors, nor the names of its contributors
* may be used to endorse or promote products derived from this
* software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*
* -----
*
* This file contains code adapted from PEAR's PHP_Compat library (v1.6.0a3).
*
* http://pear.php.net/package/PHP_Compat
*
* This code appears in Horde_Mime::_uudecode().
*
* This code was originally released under the LGPL 2.1
*
* -----
*
* Copyright 1999-2013 Horde LLC (http://www.horde.org/)
*
* See the enclosed file COPYING for license information (LGPL). If you
* did not receive this file, see http://www.horde.org/licenses/lgpl21.
*
* @author Chuck Hagenbuch
* @author Michael Slusarz
* @category Horde
* @license http://www.horde.org/licenses/lgpl21 LGPL 2.1
* @package Mime
*/
class Horde_Mime
{
/**
* The RFC defined EOL string.
*
* @var string
*/
const EOL = "\r\n";
/**
* The list of characters required to be quoted in MIME parameters
* (regular expression).
*
* @since 2.1.0
*
* @var string
*/
const MIME_PARAM_QUOTED = '/[\x01-\x20\x22\x28\x29\x2c\x2f\x3a-\x40\x5b-\x5d]/';
/**
* Attempt to work around non RFC 2231-compliant MUAs by generating both
* a RFC 2047-like parameter name and also the correct RFC 2231
* parameter. See:
* http://lists.horde.org/archives/dev/Week-of-Mon-20040426/014240.html
*
* @var boolean
*/
static public $brokenRFC2231 = false;
/**
* Use windows-1252 charset when decoding ISO-8859-1 data?
*
* @var boolean
*/
static public $decodeWindows1252 = false;
/**
* Determines if a string contains 8-bit (non US-ASCII) characters.
*
* @param string $string The string to check.
* @param string $charset The charset of the string. Defaults to
* US-ASCII.
*
* @return boolean True if string contains non US-ASCII characters.
*/
static public function is8bit($string, $charset = null)
{
return ($string != Horde_String::convertCharset($string, $charset, 'US-ASCII'));
}
/**
* MIME encodes a string (RFC 2047).
*
* @param string $text The text to encode (UTF-8).
* @param string $charset The character set to encode to.
*
* @return string The MIME encoded string (US-ASCII).
*/
static public function encode($text, $charset = 'UTF-8')
{
/* The null character is valid US-ASCII, but was removed from the
* allowed e-mail header characters in RFC 2822. */
if (!self::is8bit($text, 'UTF-8') && (strpos($text, null) === false)) {
return $text;
}
$charset = Horde_String::lower($charset);
$text = Horde_String::convertCharset($text, 'UTF-8', $charset);
/* Get the list of elements in the string. */
$size = preg_match_all('/([^\s]+)([\s]*)/', $text, $matches, PREG_SET_ORDER);
$line = '';
/* Return if nothing needs to be encoded. */
foreach ($matches as $key => $val) {
if (self::is8bit($val[1], $charset)) {
if ((($key + 1) < $size) &&
self::is8bit($matches[$key + 1][1], $charset)) {
$line .= self::_encode($val[1] . $val[2], $charset) . ' ';
} else {
$line .= self::_encode($val[1], $charset) . $val[2];
}
} else {
$line .= $val[1] . $val[2];
}
}
return rtrim($line);
}
/**
* Internal helper function to MIME encode a string.
*
* @param string $text The text to encode.
* @param string $charset The character set of the text.
*
* @return string The MIME encoded text.
*/
static protected function _encode($text, $charset)
{
$encoded = trim(base64_encode($text));
$c_size = strlen($charset) + 7;
if ((strlen($encoded) + $c_size) > 75) {
$parts = explode(self::EOL, rtrim(chunk_split($encoded, intval((75 - $c_size) / 4) * 4)));
} else {
$parts[] = $encoded;
}
$p_size = count($parts);
$out = '';
foreach ($parts as $key => $val) {
$out .= '=?' . $charset . '?b?' . $val . '?=';
if ($p_size > $key + 1) {
/* RFC 2047 [2]: no encoded word can be more than 75
* characters long. If longer, you must split the word with
* CRLF SPACE. */
$out .= self::EOL . ' ';
}
}
return $out;
}
/**
* Encodes a line via quoted-printable encoding.
*
* @param string $text The text to encode (UTF-8).
* @param string $eol The EOL sequence to use.
* @param integer $wrap Wrap a line at this many characters.
*
* @return string The quoted-printable encoded string.
*/
static public function quotedPrintableEncode($text, $eol = self::EOL,
$wrap = 76)
{
$curr_length = 0;
$output = '';
/* We need to go character by character through the data. */
for ($i = 0, $length = strlen($text); $i < $length; ++$i) {
$char = $text[$i];
/* If we have reached the end of the line, reset counters. */
if ($char == "\n") {
$output .= $eol;
$curr_length = 0;
continue;
} elseif ($char == "\r") {
continue;
}
/* Spaces or tabs at the end of the line are NOT allowed. Also,
* ASCII characters below 32 or above 126 AND 61 must be
* encoded. */
$ascii = ord($char);
if ((($ascii === 32) &&
($i + 1 != $length) &&
(($text[$i + 1] == "\n") || ($text[$i + 1] == "\r"))) ||
(($ascii < 32) || ($ascii > 126) || ($ascii === 61))) {
$char_len = 3;
$char = '=' . Horde_String::upper(sprintf('%02s', dechex($ascii)));
} else {
$char_len = 1;
}
/* Lines must be $wrap characters or less. */
$curr_length += $char_len;
if ($curr_length > $wrap) {
$output .= '=' . $eol;
$curr_length = $char_len;
}
$output .= $char;
}
return $output;
}
/**
* Decodes a MIME encoded (RFC 2047) string.
*
* @param string $string The MIME encoded text.
*
* @return string The decoded text.
*/
static public function decode($string)
{
/* Take out any spaces between multiple encoded words. */
$string = preg_replace('|\?=\s+=\?|', '?==?', $string);
$out = '';
$old_pos = 0;
while (($pos = strpos($string, '=?', $old_pos)) !== false) {
/* Save any preceding text. */
$out .= substr($string, $old_pos, $pos - $old_pos);
/* Search for first delimiting question mark (charset). */
if (($d1 = strpos($string, '?', $pos + 2)) === false) {
break;
}
$orig_charset = substr($string, $pos + 2, $d1 - $pos - 2);
if (self::$decodeWindows1252 &&
(Horde_String::lower($orig_charset) == 'iso-8859-1')) {
$orig_charset = 'windows-1252';
}
/* Search for second delimiting question mark (encoding). */
if (($d2 = strpos($string, '?', $d1 + 1)) === false) {
break;
}
$encoding = substr($string, $d1 + 1, $d2 - $d1 - 1);
/* Search for end of encoded data. */
if (($end = strpos($string, '?=', $d2 + 1)) === false) {
break;
}
$encoded_text = substr($string, $d2 + 1, $end - $d2 - 1);
switch ($encoding) {
case 'Q':
case 'q':
$out .= Horde_String::convertCharset(
preg_replace_callback(
'/=([0-9a-f]{2})/i',
function($ord) {
return chr(hexdec($ord[1]));
},
str_replace('_', ' ', $encoded_text)),
$orig_charset,
'UTF-8'
);
break;
case 'B':
case 'b':
$out .= Horde_String::convertCharset(
base64_decode($encoded_text),
$orig_charset,
'UTF-8'
);
break;
default:
// Ignore unknown encoding.
break;
}
$old_pos = $end + 2;
}
return $out . substr($string, $old_pos);
}
/**
* Encodes a MIME parameter string pursuant to RFC 2183 & 2231
* (Content-Type and Content-Disposition headers).
*
* @param string $name The parameter name.
* @param string $val The parameter value (UTF-8).
* @param array $opts Additional options:
* - charset: (string) The charset to encode to.
* DEFAULT: UTF-8
* - lang: (string) The language to use when encoding.
* DEFAULT: None specified
*
* @return array The encoded parameter string (US-ASCII).
*/
static public function encodeParam($name, $val, array $opts = array())
{
$curr = 0;
$encode = $wrap = false;
$output = array();
$charset = isset($opts['charset'])
? $opts['charset']
: 'UTF-8';
// 2 = '=', ';'
$pre_len = strlen($name) + 2;
/* Several possibilities:
* - String is ASCII. Output as ASCII (duh).
* - Language information has been provided. We MUST encode output
* to include this information.
* - String is non-ASCII, but can losslessly translate to ASCII.
* Output as ASCII (most efficient).
* - String is in non-ASCII, but doesn't losslessly translate to
* ASCII. MUST encode output (duh). */
if (empty($opts['lang']) && !self::is8bit($val, 'UTF-8')) {
$string = $val;
} else {
$cval = Horde_String::convertCharset($val, 'UTF-8', $charset);
$string = Horde_String::lower($charset) . '\'' . (empty($opts['lang']) ? '' : Horde_String::lower($opts['lang'])) . '\'' . rawurlencode($cval);
$encode = true;
/* Account for trailing '*'. */
++$pre_len;
}
if (($pre_len + strlen($string)) > 75) {
/* Account for continuation '*'. */
++$pre_len;
$wrap = true;
while ($string) {
$chunk = 75 - $pre_len - strlen($curr);
$pos = min($chunk, strlen($string) - 1);
/* Don't split in the middle of an encoded char. */
if (($chunk == $pos) && ($pos > 2)) {
for ($i = 0; $i <= 2; ++$i) {
if ($string[$pos - $i] == '%') {
$pos -= $i + 1;
break;
}
}
}
$lines[] = substr($string, 0, $pos + 1);
$string = substr($string, $pos + 1);
++$curr;
}
} else {
$lines = array($string);
}
foreach ($lines as $i => $line) {
$output[$name . (($wrap) ? ('*' . $i) : '') . (($encode) ? '*' : '')] = $line;
}
if (self::$brokenRFC2231 && !isset($output[$name])) {
$output = array_merge(array(
$name => self::encode($val, $charset)
), $output);
}
/* Escape certain characters in params (See RFC 2045 [Appendix A]).
* Must be quoted-string if one of these exists.
* Forbidden: SPACE, CTLs, ()<>@,;:\"/[]?= */
foreach ($output as $k => $v) {
if (preg_match(self::MIME_PARAM_QUOTED, $v)) {
$output[$k] = '"' . addcslashes($v, '\\"') . '"';
}
}
return $output;
}
/**
* Decodes a MIME parameter string pursuant to RFC 2183 & 2231
* (Content-Type and Content-Disposition headers).
*
* @param string $type Either 'Content-Type' or 'Content-Disposition'
* (case-insensitive).
* @param mixed $data The text of the header or an array of param name
* => param values.
*
* @return array An array with the following entries (all strings in
* UTF-8):
* - params: (array) The header's parameter values.
* - val: (string) The header's "base" value.
*/
static public function decodeParam($type, $data)
{
$convert = array();
$ret = array('params' => array(), 'val' => '');
$splitRegex = '/([^;\'"]*[\'"]([^\'"]*([^\'"]*)*)[\'"][^;\'"]*|([^;]+))(;|$)/';
$type = Horde_String::lower($type);
if (is_array($data)) {
// Use dummy base values
$ret['val'] = ($type == 'content-type')
? 'text/plain'
: 'attachment';
$params = $data;
} else {
/* This code was adapted from PEAR's Mail_mimeDecode::. */
if (($pos = strpos($data, ';')) === false) {
$ret['val'] = trim($data);
return $ret;
}
$ret['val'] = trim(substr($data, 0, $pos));
$data = trim(substr($data, ++$pos));
$params = $tmp = array();
if (strlen($data) > 0) {
/* This splits on a semi-colon, if there's no preceeding
* backslash. */
preg_match_all($splitRegex, $data, $matches);
for ($i = 0, $cnt = count($matches[0]); $i < $cnt; ++$i) {
$param = $matches[0][$i];
while (substr($param, -2) == '\;') {
$param .= $matches[0][++$i];
}
$tmp[] = $param;
}
for ($i = 0, $cnt = count($tmp); $i < $cnt; ++$i) {
$pos = strpos($tmp[$i], '=');
$p_name = trim(substr($tmp[$i], 0, $pos), "'\";\t\\ ");
$p_val = trim(str_replace('\;', ';', substr($tmp[$i], $pos + 1)), "'\";\t\\ ");
if (strlen($p_val) && ($p_val[0] == '"')) {
$p_val = substr($p_val, 1, -1);
}
$params[$p_name] = $p_val;
}
}
/* End of code adapted from PEAR's Mail_mimeDecode::. */
}
/* Sort the params list. Prevents us from having to manually keep
* track of continuation values below. */
uksort($params, 'strnatcasecmp');
foreach ($params as $name => $val) {
/* Asterisk at end indicates encoded value. */
if (substr($name, -1) == '*') {
$name = substr($name, 0, -1);
$encode = true;
} else {
$encode = false;
}
/* This asterisk indicates continuation parameter. */
if (($pos = strrpos($name, '*')) !== false) {
$name = substr($name, 0, $pos);
}
if (!isset($ret['params'][$name]) ||
($encode && !isset($convert[$name]))) {
$ret['params'][$name] = '';
}
$ret['params'][$name] .= $val;
if ($encode) {
$convert[$name] = true;
}
}
foreach (array_keys($convert) as $name) {
$val = $ret['params'][$name];
$quote = strpos($val, "'");
$orig_charset = substr($val, 0, $quote);
if (self::$decodeWindows1252 &&
(Horde_String::lower($orig_charset) == 'iso-8859-1')) {
$orig_charset = 'windows-1252';
}
/* Ignore language. */
$quote = strpos($val, "'", $quote + 1);
substr($val, $quote + 1);
$ret['params'][$name] = Horde_String::convertCharset(urldecode(substr($val, $quote + 1)), $orig_charset, 'UTF-8');
}
/* MIME parameters are supposed to be encoded via RFC 2231, but many
* mailers do RFC 2045 encoding instead. However, if we see at least
* one RFC 2231 encoding, then assume the sending mailer knew what
* it was doing. */
if (empty($convert)) {
foreach (array_diff(array_keys($ret['params']), array_keys($convert)) as $name) {
$ret['params'][$name] = self::decode($ret['params'][$name]);
}
}
return $ret;
}
/**
* Generates a Message-ID string conforming to RFC 2822 [3.6.4] and the
* standards outlined in 'draft-ietf-usefor-message-id-01.txt'.
*
* @param string A message ID string.
*/
static public function generateMessageId()
{
return '<' . strval(new Horde_Support_Guid(array('prefix' => 'Horde'))) . '>';
}
/**
* Performs MIME ID "arithmetic" on a given ID.
*
* @param string $id The MIME ID string.
* @param string $action One of the following:
* - down: ID of child. Note: down will first traverse to "$id.0" if
* given an ID *NOT* of the form "$id.0". If given an ID of the
* form "$id.0", down will traverse to "$id.1". This behavior
* can be avoided if 'norfc822' option is set.
* - next: ID of next sibling.
* - prev: ID of previous sibling.
* - up: ID of parent. Note: up will first traverse to "$id.0" if
* given an ID *NOT* of the form "$id.0". If given an ID of the
* form "$id.0", down will traverse to "$id". This behavior can be
* avoided if 'norfc822' option is set.
* @param array $options Additional options:
* - count: (integer) How many levels to traverse.
* DEFAULT: 1
* - norfc822: (boolean) Don't traverse rfc822 sub-levels
* DEFAULT: false
*
* @return mixed The resulting ID string, or null if that ID can not
* exist.
*/
static public function mimeIdArithmetic($id, $action, $options = array())
{
$pos = strrpos($id, '.');
$end = ($pos === false) ? $id : substr($id, $pos + 1);
switch ($action) {
case 'down':
if ($end == '0') {
$id = ($pos === false) ? 1 : substr_replace($id, '1', $pos + 1);
} else {
$id .= empty($options['norfc822']) ? '.0' : '.1';
}
break;
case 'next':
++$end;
$id = ($pos === false) ? $end : substr_replace($id, $end, $pos + 1);
break;
case 'prev':
if (($end == '0') ||
(empty($options['norfc822']) && ($end == '1'))) {
$id = null;
} elseif ($pos === false) {
$id = --$end;
} else {
$id = substr_replace($id, --$end, $pos + 1);
}
break;
case 'up':
if ($pos === false) {
$id = ($end == '0') ? null : '0';
} elseif (!empty($options['norfc822']) || ($end == '0')) {
$id = substr($id, 0, $pos);
} else {
$id = substr_replace($id, '0', $pos + 1);
}
break;
}
return (!is_null($id) && !empty($options['count']) && --$options['count'])
? self::mimeIdArithmetic($id, $action, $options)
: $id;
}
/**
* Determines if a given MIME ID lives underneath a base ID.
*
* @param string $base The base MIME ID.
* @param string $id The MIME ID to query.
*
* @return boolean Whether $id lives underneath $base.
*/
static public function isChild($base, $id)
{
$base = (substr($base, -2) == '.0')
? substr($base, 0, -1)
: rtrim($base, '.') . '.';
return ((($base == 0) && ($id != 0)) ||
(strpos(strval($id), strval($base)) === 0));
}
/**
* Scans $input for uuencoded data and converts it to unencoded data.
*
* @param string $input The input data
*
* @return array A list of arrays, with each array corresponding to
* a file in the input and containing the following keys:
* - data: (string) Unencoded data.
* - name: (string) Filename.
* - perms: (string) Octal permissions.
*/
static public function uudecode($input)
{
$data = array();
/* Find all uuencoded sections. */
if (preg_match_all("/begin ([0-7]{3}) (.+)\r?\n(.+)\r?\nend/Us", $input, $matches, PREG_SET_ORDER)) {
reset($matches);
while (list(,$v) = each($matches)) {
$data[] = array(
'data' => self::_uudecode($v[3]),
'name' => $v[2],
'perm' => $v[1]
);
}
}
return $data;
}
/**
* PHP 5's built-in convert_uudecode() is broken. Need this wrapper.
*
* @param string $input UUencoded input.
*
* @return string Decoded string.
*/
static protected function _uudecode($input)
{
$decoded = '';
foreach (explode("\n", $input) as $line) {
$c = count($bytes = unpack('c*', substr(trim($line,"\r\n\t"), 1)));
while ($c % 4) {
$bytes[++$c] = 0;
}
foreach (array_chunk($bytes, 4) as $b) {
$b0 = ($b[0] == 0x60) ? 0 : $b[0] - 0x20;
$b1 = ($b[1] == 0x60) ? 0 : $b[1] - 0x20;
$b2 = ($b[2] == 0x60) ? 0 : $b[2] - 0x20;
$b3 = ($b[3] == 0x60) ? 0 : $b[3] - 0x20;
$b0 <<= 2;
$b0 |= ($b1 >> 4) & 0x03;
$b1 <<= 4;
$b1 |= ($b2 >> 2) & 0x0F;
$b2 <<= 6;
$b2 |= $b3 & 0x3F;
$decoded .= pack('c*', $b0, $b1, $b2);
}
}
return rtrim($decoded, "\0");
}
}
Horde_Mime-2.2.8/locale/ar/LC_MESSAGES/Horde_Mime.mo 0000644 0001750 0000764 00000000573 12243576212 021533 0 ustar slusarz slusarz $ , 8 A 9 Project-Id-Version: Horde_Mime
Report-Msgid-Bugs-To: dev@lists.horde.org
POT-Creation-Date: 2010-10-13 01:27+0200
PO-Revision-Date: 2010-10-13 01:27+0200
Last-Translator: Automatically generated
Language-Team: i18n@lists.horde.org
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Horde_Mime-2.2.8/locale/ar/LC_MESSAGES/Horde_Mime.po 0000644 0001750 0000764 00000003143 12243576212 021532 0 ustar slusarz slusarz # Arabic translations for Horde_Mime module.
# Copyright 2010-2013 Horde LLC (http://www.horde.org/)
# This file is distributed under the same license as the Horde_Mime module.
# Automatically generated, 2010.
#
msgid ""
msgstr ""
"Project-Id-Version: Horde_Mime\n"
"Report-Msgid-Bugs-To: dev@lists.horde.org\n"
"POT-Creation-Date: 2010-10-13 01:27+0200\n"
"PO-Revision-Date: 2010-10-13 01:27+0200\n"
"Last-Translator: Automatically generated\n"
"Language-Team: i18n@lists.horde.org\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: lib/Horde/Mime/Mdn.php:202
msgid "Disposition Notification"
msgstr ""
#: lib/Horde/Mime/Mail.php:460
msgid "HTML Version of Message"
msgstr ""
#: lib/Horde/Mime/Mail.php:404
#, php-format
msgid "Invalid character in e-mail address: %s."
msgstr ""
#: lib/Horde/Mime/Headers.php:519
msgid "List-Archive"
msgstr ""
#: lib/Horde/Mime/Headers.php:514
#, fuzzy
msgid "List-Help"
msgstr "قائمة عناوين المساعدة"
#: lib/Horde/Mime/Headers.php:521
msgid "List-Id"
msgstr ""
#: lib/Horde/Mime/Headers.php:517
msgid "List-Owner"
msgstr ""
#: lib/Horde/Mime/Headers.php:518
msgid "List-Post"
msgstr ""
#: lib/Horde/Mime/Headers.php:516
msgid "List-Subscribe"
msgstr ""
#: lib/Horde/Mime/Headers.php:515
msgid "List-Unsubscribe"
msgstr ""
#: lib/Horde/Mime/Mail.php:458
msgid "Plaintext Version of Message"
msgstr ""
#: lib/Horde/Mime/Mdn.php:213
#, php-format
msgid ""
"The message sent on %s to %s with subject \"%s\" has been displayed.\n"
"\n"
"This is no guarantee that the message has been read or understood."
msgstr ""
Horde_Mime-2.2.8/locale/bg/LC_MESSAGES/Horde_Mime.mo 0000644 0001750 0000764 00000000573 12243576212 021521 0 ustar slusarz slusarz $ , 8 A 9 Project-Id-Version: Horde_Mime
Report-Msgid-Bugs-To: dev@lists.horde.org
POT-Creation-Date: 2010-10-13 01:27+0200
PO-Revision-Date: 2010-10-13 01:27+0200
Last-Translator: Automatically generated
Language-Team: i18n@lists.horde.org
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Horde_Mime-2.2.8/locale/bg/LC_MESSAGES/Horde_Mime.po 0000644 0001750 0000764 00000003121 12243576212 021514 0 ustar slusarz slusarz # Bulgarian translations for Horde_Mime module.
# Copyright 2010-2013 Horde LLC (http://www.horde.org/)
# This file is distributed under the same license as the Horde_Mime module.
# Automatically generated, 2010.
#
msgid ""
msgstr ""
"Project-Id-Version: Horde_Mime\n"
"Report-Msgid-Bugs-To: dev@lists.horde.org\n"
"POT-Creation-Date: 2010-10-13 01:27+0200\n"
"PO-Revision-Date: 2010-10-13 01:27+0200\n"
"Last-Translator: Automatically generated\n"
"Language-Team: i18n@lists.horde.org\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: lib/Horde/Mime/Mdn.php:202
msgid "Disposition Notification"
msgstr ""
#: lib/Horde/Mime/Mail.php:460
msgid "HTML Version of Message"
msgstr ""
#: lib/Horde/Mime/Mail.php:404
#, php-format
msgid "Invalid character in e-mail address: %s."
msgstr ""
#: lib/Horde/Mime/Headers.php:519
msgid "List-Archive"
msgstr ""
#: lib/Horde/Mime/Headers.php:514
#, fuzzy
msgid "List-Help"
msgstr "Помощ теми"
#: lib/Horde/Mime/Headers.php:521
msgid "List-Id"
msgstr ""
#: lib/Horde/Mime/Headers.php:517
msgid "List-Owner"
msgstr ""
#: lib/Horde/Mime/Headers.php:518
msgid "List-Post"
msgstr ""
#: lib/Horde/Mime/Headers.php:516
msgid "List-Subscribe"
msgstr ""
#: lib/Horde/Mime/Headers.php:515
msgid "List-Unsubscribe"
msgstr ""
#: lib/Horde/Mime/Mail.php:458
msgid "Plaintext Version of Message"
msgstr ""
#: lib/Horde/Mime/Mdn.php:213
#, php-format
msgid ""
"The message sent on %s to %s with subject \"%s\" has been displayed.\n"
"\n"
"This is no guarantee that the message has been read or understood."
msgstr ""
Horde_Mime-2.2.8/locale/bs/LC_MESSAGES/Horde_Mime.mo 0000644 0001750 0000764 00000000573 12243576212 021535 0 ustar slusarz slusarz $ , 8 A 9 Project-Id-Version: Horde_Mime
Report-Msgid-Bugs-To: dev@lists.horde.org
POT-Creation-Date: 2010-10-13 01:27+0200
PO-Revision-Date: 2010-10-13 01:27+0200
Last-Translator: Automatically generated
Language-Team: i18n@lists.horde.org
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Horde_Mime-2.2.8/locale/bs/LC_MESSAGES/Horde_Mime.po 0000644 0001750 0000764 00000003324 12243576212 021535 0 ustar slusarz slusarz # Bosnian translations for Horde_Mime module.
# Copyright 2010-2013 Horde LLC (http://www.horde.org/)
# This file is distributed under the same license as the Horde_Mime module.
# Automatically generated, 2010.
#
msgid ""
msgstr ""
"Project-Id-Version: Horde_Mime\n"
"Report-Msgid-Bugs-To: dev@lists.horde.org\n"
"POT-Creation-Date: 2010-10-13 01:27+0200\n"
"PO-Revision-Date: 2010-10-13 01:27+0200\n"
"Last-Translator: Automatically generated\n"
"Language-Team: i18n@lists.horde.org\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: lib/Horde/Mime/Mdn.php:202
msgid "Disposition Notification"
msgstr ""
#: lib/Horde/Mime/Mail.php:460
msgid "HTML Version of Message"
msgstr ""
#: lib/Horde/Mime/Mail.php:404
#, fuzzy, php-format
msgid "Invalid character in e-mail address: %s."
msgstr "Nedozvoljena slova u email adresi."
#: lib/Horde/Mime/Headers.php:519
#, fuzzy
msgid "List-Archive"
msgstr "Sakrij neupisane"
#: lib/Horde/Mime/Headers.php:514
#, fuzzy
msgid "List-Help"
msgstr "Pomoć"
#: lib/Horde/Mime/Headers.php:521
#, fuzzy
msgid "List-Id"
msgstr "Pomoć"
#: lib/Horde/Mime/Headers.php:517
#, fuzzy
msgid "List-Owner"
msgstr "Pomoć"
#: lib/Horde/Mime/Headers.php:518
msgid "List-Post"
msgstr ""
#: lib/Horde/Mime/Headers.php:516
#, fuzzy
msgid "List-Subscribe"
msgstr "Sakrij neupisane"
#: lib/Horde/Mime/Headers.php:515
#, fuzzy
msgid "List-Unsubscribe"
msgstr "Sakrij neupisane"
#: lib/Horde/Mime/Mail.php:458
msgid "Plaintext Version of Message"
msgstr ""
#: lib/Horde/Mime/Mdn.php:213
#, php-format
msgid ""
"The message sent on %s to %s with subject \"%s\" has been displayed.\n"
"\n"
"This is no guarantee that the message has been read or understood."
msgstr ""
Horde_Mime-2.2.8/locale/ca/LC_MESSAGES/Horde_Mime.mo 0000644 0001750 0000764 00000001376 12243576212 021516 0 ustar slusarz slusarz d
$ . = A N
Disposition Notification List-Archive List-Help List-Id List-Owner List-Post List-Subscribe List-Unsubscribe Project-Id-Version: Horde_Mime
Report-Msgid-Bugs-To: dev@lists.horde.org
POT-Creation-Date: 2010-10-13 01:27+0200
PO-Revision-Date: 2010-10-13 01:27+0200
Last-Translator: Automatically generated
Language-Team: i18n@lists.horde.org
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Notificació de recepció List-Archive List-Help List-Id List-Owner List-Post List-Subscribe List-Unsubscribe Horde_Mime-2.2.8/locale/ca/LC_MESSAGES/Horde_Mime.po 0000644 0001750 0000764 00000003521 12243576212 021513 0 ustar slusarz slusarz # Catalan translations for Horde_Mime module.
# Copyright 2010-2013 Horde LLC (http://www.horde.org/)
# This file is distributed under the same license as the Horde_Mime module.
# Automatically generated, 2010.
#
msgid ""
msgstr ""
"Project-Id-Version: Horde_Mime\n"
"Report-Msgid-Bugs-To: dev@lists.horde.org\n"
"POT-Creation-Date: 2010-10-13 01:27+0200\n"
"PO-Revision-Date: 2010-10-13 01:27+0200\n"
"Last-Translator: Automatically generated\n"
"Language-Team: i18n@lists.horde.org\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: lib/Horde/Mime/Mdn.php:202
msgid "Disposition Notification"
msgstr "Notificació de recepció"
#: lib/Horde/Mime/Mail.php:460
msgid "HTML Version of Message"
msgstr ""
#: lib/Horde/Mime/Mail.php:404
#, fuzzy, php-format
msgid "Invalid character in e-mail address: %s."
msgstr "L'adreça de destinació no és vàlida."
#: lib/Horde/Mime/Headers.php:519
msgid "List-Archive"
msgstr "List-Archive"
#: lib/Horde/Mime/Headers.php:514
msgid "List-Help"
msgstr "List-Help"
#: lib/Horde/Mime/Headers.php:521
msgid "List-Id"
msgstr "List-Id"
#: lib/Horde/Mime/Headers.php:517
msgid "List-Owner"
msgstr "List-Owner"
#: lib/Horde/Mime/Headers.php:518
msgid "List-Post"
msgstr "List-Post"
#: lib/Horde/Mime/Headers.php:516
msgid "List-Subscribe"
msgstr "List-Subscribe"
#: lib/Horde/Mime/Headers.php:515
msgid "List-Unsubscribe"
msgstr "List-Unsubscribe"
#: lib/Horde/Mime/Mail.php:458
msgid "Plaintext Version of Message"
msgstr ""
#: lib/Horde/Mime/Mdn.php:213
#, fuzzy, php-format
msgid ""
"The message sent on %s to %s with subject \"%s\" has been displayed.\n"
"\n"
"This is no guarantee that the message has been read or understood."
msgstr ""
"S'ha mostrat el missatge enviat el %s a %s amb l'assumpte \"%s\". Això no "
"garanteix que s'hagi llegit o entès el missatge."
Horde_Mime-2.2.8/locale/cs/LC_MESSAGES/Horde_Mime.mo 0000644 0001750 0000764 00000001547 12243576212 021540 0 ustar slusarz slusarz d
$ . = N
+ = S Disposition Notification List-Archive List-Help List-Id List-Owner List-Post List-Subscribe List-Unsubscribe Project-Id-Version: Horde_Mime
Report-Msgid-Bugs-To: dev@lists.horde.org
POT-Creation-Date: 2010-10-13 01:27+0200
PO-Revision-Date: 2010-10-13 01:27+0200
Last-Translator: Automatically generated
Language-Team: i18n@lists.horde.org
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;
Dispoziční upozornění Seznam-Archiv Seznam-Nápověda Seznam-Id Seznam-Vlastník Seznam-Odeslání Seznam-Přihlášení Seznam-Odhlášení Horde_Mime-2.2.8/locale/cs/LC_MESSAGES/Horde_Mime.po 0000644 0001750 0000764 00000003711 12243576212 021536 0 ustar slusarz slusarz # Czech translations for Horde_Mime module.
# Copyright 2010-2013 Horde LLC (http://www.horde.org/)
# This file is distributed under the same license as the Horde_Mime module.
# Automatically generated, 2010.
#
msgid ""
msgstr ""
"Project-Id-Version: Horde_Mime\n"
"Report-Msgid-Bugs-To: dev@lists.horde.org\n"
"POT-Creation-Date: 2010-10-13 01:27+0200\n"
"PO-Revision-Date: 2010-10-13 01:27+0200\n"
"Last-Translator: Automatically generated\n"
"Language-Team: i18n@lists.horde.org\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n"
#: lib/Horde/Mime/Mdn.php:202
msgid "Disposition Notification"
msgstr "Dispoziční upozornění"
#: lib/Horde/Mime/Mail.php:460
msgid "HTML Version of Message"
msgstr ""
#: lib/Horde/Mime/Mail.php:404
#, fuzzy, php-format
msgid "Invalid character in e-mail address: %s."
msgstr "Neplatná adresa příjemce."
#: lib/Horde/Mime/Headers.php:519
msgid "List-Archive"
msgstr "Seznam-Archiv"
#: lib/Horde/Mime/Headers.php:514
msgid "List-Help"
msgstr "Seznam-Nápověda"
#: lib/Horde/Mime/Headers.php:521
msgid "List-Id"
msgstr "Seznam-Id"
#: lib/Horde/Mime/Headers.php:517
msgid "List-Owner"
msgstr "Seznam-Vlastník"
#: lib/Horde/Mime/Headers.php:518
msgid "List-Post"
msgstr "Seznam-Odeslání"
#: lib/Horde/Mime/Headers.php:516
msgid "List-Subscribe"
msgstr "Seznam-Přihlášení"
#: lib/Horde/Mime/Headers.php:515
msgid "List-Unsubscribe"
msgstr "Seznam-Odhlášení"
#: lib/Horde/Mime/Mail.php:458
msgid "Plaintext Version of Message"
msgstr ""
#: lib/Horde/Mime/Mdn.php:213
#, fuzzy, php-format
msgid ""
"The message sent on %s to %s with subject \"%s\" has been displayed.\n"
"\n"
"This is no guarantee that the message has been read or understood."
msgstr ""
"Zpráva zaslaná v %s k %s s předmětem \"%s\" byla zobrazena.\n"
"Toto nezaručuje, že zpráva byla přečtena nebo že jí adresát(ka) rozuměl(a)."
Horde_Mime-2.2.8/locale/da/LC_MESSAGES/Horde_Mime.mo 0000644 0001750 0000764 00000001444 12243576212 021513 0 ustar slusarz slusarz d
$ . = l N
Disposition Notification List-Archive List-Help List-Id List-Owner List-Post List-Subscribe List-Unsubscribe Project-Id-Version: Horde_Mime
Report-Msgid-Bugs-To: dev@lists.horde.org
POT-Creation-Date: 2010-10-13 01:27+0200
PO-Revision-Date: 2010-10-13 01:27+0200
Last-Translator: Automatically generated
Language-Team: i18n@lists.horde.org
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Plural-Forms: nplurals=2; plural=(n != 1);
Overdragelsesnotits Liste-Archive List-Help List-Id List-Owner List-Post List-Subscribe List-Unsubscribe Horde_Mime-2.2.8/locale/da/LC_MESSAGES/Horde_Mime.po 0000644 0001750 0000764 00000003611 12243576212 021514 0 ustar slusarz slusarz # Danish translations for Horde_Mime module.
# Copyright 2010-2013 Horde LLC (http://www.horde.org/)
# This file is distributed under the same license as the Horde_Mime module.
# Automatically generated, 2010.
#
msgid ""
msgstr ""
"Project-Id-Version: Horde_Mime\n"
"Report-Msgid-Bugs-To: dev@lists.horde.org\n"
"POT-Creation-Date: 2010-10-13 01:27+0200\n"
"PO-Revision-Date: 2010-10-13 01:27+0200\n"
"Last-Translator: Automatically generated\n"
"Language-Team: i18n@lists.horde.org\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: lib/Horde/Mime/Mdn.php:202
msgid "Disposition Notification"
msgstr "Overdragelsesnotits"
#: lib/Horde/Mime/Mail.php:460
msgid "HTML Version of Message"
msgstr ""
#: lib/Horde/Mime/Mail.php:404
#, fuzzy, php-format
msgid "Invalid character in e-mail address: %s."
msgstr "Ugyldig destination."
#: lib/Horde/Mime/Headers.php:519
msgid "List-Archive"
msgstr "Liste-Archive"
#: lib/Horde/Mime/Headers.php:514
msgid "List-Help"
msgstr "List-Help"
#: lib/Horde/Mime/Headers.php:521
msgid "List-Id"
msgstr "List-Id"
#: lib/Horde/Mime/Headers.php:517
msgid "List-Owner"
msgstr "List-Owner"
#: lib/Horde/Mime/Headers.php:518
msgid "List-Post"
msgstr "List-Post"
#: lib/Horde/Mime/Headers.php:516
msgid "List-Subscribe"
msgstr "List-Subscribe"
#: lib/Horde/Mime/Headers.php:515
msgid "List-Unsubscribe"
msgstr "List-Unsubscribe"
#: lib/Horde/Mime/Mail.php:458
msgid "Plaintext Version of Message"
msgstr ""
#: lib/Horde/Mime/Mdn.php:213
#, fuzzy, php-format
msgid ""
"The message sent on %s to %s with subject \"%s\" has been displayed.\n"
"\n"
"This is no guarantee that the message has been read or understood."
msgstr ""
"Beskeden, som er sendt den %s til %s med emnet \"%s\" er blevet vist.\n"
"Dette er ingen garanti for, at beskeden rent faktisk er blevet læst eller "
"forstået."
Horde_Mime-2.2.8/locale/de/LC_MESSAGES/Horde_Mime.mo 0000644 0001750 0000764 00000002435 12243576212 021520 0 ustar slusarz slusarz | ! : R _ i
q | w J
' 6 G X r
Disposition Notification HTML Version of Message List-Archive List-Help List-Id List-Owner List-Post List-Subscribe List-Unsubscribe Plaintext Version of Message The message sent on %s to %s with subject "%s" has been displayed.
This is no guarantee that the message has been read or understood. Project-Id-Version: Horde_Mime
Report-Msgid-Bugs-To: dev@lists.horde.org
POT-Creation-Date: 2013-10-29 10:13+0100
PO-Revision-Date: 2010-10-13 01:27+0200
Last-Translator: Automatically generated
Language-Team: i18n@lists.horde.org
Language:
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Plural-Forms: nplurals=2; plural=(n != 1);
Empfangsbestätigung HTML-Version der Nachricht Listen-Archiv Listen-Hilfe Listen-Id Listen-Besitzer Listen-Adresse Listen-Anmeldung Listen-Abmeldung Textversion der Nachricht Die Nachricht mit dem Betreff "%3$s", die am %1$s an %2$s geschickt wurde, ist angezeigt worden.
Das heißt nicht, dass die Nachricht auch gelesen oder verstanden wurde. Horde_Mime-2.2.8/locale/de/LC_MESSAGES/Horde_Mime.po 0000644 0001750 0000764 00000003547 12243576212 021530 0 ustar slusarz slusarz # German translations for Horde_Mime module.
# Copyright 2010-2013 Horde LLC (http://www.horde.org/)
# This file is distributed under the same license as the Horde_Mime module.
# Automatically generated, 2010.
#
msgid ""
msgstr ""
"Project-Id-Version: Horde_Mime\n"
"Report-Msgid-Bugs-To: dev@lists.horde.org\n"
"POT-Creation-Date: 2013-10-29 10:13+0100\n"
"PO-Revision-Date: 2010-10-13 01:27+0200\n"
"Last-Translator: Automatically generated\n"
"Language-Team: i18n@lists.horde.org\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: lib/Horde/Mime/Mdn.php:188
msgid "Disposition Notification"
msgstr "Empfangsbestätigung"
#: lib/Horde/Mime/Mail.php:421
msgid "HTML Version of Message"
msgstr "HTML-Version der Nachricht"
#: lib/Horde/Mime/Headers.php:542
msgid "List-Archive"
msgstr "Listen-Archiv"
#: lib/Horde/Mime/Headers.php:537
msgid "List-Help"
msgstr "Listen-Hilfe"
#: lib/Horde/Mime/Headers.php:544
msgid "List-Id"
msgstr "Listen-Id"
#: lib/Horde/Mime/Headers.php:540
msgid "List-Owner"
msgstr "Listen-Besitzer"
#: lib/Horde/Mime/Headers.php:541
msgid "List-Post"
msgstr "Listen-Adresse"
#: lib/Horde/Mime/Headers.php:539
msgid "List-Subscribe"
msgstr "Listen-Anmeldung"
#: lib/Horde/Mime/Headers.php:538
msgid "List-Unsubscribe"
msgstr "Listen-Abmeldung"
#: lib/Horde/Mime/Mail.php:419
msgid "Plaintext Version of Message"
msgstr "Textversion der Nachricht"
#: lib/Horde/Mime/Mdn.php:200
#, php-format
msgid ""
"The message sent on %s to %s with subject \"%s\" has been displayed.\n"
"\n"
"This is no guarantee that the message has been read or understood."
msgstr ""
"Die Nachricht mit dem Betreff \"%3$s\", die am %1$s an %2$s geschickt wurde, "
"ist angezeigt worden.\n"
"\n"
"Das heißt nicht, dass die Nachricht auch gelesen oder verstanden wurde."
Horde_Mime-2.2.8/locale/el/LC_MESSAGES/Horde_Mime.mo 0000644 0001750 0000764 00000000773 12243576212 021533 0 ustar slusarz slusarz , <