@@ -26,12 +26,12 @@ |
||
| 26 | 26 | if ( preg_match ('/^X-DSPAM-Result:\s+(?P<user>[\w\.\-\_\+\%\@]+);\s+result="(?P<result>\w+)";\s+class="(?P<class>\w+)";\s+probability=(?P<prob>[\d\.]+);\s+confidence=(?P<conf>[\d\.]+);\s+signature=(?P<sig>[\w\,]+)$/',$out[0],$received) != 1) { |
| 27 | 27 | $err = 'DSPAM Client returned an unparseable result.'; |
| 28 | 28 | syslog(LOG_ERR, $username.': Learn Error: '.$err); |
| 29 | - exit (sprintf('<p>%s</p>',htmlentities($err))); |
|
| 29 | + exit (sprintf('<p>%s</p>',htmlentities($err))); |
|
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | printf('<p>Message learned successfully with following result:</p><ul><li>Owner: <b>%s</b></li><li>Result: <b>%s</b></li><li>Class: <b>%s</b></li></ul>', |
| 33 | 33 | htmlentities($received['user']), |
| 34 | - $received['result'], $received['class']); |
|
| 34 | + $received['result'], $received['class']); |
|
| 35 | 35 | closelog(); |
| 36 | 36 | ?> |
| 37 | 37 | </div> |
@@ -1,7 +1,7 @@ discard block |
||
| 1 | 1 | <div id="content"> |
| 2 | 2 | <h3>Log</h3> |
| 3 | 3 | <?php |
| 4 | -$path='/var/www/html/RBL/'; |
|
| 4 | +$path = '/var/www/html/RBL/'; |
|
| 5 | 5 | require_once($path.'function.php'); |
| 6 | 6 | require_once($path.'config.php'); |
| 7 | 7 | $conf = parse_ini_file('imap.conf', TRUE); |
@@ -16,17 +16,17 @@ discard block |
||
| 16 | 16 | |
| 17 | 17 | syslog(LOG_INFO, sprintf('%s: Learn as <%s> on signature: <%s>', $username, $par->class, $par->learn)); |
| 18 | 18 | $cmd = escapeshellcmd($_POST['cmd']); |
| 19 | -exec ( $cmd, $out, $ret ); |
|
| 19 | +exec($cmd, $out, $ret); |
|
| 20 | 20 | if ($ret != 0) { |
| 21 | 21 | $err = 'DSPAM Client returns a bad exit state. Sorry, probably the learn was successful, but I don\'t know...'; |
| 22 | 22 | syslog(LOG_ERR, $username.': Learn Error: '.$err); |
| 23 | - exit (sprintf('<p>%s</p>',htmlentities($err))); |
|
| 23 | + exit (sprintf('<p>%s</p>', htmlentities($err))); |
|
| 24 | 24 | } |
| 25 | -syslog(LOG_INFO, sprintf('%s: Learn result: "%s"',$username, $out[0])); |
|
| 26 | -if ( preg_match ('/^X-DSPAM-Result:\s+(?P<user>[\w\.\-\_\+\%\@]+);\s+result="(?P<result>\w+)";\s+class="(?P<class>\w+)";\s+probability=(?P<prob>[\d\.]+);\s+confidence=(?P<conf>[\d\.]+);\s+signature=(?P<sig>[\w\,]+)$/',$out[0],$received) != 1) { |
|
| 25 | +syslog(LOG_INFO, sprintf('%s: Learn result: "%s"', $username, $out[0])); |
|
| 26 | +if (preg_match('/^X-DSPAM-Result:\s+(?P<user>[\w\.\-\_\+\%\@]+);\s+result="(?P<result>\w+)";\s+class="(?P<class>\w+)";\s+probability=(?P<prob>[\d\.]+);\s+confidence=(?P<conf>[\d\.]+);\s+signature=(?P<sig>[\w\,]+)$/', $out[0], $received) != 1) { |
|
| 27 | 27 | $err = 'DSPAM Client returned an unparseable result.'; |
| 28 | 28 | syslog(LOG_ERR, $username.': Learn Error: '.$err); |
| 29 | - exit (sprintf('<p>%s</p>',htmlentities($err))); |
|
| 29 | + exit (sprintf('<p>%s</p>', htmlentities($err))); |
|
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | printf('<p>Message learned successfully with following result:</p><ul><li>Owner: <b>%s</b></li><li>Result: <b>%s</b></li><li>Class: <b>%s</b></li></ul>', |