From ab59861576dc2e9f94f305c485d0db71e78ecb48 Mon Sep 17 00:00:00 2001 From: uckelman Date: Thu, 16 Dec 2010 21:20:06 +0000 Subject: 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 --- src/EmailMessage.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) 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() { -- cgit v1.2.3