summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/MailmanMessage.php17
-rw-r--r--src/MessageTest.php (renamed from src/EmailMessage.php)12
2 files changed, 21 insertions, 8 deletions
diff --git a/src/MailmanMessage.php b/src/MailmanMessage.php
new file mode 100644
index 0000000..c284a8e
--- /dev/null
+++ b/src/MailmanMessage.php
@@ -0,0 +1,17 @@
+<?php
+
+require_once(__DIR__ . '/EmailMessage.php');
+
+class MailmanMessage extends EmailMessage {
+ public function __construct($input) {
+ parent::__construct($input);
+ }
+
+ public function getSource() {
+ return self::parse_addr(
+ substr_replace($this->msg->headers['list-post'], '', 1, 7)
+ );
+ }
+}
+
+?>
diff --git a/src/EmailMessage.php b/src/MessageTest.php
index d6ff762..ce04cf6 100644
--- a/src/EmailMessage.php
+++ b/src/MessageTest.php
@@ -5,26 +5,22 @@ require_once('Mail/RFC822.php');
require_once('Message.php');
-class EMailMessage implements Message {
+abstract class EmailMessage implements Message {
protected $msg;
public function __construct($input) {
- $this->msg = EMailMessage::decode_raw_message($input);
+ $this->msg = self::decode_raw_message($input);
}
- public function getSource() {
-# FIXME: fill in!
- return null;
- }
+ public abstract function getSource();
public function getPostId() {
-# FIXME: get from message-id to post-id database
return null;
}
public function getFrom() {
- return EMailMessage::parse_addr($this->msg->headers['from']);
+ return self::parse_addr($this->msg->headers['from']);
}
public function getSubject() {