check we have an email to send the mdn to (otherwise Horde_Mime_Mdn throws a RuntimeException)

This commit is contained in:
Ralf Becker 2021-11-11 08:30:15 +01:00
parent c221253a82
commit 146e94160f

View File

@ -7405,6 +7405,12 @@ class Mail
if (self::$debug) error_log(__METHOD__.__LINE__.array2string($identity)); if (self::$debug) error_log(__METHOD__.__LINE__.array2string($identity));
$headers = $this->getMessageHeader($uid, '', 'object', true, $_folder); $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 // 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')); Horde_Translation::setHandler('Horde_Mime', new Horde_Translation_Handler_Gettext('Horde_Mime', EGW_SERVER_ROOT.'/api/lang/locale'));
Preferences::setlocale(); Preferences::setlocale();