Skip to content

Commit

Permalink
Log the recipient info, if able.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrubinsk committed Jan 23, 2014
1 parent 0162821 commit ea259cf
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
7 changes: 7 additions & 0 deletions framework/Core/lib/Horde/Core/ActiveSync/Connector.php
Expand Up @@ -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.
*
Expand Down
16 changes: 16 additions & 0 deletions framework/Core/lib/Horde/Core/ActiveSync/Driver.php
Expand Up @@ -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;
}

Expand Down

0 comments on commit ea259cf

Please sign in to comment.