From 41336c5f3546db383788319f4a5e325202f904ee Mon Sep 17 00:00:00 2001 From: stekkel Date: Wed, 1 May 2002 10:57:52 +0000 Subject: [PATCH] Moved get message_id and reply_id to smtp.php because it's insane to get this information for all messages by default what was the case in sqimap_get_small_header_list. git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@2784 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- functions/smtp.php | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/functions/smtp.php b/functions/smtp.php index 56ca9393..ffa3d43f 100644 --- a/functions/smtp.php +++ b/functions/smtp.php @@ -818,15 +818,32 @@ function sendMessage($t, $c, $b, $subject, $body, $reply_id, $MDN, * The References header should really be the old Referenced header * with the message ID appended, and now it is (jmunro) */ - $hdr = sqimap_get_small_header ($imap_stream, $reply_id, false); - if(strlen($hdr->message_id) > 2) { + $sid = sqimap_session_id(); + $query = "$sid FETCH $reply_id (BODY.PEEK[HEADER.FIELDS (Message-Id In-Reply-To)])\r\n"; + fputs ($imap_stream, $query); + $read_list = sqimap_read_data_list($imap_stream, $sid, true, $response, $message); + $message_id = ''; + $in_reply_to = ''; + foreach ($read_list as $read) { + foreach ($read as $r) { + if (preg_match("/^message-id:(.*)/iA", $r, $regs)) { + $message_id = trim($regs[1]); + } + if (preg_match("/^in-reply-to:(.*)/iA", $r, $regs)) { + $in_reply_to = trim($regs[1]); + } + } + } + + if(strlen($message_id) > 2) { $refs = get_reference_header ($imap_stream, $reply_id); - $inreplyto = $hdr->message_id; - $old_reply_to = $hdr->inrepto; + $inreplyto = $message_id; + $old_reply_to = $in_reply_to; $refer = calculate_references ($refs, $inreplyto, $old_reply_to); $more_headers['In-Reply-To'] = $inreplyto; $more_headers['References'] = $refer; } + } if ($default_use_priority) { $more_headers = array_merge($more_headers, createPriorityHeaders($prio)); -- 2.25.1