Skip to content
Snippets Groups Projects
Commit 0ae0dab1 authored by Till Brehm's avatar Till Brehm
Browse files

Merge branch 'stable-3.1' into 'stable-3.1'

Fix #4332 (password reset empty From address)



See merge request !515
parents 30ead37e ed38518a
No related branches found
No related tags found
No related merge requests found
...@@ -85,6 +85,7 @@ if(isset($_POST['username']) && $_POST['username'] != '' && $_POST['email'] != ' ...@@ -85,6 +85,7 @@ if(isset($_POST['username']) && $_POST['username'] != '' && $_POST['email'] != '
if(isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] != '443') $server_domain .= ':' . $_SERVER['SERVER_PORT']; if(isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] != '443') $server_domain .= ':' . $_SERVER['SERVER_PORT'];
$app->uses('getconf,ispcmail'); $app->uses('getconf,ispcmail');
$server_config_array = $app->getconf->get_global_config();
$mail_config = $server_config_array['mail']; $mail_config = $server_config_array['mail'];
if($mail_config['smtp_enabled'] == 'y') { if($mail_config['smtp_enabled'] == 'y') {
$mail_config['use_smtp'] = true; $mail_config['use_smtp'] = true;
......
...@@ -79,6 +79,8 @@ class postfix_filter_plugin { ...@@ -79,6 +79,8 @@ class postfix_filter_plugin {
global $app, $conf; global $app, $conf;
$type = $data["new"]["type"]; $type = $data["new"]["type"];
$restart = false;
if($type != '') { if($type != '') {
$sql = "SELECT * FROM mail_content_filter WHERE server_id = ? AND type = ? AND active = 'y'"; $sql = "SELECT * FROM mail_content_filter WHERE server_id = ? AND type = ? AND active = 'y'";
$rules = $app->db->queryAllRecords($sql, $conf["server_id"], $type); $rules = $app->db->queryAllRecords($sql, $conf["server_id"], $type);
...@@ -91,21 +93,25 @@ class postfix_filter_plugin { ...@@ -91,21 +93,25 @@ class postfix_filter_plugin {
if($type == 'header') { if($type == 'header') {
file_put_contents('/etc/postfix/header_checks', $content); file_put_contents('/etc/postfix/header_checks', $content);
$app->log("Writing /etc/postfix/header_checks", LOGLEVEL_DEBUG); $app->log("Writing /etc/postfix/header_checks", LOGLEVEL_DEBUG);
$restart = true;
} }
if($type == 'mime_header') { if($type == 'mime_header') {
file_put_contents('/etc/postfix/mime_header_checks', $content); file_put_contents('/etc/postfix/mime_header_checks', $content);
$app->log("Writing /etc/postfix/mime_header_checks", LOGLEVEL_DEBUG); $app->log("Writing /etc/postfix/mime_header_checks", LOGLEVEL_DEBUG);
$restart = true;
} }
if($type == 'nested_header') { if($type == 'nested_header') {
file_put_contents('/etc/postfix/nested_header_checks', $content); file_put_contents('/etc/postfix/nested_header_checks', $content);
$app->log("Writing /etc/postfix/nested_header_checks", LOGLEVEL_DEBUG); $app->log("Writing /etc/postfix/nested_header_checks", LOGLEVEL_DEBUG);
$restart = true;
} }
if($type == 'body') { if($type == 'body') {
file_put_contents('/etc/postfix/body_checks', $content); file_put_contents('/etc/postfix/body_checks', $content);
$app->log("Writing /etc/postfix/body_checks", LOGLEVEL_DEBUG); $app->log("Writing /etc/postfix/body_checks", LOGLEVEL_DEBUG);
$restart = true;
} }
} }
...@@ -122,23 +128,28 @@ class postfix_filter_plugin { ...@@ -122,23 +128,28 @@ class postfix_filter_plugin {
if($type == 'header') { if($type == 'header') {
file_put_contents('/etc/postfix/header_checks', $content); file_put_contents('/etc/postfix/header_checks', $content);
$app->log("Writing /etc/postfix/header_checks", LOGLEVEL_DEBUG); $app->log("Writing /etc/postfix/header_checks", LOGLEVEL_DEBUG);
$restart = true;
} }
if($type == 'mime_header') { if($type == 'mime_header') {
file_put_contents('/etc/postfix/mime_header_checks', $content); file_put_contents('/etc/postfix/mime_header_checks', $content);
$app->log("Writing /etc/postfix/mime_header_checks", LOGLEVEL_DEBUG); $app->log("Writing /etc/postfix/mime_header_checks", LOGLEVEL_DEBUG);
$restart = true;
} }
if($type == 'nested_header') { if($type == 'nested_header') {
file_put_contents('/etc/postfix/nested_header_checks', $content); file_put_contents('/etc/postfix/nested_header_checks', $content);
$app->log("Writing /etc/postfix/nested_header_checks", LOGLEVEL_DEBUG); $app->log("Writing /etc/postfix/nested_header_checks", LOGLEVEL_DEBUG);
$restart = true;
} }
if($type == 'body') { if($type == 'body') {
file_put_contents('/etc/postfix/body_checks', $content); file_put_contents('/etc/postfix/body_checks', $content);
$app->log("Writing /etc/postfix/body_checks", LOGLEVEL_DEBUG); $app->log("Writing /etc/postfix/body_checks", LOGLEVEL_DEBUG);
$restart = true;
} }
} }
if($restart) exec('postfix reload');
} }
function delete($event_name, $data) { function delete($event_name, $data) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment