From 0ec7cf62d8d8330464979c249459abacb6b5533f Mon Sep 17 00:00:00 2001
From: Jared Hancock <jared@osticket.com>
Date: Mon, 20 Jul 2015 13:40:33 -0500
Subject: [PATCH] tnef: Fix clobbered message when an IMAP message has a TNEF
 attachment

This fixes an issue where, when the mailfetch subsystem fetches more than
one email and one of them has a TNEF attachment; each message body after the
TNEF message will use the TNEF message body.

This patch fixes the issue by clearing the TNEF body in each cycle through
the message fetching and parsing loop.
---
 include/class.mailfetch.php | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/class.mailfetch.php b/include/class.mailfetch.php
index c20c426fc..024f80ce5 100644
--- a/include/class.mailfetch.php
+++ b/include/class.mailfetch.php
@@ -604,6 +604,7 @@ class MailFetcher {
     function createTicket($mid) {
         global $ost;
 
+        unset($this->tnef);
         if(!($mailinfo = $this->getHeaderInfo($mid)))
             return false;
 
-- 
GitLab