diff --git a/install/patches/upd_0088.php b/install/patches/upd_0088.php new file mode 100644 index 0000000000000000000000000000000000000000..47a10f6080436ea840b1096bbe8d9722ba99d79e --- /dev/null +++ b/install/patches/upd_0088.php @@ -0,0 +1,47 @@ +simple_query('Delete obsolete file ' . $file . '?', array('y', 'n', 'a', 'all', 'none'), 'y'); + if($answer == 'n') continue; + elseif($answer == 'a' || $answer == 'all') $del_all = true; + elseif($answer == 'none') break; + } + if(@is_file('/usr/local/ispconfig/' . $file) && !@is_file($curpath . '/' . $file)) { + // be sure this is not a file contained in installation! + @unlink('/usr/local/ispconfig/' . $file); + ilog('Deleted obsolete file /usr/local/ispconfig/' . $file); + $c++; + } + } + ilog($c . 'obsolete files deleted.'); + } +} + +?> diff --git a/interface/web/mail/form/spamfilter_policy.tform.php b/interface/web/mail/form/spamfilter_policy.tform.php index d6ecef9bbc42ef55bee22ce309c5a4b364697189..2205dbb6512a2669526bc5719f0c13ce52646d1c 100644 --- a/interface/web/mail/form/spamfilter_policy.tform.php +++ b/interface/web/mail/form/spamfilter_policy.tform.php @@ -87,6 +87,21 @@ $form["tabs"]['policy'] = array ( 'default' => 'N', 'value' => array('N' => 'No', 'Y' => 'Yes') ), + //################################# + // ENDE Datatable fields + //################################# + ) +); + + +$form["tabs"]['amavis'] = array ( + 'title' => "Amavis", + 'width' => 100, + 'template' => "templates/spamfilter_amavis_edit.htm", + 'fields' => array ( + //################################# + // Begin Datatable fields + //################################# 'banned_files_lover' => array ( 'datatype' => 'VARCHAR', 'formtype' => 'SELECT', @@ -117,21 +132,6 @@ $form["tabs"]['policy'] = array ( 'default' => 'N', 'value' => array('N' => 'No', 'Y' => 'Yes') ), - //################################# - // ENDE Datatable fields - //################################# - ) -); - - -$form["tabs"]['quarantine'] = array ( - 'title' => "Quarantine", - 'width' => 100, - 'template' => "templates/spamfilter_quarantine_edit.htm", - 'fields' => array ( - //################################# - // Begin Datatable fields - //################################# 'virus_quarantine_to' => array ( 'datatype' => 'VARCHAR', 'formtype' => 'TEXT', @@ -216,20 +216,6 @@ $form["tabs"]['quarantine'] = array ( 'width' => '30', 'maxlength' => '255' ), - //################################# - // ENDE Datatable fields - //################################# - ) -); - -$form["tabs"]['taglevel'] = array ( - 'title' => "Tag-Level", - 'width' => 100, - 'template' => "templates/spamfilter_taglevel_edit.htm", - 'fields' => array ( - //################################# - // Begin Datatable fields - //################################# 'spam_tag_level' => array ( 'datatype' => 'DOUBLE', 'formtype' => 'TEXT', @@ -304,57 +290,6 @@ $form["tabs"]['taglevel'] = array ( 'width' => '30', 'maxlength' => '255' ), - 'rspamd_greylisting' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'CHECKBOX', - 'default' => 'y', - 'value' => array(0 => 'n', 1 => 'y') - ), - 'rspamd_spam_greylisting_level' => array ( - 'datatype' => 'DOUBLE', - 'formtype' => 'TEXT', - 'default' => '0', - 'value' => '', - 'width' => '10', - 'maxlength' => '255' - ), - 'rspamd_spam_tag_level' => array ( - 'datatype' => 'DOUBLE', - 'formtype' => 'TEXT', - 'default' => '0', - 'value' => '', - 'width' => '10', - 'maxlength' => '255' - ), - 'rspamd_spam_tag_method' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'SELECT', - 'default' => 'rewrite_subject', - 'value' => array('add_header' => $app->lng('add_header_txt'), 'rewrite_subject' => $app->lng('rewrite_subject_txt')) - ), - 'rspamd_spam_kill_level' => array ( - 'datatype' => 'DOUBLE', - 'formtype' => 'TEXT', - 'default' => '0', - 'value' => '', - 'width' => '10', - 'maxlength' => '255' - ), - //################################# - // ENDE Datatable fields - //################################# - ) -); - - -$form["tabs"]['other'] = array ( - 'title' => "Other", - 'width' => 100, - 'template' => "templates/spamfilter_other_edit.htm", - 'fields' => array ( - //################################# - // Begin Datatable fields - //################################# 'addr_extension_virus' => array ( 'datatype' => 'VARCHAR', 'formtype' => 'TEXT', @@ -522,11 +457,58 @@ $form["tabs"]['other'] = array ( 'width' => '30', 'maxlength' => '255' ), - //################################# // ENDE Datatable fields //################################# ) ); -?> +$form["tabs"]['rspamd'] = array ( + 'title' => "Rspamd", + 'width' => 100, + 'template' => "templates/spamfilter_rspamd_edit.htm", + 'fields' => array ( + //################################# + // Begin Datatable fields + //################################# + 'rspamd_greylisting' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'CHECKBOX', + 'default' => 'y', + 'value' => array(0 => 'n', 1 => 'y') + ), + 'rspamd_spam_greylisting_level' => array ( + 'datatype' => 'DOUBLE', + 'formtype' => 'TEXT', + 'default' => '0', + 'value' => '', + 'width' => '10', + 'maxlength' => '255' + ), + 'rspamd_spam_tag_level' => array ( + 'datatype' => 'DOUBLE', + 'formtype' => 'TEXT', + 'default' => '0', + 'value' => '', + 'width' => '10', + 'maxlength' => '255' + ), + 'rspamd_spam_tag_method' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'SELECT', + 'default' => 'rewrite_subject', + 'value' => array('add_header' => $app->lng('add_header_txt'), 'rewrite_subject' => $app->lng('rewrite_subject_txt')) + ), + 'rspamd_spam_kill_level' => array ( + 'datatype' => 'DOUBLE', + 'formtype' => 'TEXT', + 'default' => '0', + 'value' => '', + 'width' => '10', + 'maxlength' => '255' + ), + //################################# + // ENDE Datatable fields + //################################# + ) +); diff --git a/interface/web/mail/lib/lang/en_spamfilter_policy.lng b/interface/web/mail/lib/lang/en_spamfilter_policy.lng index f9e8a8e30387eeabbee9d84d60df590056943c7a..af1aac5d7f6d3172de2d07e1b215a25d173b01b3 100644 --- a/interface/web/mail/lib/lang/en_spamfilter_policy.lng +++ b/interface/web/mail/lib/lang/en_spamfilter_policy.lng @@ -42,4 +42,10 @@ $wb['rspamd_spam_tag_method_txt'] = 'SPAM tag method'; $wb['rspamd_spam_kill_level_txt'] = 'SPAM reject level'; $wb['btn_save_txt'] = 'Save'; $wb['btn_cancel_txt'] = 'Cancel'; -?> \ No newline at end of file + +$wb['amavis_settings_txt'] = 'Settings'; +$wb['amavis_taglevel_txt'] = 'Tag-Level'; +$wb['amavis_quarantine_txt'] = 'Quarantine'; +$wb['amavis_other_txt'] = 'Other'; +$wb['add_header_txt'] = 'Add header'; +$wb['rewrite_subject_txt'] = 'Rewrite subject'; \ No newline at end of file diff --git a/interface/web/mail/spamfilter_policy_edit.php b/interface/web/mail/spamfilter_policy_edit.php index 55a42fe8471338b9aaa10897956587f4b4367cd9..ffc0818ffa59950318b569abb75f9a313256e6c5 100644 --- a/interface/web/mail/spamfilter_policy_edit.php +++ b/interface/web/mail/spamfilter_policy_edit.php @@ -49,48 +49,9 @@ $app->uses('tpl,tform,tform_actions'); $app->load('tform_actions'); class page_action extends tform_actions { - - function onShow() { - global $app, $conf; - - // get the config - $app->uses('getconf'); - $mail_config = $app->getconf->get_server_config($conf['server_id'], 'mail'); - - $content_filter = 'amavisd'; - if($mail_config['content_filter'] == 'rspamd'){ - $content_filter = 'rspamd'; - unset($app->tform->formDef["tabs"]["policy"]['fields']['banned_files_lover']); - unset($app->tform->formDef["tabs"]["policy"]['fields']['bad_header_lover']); - unset($app->tform->formDef["tabs"]["policy"]['fields']['bypass_virus_checks']); - unset($app->tform->formDef["tabs"]["policy"]['fields']['bypass_banned_checks']); - unset($app->tform->formDef["tabs"]["policy"]['fields']['bypass_header_checks']); - - unset($app->tform->formDef["tabs"]["taglevel"]['fields']['spam_tag_level']); - unset($app->tform->formDef["tabs"]["taglevel"]['fields']['spam_tag2_level']); - unset($app->tform->formDef["tabs"]["taglevel"]['fields']['spam_kill_level']); - unset($app->tform->formDef["tabs"]["taglevel"]['fields']['spam_dsn_cutoff_level']); - unset($app->tform->formDef["tabs"]["taglevel"]['fields']['spam_quarantine_cutoff_level']); - unset($app->tform->formDef["tabs"]["taglevel"]['fields']['spam_modifies_subj']); - unset($app->tform->formDef["tabs"]["taglevel"]['fields']['spam_subject_tag']); - unset($app->tform->formDef["tabs"]["taglevel"]['fields']['spam_subject_tag2']); - - unset($app->tform->formDef["tabs"]["quarantine"]); - unset($app->tform->formDef["tabs"]["other"]); - } else { - unset($app->tform->formDef["tabs"]["taglevel"]['fields']['rspamd_greylisting']); - unset($app->tform->formDef["tabs"]["taglevel"]['fields']['rspamd_spam_greylisting_level']); - unset($app->tform->formDef["tabs"]["taglevel"]['fields']['rspamd_spam_tag_level']); - unset($app->tform->formDef["tabs"]["taglevel"]['fields']['rspamd_spam_tag_method']); - unset($app->tform->formDef["tabs"]["taglevel"]['fields']['rspamd_spam_kill_level']); - } - $app->tpl->setVar("content_filter", $content_filter); - - parent::onShow(); - } function onShowNew() { - global $app, $conf; + global $app; // we will check only users, not admins if($_SESSION["s"]["user"]["typ"] == 'user') { @@ -106,7 +67,7 @@ class page_action extends tform_actions { } function onSubmit() { - global $app, $conf; + global $app; // Check the client limits, if user is not the admin if($_SESSION["s"]["user"]["typ"] != 'admin') { // if user is not admin @@ -128,35 +89,30 @@ class page_action extends tform_actions { } function onAfterUpdate() { - global $app, $conf; - - $app->uses('getconf'); - $mail_config = $app->getconf->get_server_config($conf['server_id'], 'mail'); + global $app; - if($mail_config['content_filter'] == 'rspamd'){ - $record_has_changed = false; - if(isset($this->dataRecord['rspamd_spam_greylisting_level']) && !isset($this->dataRecord['rspamd_greylisting'])) $this->dataRecord['rspamd_greylisting'] = 'n'; - foreach($this->dataRecord as $key => $val) { - if(isset($this->oldDataRecord[$key]) && @$this->oldDataRecord[$key] != $val) { - // Record has changed - $record_has_changed = true; - } + $record_has_changed = false; + if(isset($this->dataRecord['rspamd_spam_greylisting_level']) && !isset($this->dataRecord['rspamd_greylisting'])) { + $this->dataRecord['rspamd_greylisting'] = 'n'; + } + foreach($this->dataRecord as $key => $val) { + if(isset($this->oldDataRecord[$key]) && @$this->oldDataRecord[$key] != $val) { + // Record has changed + $record_has_changed = true; } - - if($record_has_changed){ - $spamfilter_users = $app->db->queryAllRecords("SELECT * FROM spamfilter_users WHERE policy_id = ?", intval($this->id)); + } + + if($record_has_changed){ + $spamfilter_users = $app->db->queryAllRecords("SELECT * FROM spamfilter_users WHERE policy_id = ?", intval($this->id)); - if(is_array($spamfilter_users) && !empty($spamfilter_users)){ - foreach($spamfilter_users as $spamfilter_user){ - $app->db->datalogUpdate('spamfilter_users', $spamfilter_user, 'id', $spamfilter_user["id"], true); - } + if(is_array($spamfilter_users) && !empty($spamfilter_users)){ + foreach($spamfilter_users as $spamfilter_user){ + $app->db->datalogUpdate('spamfilter_users', $spamfilter_user, 'id', $spamfilter_user["id"], true); } } } } - } $app->tform_actions = new page_action; $app->tform_actions->onLoad(); -?> \ No newline at end of file diff --git a/interface/web/mail/templates/spamfilter_amavis_edit.htm b/interface/web/mail/templates/spamfilter_amavis_edit.htm new file mode 100644 index 0000000000000000000000000000000000000000..41bf6b5410eb6046746f51c18e29d800fc348b82 --- /dev/null +++ b/interface/web/mail/templates/spamfilter_amavis_edit.htm @@ -0,0 +1,198 @@ + +

+ +
+ +
+ +
+
+
+ +
+
+
+ +
+
+
+ +
+
+
+ +
+
+
+ +
+
+
+
+
+ + +
+ +
+
+ +
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+
+ +
+
+ +
+
+
+
+ + +
+ +
+
+ + +
+ +
+
+ +
+
+ +
+
+ +
+
+
+
+ + +
+ +
+
+ +
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+
+ +
+
+
+ +
+
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
Bytes
+
+
+ +
+
+
+
+ + + + +
+ + +
\ No newline at end of file diff --git a/interface/web/mail/templates/spamfilter_other_edit.htm b/interface/web/mail/templates/spamfilter_other_edit.htm deleted file mode 100644 index 83cd4a95c906c0d742a1ec37965feb0ba711f2ba..0000000000000000000000000000000000000000 --- a/interface/web/mail/templates/spamfilter_other_edit.htm +++ /dev/null @@ -1,67 +0,0 @@ - -

- - - -
- -
-
- -
-
- -
-
- -
-
- -
-
-
- -
-
-
- -
-
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
Bytes
-
-
- -
- - - - -
- - -
diff --git a/interface/web/mail/templates/spamfilter_policy_edit.htm b/interface/web/mail/templates/spamfilter_policy_edit.htm index 0496d3a85a887e76ae40ea5d323b0b1f53854fc1..506b4d5b89fa1f1dd7062265361ce7ec79927905 100644 --- a/interface/web/mail/templates/spamfilter_policy_edit.htm +++ b/interface/web/mail/templates/spamfilter_policy_edit.htm @@ -3,8 +3,7 @@

- - +
@@ -20,38 +19,7 @@ {tmpl_var name='spam_lover'} - -
- -
-
-
- -
-
-
- -
-
-
- -
-
-
- -
-
-
+ diff --git a/interface/web/mail/templates/spamfilter_quarantine_edit.htm b/interface/web/mail/templates/spamfilter_quarantine_edit.htm deleted file mode 100644 index 7f44b58020f1c093cb825b39b0cecacaaa399630..0000000000000000000000000000000000000000 --- a/interface/web/mail/templates/spamfilter_quarantine_edit.htm +++ /dev/null @@ -1,35 +0,0 @@ - -

- - - -
- -
-
- -
-
- -
-
- -
- - - - - -
- - -
\ No newline at end of file diff --git a/interface/web/mail/templates/spamfilter_rspamd_edit.htm b/interface/web/mail/templates/spamfilter_rspamd_edit.htm new file mode 100644 index 0000000000000000000000000000000000000000..73472a876c3ea5c69cfc0521dd8a6806362f76ca --- /dev/null +++ b/interface/web/mail/templates/spamfilter_rspamd_edit.htm @@ -0,0 +1,36 @@ + +

+ +
+ +
+ {tmpl_var name='rspamd_greylisting'} +
+
+
+ +
+
+
+ +
+
+
+ +
+
+
+ +
+
+ + + +
+ + +
\ No newline at end of file diff --git a/interface/web/mail/templates/spamfilter_taglevel_edit.htm b/interface/web/mail/templates/spamfilter_taglevel_edit.htm deleted file mode 100644 index 1b3c3b482c2fe270cfe2acc357e4e8848645acf5..0000000000000000000000000000000000000000 --- a/interface/web/mail/templates/spamfilter_taglevel_edit.htm +++ /dev/null @@ -1,69 +0,0 @@ - -

- - - -
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
-
- -
-
- -
-
- -
- -
- {tmpl_var name='rspamd_greylisting'} -
-
-
- -
-
-
- -
-
-
- -
-
-
- -
-
-
- - - - -
- - -