Commit ed38518a authored by Florian Schaal's avatar Florian Schaal
Browse files

postfix-filter requieres postfix reload

parent 2813e94e
......@@ -79,6 +79,8 @@ class postfix_filter_plugin {
global $app, $conf;
$type = $data["new"]["type"];
$restart = false;
if($type != '') {
$sql = "SELECT * FROM mail_content_filter WHERE server_id = ? AND type = ? AND active = 'y'";
$rules = $app->db->queryAllRecords($sql, $conf["server_id"], $type);
......@@ -91,21 +93,25 @@ class postfix_filter_plugin {
if($type == 'header') {
file_put_contents('/etc/postfix/header_checks', $content);
$app->log("Writing /etc/postfix/header_checks", LOGLEVEL_DEBUG);
$restart = true;
}
if($type == 'mime_header') {
file_put_contents('/etc/postfix/mime_header_checks', $content);
$app->log("Writing /etc/postfix/mime_header_checks", LOGLEVEL_DEBUG);
$restart = true;
}
if($type == 'nested_header') {
file_put_contents('/etc/postfix/nested_header_checks', $content);
$app->log("Writing /etc/postfix/nested_header_checks", LOGLEVEL_DEBUG);
$restart = true;
}
if($type == 'body') {
file_put_contents('/etc/postfix/body_checks', $content);
$app->log("Writing /etc/postfix/body_checks", LOGLEVEL_DEBUG);
$restart = true;
}
}
......@@ -122,23 +128,28 @@ class postfix_filter_plugin {
if($type == 'header') {
file_put_contents('/etc/postfix/header_checks', $content);
$app->log("Writing /etc/postfix/header_checks", LOGLEVEL_DEBUG);
$restart = true;
}
if($type == 'mime_header') {
file_put_contents('/etc/postfix/mime_header_checks', $content);
$app->log("Writing /etc/postfix/mime_header_checks", LOGLEVEL_DEBUG);
$restart = true;
}
if($type == 'nested_header') {
file_put_contents('/etc/postfix/nested_header_checks', $content);
$app->log("Writing /etc/postfix/nested_header_checks", LOGLEVEL_DEBUG);
$restart = true;
}
if($type == 'body') {
file_put_contents('/etc/postfix/body_checks', $content);
$app->log("Writing /etc/postfix/body_checks", LOGLEVEL_DEBUG);
$restart = true;
}
}
if($restart) exec('postfix reload');
}
function delete($event_name, $data) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment