/** * Return a Mime object representing the entire message. * * @return Horde_Mime_Part The Mime object. */ public function getMimeObject() { $this->_stream->rewind(); $part = Horde_Mime_Part::parseMessage($this->_stream->getString()); $part->isBasePart(true); return $part; }
/** */ public function rewind() { $this->_stream->rewind(); $this->_current = false; $this->_key = -1; $this->_level = 0; }
/** */ public function rewind() { $this->_data->rewind(); $this->_current = $this->_key = null; $this->next(); }
/** * Sends a redirect (a/k/a resent) message. * * @param Horde_Stream $message Message content. * * @throws Horde_Spam_Exception */ protected function _redirectMessage(Horde_Stream $message) { /* Split up headers and message. */ $message->rewind(); $eol = $message->getEOL(); $headers = $message->getToChar($eol . $eol); if (!strlen($headers)) { throw new Horde_Spam_Exception('Invalid message reported, header not found'); } $body = fopen('php://temp', 'r+'); stream_copy_to_stream($message->stream, $body, -1, $message->pos()); /* We need to set the Return-Path header to the sending user - see RFC * 2821 [4.4]. */ $headers = preg_replace('/return-path:.*?(\\r?\\n)/i', 'Return-Path: <' . $this->_from_addr . '>$1', $headers); try { $this->_mail->send($this->_email, array('_raw' => $headers, 'from' => $this->_from_addr), $body); } catch (Horde_Mail_Exception $e) { $this->_logger->warn($e); throw new Horde_Spam_Exception($e); } }