summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoruckelman <uckelman@nomic.net>2010-12-16 21:20:06 +0000
committeruckelman <uckelman@nomic.net>2010-12-16 21:20:06 +0000
commitab59861576dc2e9f94f305c485d0db71e78ecb48 (patch)
tree24b73b03486fef584d8813cdbb6bbee9bac58a5a /src
parent4ce5e6dc86f2c7f1052687f1cf73012c7578964f (diff)
In-Reply-To headers are not always just a message id, try to parse out the message id.
git-svn-id: https://vassalengine.svn.sourceforge.net/svnroot/vassalengine/site-src/trunk@7575 67b53d14-2c14-4ace-a08f-0dab2b34000c
Diffstat (limited to 'src')
-rw-r--r--src/EmailMessage.php12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/EmailMessage.php b/src/EmailMessage.php
index 6cfa0a5..73716e0 100644
--- a/src/EmailMessage.php
+++ b/src/EmailMessage.php
@@ -79,7 +79,17 @@ abstract class EmailMessage implements Message {
}
public function getInReplyTo() {
- return $this->getHeader('in-reply-to');
+ $irt = $this->getHeader('in-reply-to');
+
+ // Try to get a message id from the In-Reply-To header
+ foreach (mailparse_rfc822_parse_addresses($irt) as $part) {
+ if (isset($part['address']) && strlen($part['address']) > 0) {
+ return '<' . $part['address'] . '>';
+ }
+ }
+
+ // Ack, no message id, just return the raw header
+ return $irt;
}
public function getReferences() {