Пример #1
0
 /**
  * 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;
 }
Пример #2
0
 /**
  */
 public function rewind()
 {
     $this->_stream->rewind();
     $this->_current = false;
     $this->_key = -1;
     $this->_level = 0;
 }
Пример #3
0
 /**
  */
 public function rewind()
 {
     $this->_data->rewind();
     $this->_current = $this->_key = null;
     $this->next();
 }
Пример #4
0
 /**
  * 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);
     }
 }