Skip to content

Commit

Permalink
[mms] Only count successful compose mails when determining recipient …
Browse files Browse the repository at this point in the history
…limits (Bug #13751).

Conflicts:
	imp/docs/CHANGES
	imp/package.xml
  • Loading branch information
slusarz committed Dec 20, 2014
1 parent 4069237 commit be99255
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 2 deletions.
8 changes: 8 additions & 0 deletions imp/docs/CHANGES
Expand Up @@ -44,6 +44,14 @@ v7.0.0-git
(Request #13227).


------
v6.2.5
------

[mms] Only count successful compose mails when determining recipient limits
(Bug #13751).


------
v6.2.4
------
Expand Down
1 change: 1 addition & 0 deletions imp/lib/Sentmail/Mongo.php
Expand Up @@ -145,6 +145,7 @@ public function favouriteRecipients($limit, $filter = null)
public function numberOfRecipients($hours, $user = false)
{
$query = array(
self::SUCCESS => 1,
self::TS => array(
'$gt' => (time() - ($hours * 3600))
)
Expand Down
7 changes: 5 additions & 2 deletions imp/lib/Sentmail/Sql.php
Expand Up @@ -103,8 +103,11 @@ public function favouriteRecipients($limit, $filter = null)
public function numberOfRecipients($hours, $user = false)
{
/* Build the SQL query. */
$query = sprintf('SELECT COUNT(*) FROM %s WHERE sentmail_ts > ?',
$this->_params['table']);
$query = sprintf(
'SELECT COUNT(*) FROM %s WHERE sentmail_ts > ? AND sentmail_success = 1',
$this->_params['table']
);

if ($user) {
$query .= sprintf(' AND sentmail_who = %s', $this->_db->quote($GLOBALS['registry']->getAuth()));
}
Expand Down
13 changes: 13 additions & 0 deletions imp/package.xml
Expand Up @@ -3699,5 +3699,18 @@
* [mjr] Ensure we have a valid MIME part to display in thread view (Bug #13653).
</notes>
</release>
<release>
<version>
<release>6.2.5</release>
<api>6.2.0</api></version>
<stability>
<release>stable</release>
<api>stable</api></stability>
<date>2014-12-03</date>
<license uri="http://www.horde.org/licenses/gpl">GPL-2.0</license>
<notes>
* [mms] Only count successful compose mails when determining recipient limits (Bug #13751).
</notes>
</release>
</changelog>
</package>

0 comments on commit be99255

Please sign in to comment.