From 9fac205c49808a9b8c6722ab440797713c01a93b Mon Sep 17 00:00:00 2001 From: Jeff Standen Date: Fri, 31 Jan 2025 18:16:48 -0800 Subject: [PATCH] 11.0.4: * [Mail/Routing] Fixed a bug in mail routing when an automation or bot behavior overrode the `In-Reply-To:` or `References:` headers. In certain conditions, this didn't remove the inherited group/bucket from the previous parent ticket. As a result, Routing KATA or legacy mail routing rules didn't re-route the message as expected. --- api/app/Parser.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/api/app/Parser.php b/api/app/Parser.php index 5728ea3745..bcb69edfa1 100644 --- a/api/app/Parser.php +++ b/api/app/Parser.php @@ -320,6 +320,12 @@ private function _parseHeadersIsNew() { $senderWorker = $this->getSenderWorkerModel(); + // Reset the parent ticket and routing when we start + $this->_is_new = true; + $this->_message_id = 0; + $this->setTicketModel(null); + $this->setRouteGroup(null); + $aReferences = []; // Append first <*> from In-Reply-To @@ -423,11 +429,6 @@ private function _parseHeadersIsNew() { } } } - - $this->_is_new = true; - $this->_ticket_id = 0; - $this->_ticket_model = null; - $this->_message_id = 0; } public function getRecipients() : array {