From 146e94160f919a5b7aaf610cfab50b9d79d8a995 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Thu, 11 Nov 2021 08:30:15 +0100 Subject: [PATCH] check we have an email to send the mdn to (otherwise Horde_Mime_Mdn throws a RuntimeException) --- api/src/Mail.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/api/src/Mail.php b/api/src/Mail.php index 5642fba221..ca33c011f4 100644 --- a/api/src/Mail.php +++ b/api/src/Mail.php @@ -7405,6 +7405,12 @@ class Mail if (self::$debug) error_log(__METHOD__.__LINE__.array2string($identity)); $headers = $this->getMessageHeader($uid, '', 'object', true, $_folder); + // check we have an email to send the mdn to (otherwise Horde_Mime_Mdn throws a RuntimeException) + if (empty($mdn_to = $headers[strtoupper('Disposition-Notification-To')]) || strpos($mdn_to, '@') === false) + { + return false; + } + // Override Horde's translation with our own Horde_Translation::setHandler('Horde_Mime', new Horde_Translation_Handler_Gettext('Horde_Mime', EGW_SERVER_ROOT.'/api/lang/locale')); Preferences::setlocale();