Skip to content

Commit 729a3e5

Browse files
committed
also suppress sendmail-wrapper-php syslog messages on blocked accounts
1 parent a84c8a3 commit 729a3e5

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

app/SendmailWrapper.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?php
22
require_once 'StdinMailParser.php';
33
require_once 'ConfigLoader.php';
4+
require_once 'SendmailThrottle.php';
45

56
/**
67
* Sendmail Wrapper by Onlime GmbH webhosting services
@@ -34,7 +35,7 @@ public function __construct()
3435
*/
3536
public function run()
3637
{
37-
$status = 0;
38+
$status = SendmailThrottle::STATUS_OK;
3839

3940
// get config variables
4041
$sendmailCmd = $this->_conf->wrapper->sendmailCmd;
@@ -126,10 +127,14 @@ public function run()
126127
$messageInfo['script'],
127128
$status
128129
);
129-
syslog(LOG_INFO, $syslogMsg);
130+
// Don't write to syslog for blocked useraccounts - we still have all meta information in messages
131+
// table but don't want to fill up syslog.
132+
if ($status != SendmailThrottle::STATUS_BLOCKED) {
133+
syslog(LOG_INFO, $syslogMsg);
134+
}
130135

131136
// terminate if message limit exceeded
132-
if ($throttleOn && $status > 0) {
137+
if ($throttleOn && $status > SendmailThrottle::STATUS_OK) {
133138
// return exit status
134139
return $status;
135140
}

0 commit comments

Comments
 (0)