diff --git a/framework/Core/lib/Horde/Core/ActiveSync/Connector.php b/framework/Core/lib/Horde/Core/ActiveSync/Connector.php index 44e1f0bf8b5..db4381c2e27 100644 --- a/framework/Core/lib/Horde/Core/ActiveSync/Connector.php +++ b/framework/Core/lib/Horde/Core/ActiveSync/Connector.php @@ -856,6 +856,13 @@ public function mail_logMaillog($action, $mid, $recipients = null) } } + public function mail_logRecipient($action, $recipients, $message_id) + { + if ($this->_registry->hasMethod('logRecipient', $this->_registry->hasInterface('mail'))) { + $this->_registry->mail->logRecipient($action, $recipients, $message_id); + } + } + /** * Poll the maillog for changes since the specified timestamp. * diff --git a/framework/Core/lib/Horde/Core/ActiveSync/Driver.php b/framework/Core/lib/Horde/Core/ActiveSync/Driver.php index b6e3252ef38..589d66406fe 100644 --- a/framework/Core/lib/Horde/Core/ActiveSync/Driver.php +++ b/framework/Core/lib/Horde/Core/ActiveSync/Driver.php @@ -2046,6 +2046,22 @@ public function sendMail( } } + // Attempt to log the recipient. + $this->_logger->info('Logging recipients for RI.'); + if (!empty($reply)) { + $action = 'reply'; + } elseif (!empty($forward)) { + $action = 'forward'; + } else { + $action = 'new'; + } + try { + $this->_connector->mail_logRecipient( + $action, $headers->getValue('To'), $headers->getValue('Message-ID')); + } catch (Horde_Exception $e) { + $this->_logger->err($e->getMessage()); + } + return true; }