From 6dce805221fbcd81b64fd7fe16c4cda26caee147 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Thu, 24 Jan 2019 10:03:13 +0100 Subject: [PATCH] Improve last fix so it also remove temp file if Mail_Mime returned an error --- program/include/rcmail_sendmail.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/program/include/rcmail_sendmail.php b/program/include/rcmail_sendmail.php index c6a09c0b4..0b9df0f77 100644 --- a/program/include/rcmail_sendmail.php +++ b/program/include/rcmail_sendmail.php @@ -469,12 +469,11 @@ class rcmail_sendmail $msg = $message->mailbody_file; } else { - $mailbody_file = rcube_utils::temp_filename('msg'); - $msg = $message->saveMessageBody($mailbody_file); + $message->mailbody_file = rcube_utils::temp_filename('msg'); + $msg = $message->saveMessageBody($message->mailbody_file); if (!is_a($msg, 'PEAR_Error')) { - $msg = $mailbody_file; - $message->mailbody_file = $mailbody_file; + $msg = $message->mailbody_file; } } }