From: Michael M Slusarz Date: Fri, 6 Aug 2010 21:19:39 +0000 (-0600) Subject: Fix determination of reply_type for logging purposes. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=b2d5e2ba306dbea0c0fd75156932c6cee3143728;p=horde.git Fix determination of reply_type for logging purposes. --- diff --git a/imp/lib/Compose.php b/imp/lib/Compose.php index d66f6afef..493912079 100644 --- a/imp/lib/Compose.php +++ b/imp/lib/Compose.php @@ -580,33 +580,37 @@ class IMP_Compose $sentmail = $GLOBALS['injector']->getInstance('IMP_Sentmail'); /* Send the messages out now. */ + if (!($reply_type = $this->getMetadata('reply_type'))) { + $reply_type = 'new'; + } + foreach ($send_msgs as $val) { try { $this->sendMessage($val['to'], $headers, $val['msg']); } catch (IMP_Compose_Exception $e) { /* Unsuccessful send. */ Horde::logMessage($e, 'ERR'); - $sentmail->log($this->getMetadata('reply_type') || 'new', $headers->getValue('message-id'), $val['recipients'], false); + $sentmail->log($reply_type, $headers->getValue('message-id'), $val['recipients'], false); throw new IMP_Compose_Exception(sprintf(_("There was an error sending your message: %s"), $e->getMessage())); } /* Store history information. */ - $sentmail->log($this->getMetadata('reply_type') || 'new', $headers->getValue('message-id'), $val['recipients'], true); + $sentmail->log($reply_type, $headers->getValue('message-id'), $val['recipients'], true); } $sent_saved = true; - if ($this->getMetadata('reply_type')) { + if ($reply_type != 'new') { /* Log the reply. */ if ($this->getMetadata('in_reply_to') && !empty($conf['maillog']['use_maillog'])) { - IMP_Maillog::log($this->getMetadata('reply_type'), $this->getMetadata('in_reply_to'), $recipients); + IMP_Maillog::log($reply_type, $this->getMetadata('in_reply_to'), $recipients); } $imp_message = $GLOBALS['injector']->getInstance('IMP_Message'); $reply_uid = new IMP_Indices($this); - switch ($this->getMetadata('reply_type')) { + switch ($reply_type) { case 'forward': /* Set the '$Forwarded' flag, if possible, in the mailbox. * See RFC 5550 [5.9] */