diff options
author | uckelman <uckelman@nomic.net> | 2010-03-21 14:48:06 +0000 |
---|---|---|
committer | uckelman <uckelman@nomic.net> | 2010-03-21 14:48:06 +0000 |
commit | 1b1bd4936c1df0a9a1248697065e39e6f589bbdd (patch) | |
tree | b4f9c1f50bb05cf95a424a6aad14ec2018fef68b | |
parent | ae81cd8aa125bcbe573644d2f4ef0e1a3e2b9352 (diff) |
Stray file.
git-svn-id: https://vassalengine.svn.sourceforge.net/svnroot/vassalengine/site-src/trunk@6624 67b53d14-2c14-4ace-a08f-0dab2b34000c
-rw-r--r-- | src/MessageTest.php | 69 |
1 files changed, 0 insertions, 69 deletions
diff --git a/src/MessageTest.php b/src/MessageTest.php deleted file mode 100644 index ce04cf6..0000000 --- a/src/MessageTest.php +++ /dev/null @@ -1,69 +0,0 @@ -<?php - -require_once('Mail/mimeDecode.php'); -require_once('Mail/RFC822.php'); - -require_once('Message.php'); - -abstract class EmailMessage implements Message { - - protected $msg; - - public function __construct($input) { - $this->msg = self::decode_raw_message($input); - } - - public abstract function getSource(); - - public function getPostId() { - return null; - } - - public function getFrom() { - return self::parse_addr($this->msg->headers['from']); - } - - public function getSubject() { - return $this->msg->headers['subject']; - } - - public function getMessageId() { - return $this->msg->headers['message-id']; - } - - public function getInReplyTo() { - return $this->msg->headers['in-reply-to']; - } - - public function getReferences() { - return $this->msg->headers['references']; - } - - public function getBody() { - return $this->msg->body; - } - - protected static function decode_raw_message($input) { - $params['include_bodies'] = true; - $params['decode_bodies'] = true; - $params['decode_headers'] = true; - $params['input'] = $input; - $params['crlf'] = "\r\n"; - - $msg = Mail_mimeDecode::decode($params); - - if (count($msg->headers) == 1 && array_key_exists(null, $msg->headers)) { - # An empty message has one null header. - trigger_error('No message', E_USER_ERROR); - } - - return $msg; - } - - protected static function parse_addr($s) { - $addr = Mail_RFC822::parseAddressList($s); - return strtolower($addr[0]->mailbox . '@' . $addr[0]->host); - } -} - -?> |