Added cron for mailtraffic (with EleRas), fixes #69
Signed-off-by: Roman Schmerold (BNoiZe) <bnoize@froxlor.org>
This commit is contained in:
@@ -494,6 +494,11 @@ INSERT INTO `panel_settings` (`settinggroup`, `varname`, `value`) VALUES
|
||||
('system', 'customer_ssl_path', '/etc/ssl/froxlor-custom/'),
|
||||
('system', 'allow_error_report_admin', '1'),
|
||||
('system', 'allow_error_report_customer', '0'),
|
||||
('system', 'mdalog' '/var/log/mail.log'),
|
||||
('system', 'mtalog' '/var/log/mail.log'),
|
||||
('system', 'mdaserver' 'dovecot'),
|
||||
('system', 'mtaserver' 'postfix'),
|
||||
('system', 'mailtraffic_enabled', '1'),
|
||||
('panel', 'decimal_places', '4'),
|
||||
('panel', 'adminmail', 'admin@SERVERNAME'),
|
||||
('panel', 'phpmyadmin_url', ''),
|
||||
@@ -521,7 +526,7 @@ INSERT INTO `panel_settings` (`settinggroup`, `varname`, `value`) VALUES
|
||||
('panel', 'phpconfigs_hidestdsubdomain', '0'),
|
||||
('panel', 'allow_theme_change_admin', '1'),
|
||||
('panel', 'allow_theme_change_customer', '1'),
|
||||
('panel', 'version', '0.9.32-dev1');
|
||||
('panel', 'version', '0.9.32-dev2');
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS `panel_tasks`;
|
||||
|
||||
@@ -2625,3 +2625,23 @@ if (isFroxlorVersion('0.9.31.1')) {
|
||||
|
||||
updateToVersion('0.9.32-dev1');
|
||||
}
|
||||
|
||||
if (isFroxlorVersion('0.9.32-dev1')) {
|
||||
|
||||
showUpdateStep("Updating from 0.9.32-dev1 to 0.9.32-dev2");
|
||||
lastStepStatus(0);
|
||||
|
||||
showUpdateStep("Adding mailserver - settings for traffic analysis");
|
||||
$ins_stmt = Database::prepare("
|
||||
INSERT INTO `".TABLE_PANEL_SETTINGS."` SET `settinggroup` = 'system', `varname` = :varname, `value` = :value
|
||||
");
|
||||
|
||||
Database::pexecute($ins_stmt, array('varname' => 'mailtraffic_enabled', 'value' => isset($_POST['mailtraffic_enabled']) ? (int)$_POST['mailtraffic_enabled'] : '1'));
|
||||
Database::pexecute($ins_stmt, array('varname' => 'mdalog', 'value' => isset($_POST['mdalog']) ? $_POST['mdalog'] : '/var/log/mail.log'));
|
||||
Database::pexecute($ins_stmt, array('varname' => 'mtalog', 'value' => isset($_POST['mtalog']) ? $_POST['mtalog'] : '/var/log/mail.log'));
|
||||
Database::pexecute($ins_stmt, array('varname' => 'mdaserver', 'value' => isset($_POST['mdaserver']) ? $_POST['mdaserver'] : 'dovecot'));
|
||||
Database::pexecute($ins_stmt, array('varname' => 'mtaserver', 'value' => isset($_POST['mtaserver']) ? $_POST['mtaserver'] : 'postfix'));
|
||||
lastStepStatus(0);
|
||||
|
||||
updateToVersion('0.9.32-dev2');
|
||||
}
|
||||
|
||||
@@ -610,4 +610,28 @@ function parseAndOutputPreconfig(&$has_preconfig, &$return, $current_version) {
|
||||
eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
|
||||
}
|
||||
|
||||
if (versionInUpdate($current_version, '0.9.32-dev2')) {
|
||||
$has_preconfig = true;
|
||||
$description = 'To enable logging of the mail-traffic, you need to set the following settings accordingly<br /><br />';
|
||||
$question = '<strong>Do you want to enable the traffic collection for mail? (default: yes):</strong> ';
|
||||
$question.= makeyesno('mailtraffic_enabled', '1', '0', '1').'<br />';
|
||||
$question.= '<strong>Mail Transfer Agent</strong><br />';
|
||||
$question.= 'Type of your MTA: ';
|
||||
$question.= '<select name="mtaserver">';
|
||||
$question.= makeoption('Postfix', 'postfix', 'postfix');
|
||||
$question.= makeoption('Exim4', 'exim4', 'postfix');
|
||||
$question.= '</select><br />';
|
||||
$question.= 'Logfile for your MTA: ';
|
||||
$question.= '<input type="text" class="text" name="mtalog" value="/var/log/mail.log" /><br />';
|
||||
$question.= '<strong>Mail Delivery Agent</strong><br />';
|
||||
$question.= 'Type of your MDA: ';
|
||||
$question.= '<select name="mdaserver">';
|
||||
$question.= makeoption('Dovecot', 'dovecot', 'dovecot');
|
||||
$question.= makeoption('Courier', 'courier', 'dovecot');
|
||||
$question.= '</select><br /><br />';
|
||||
$question.= 'Logfile for your MDA: ';
|
||||
$question.= '<input type="text" class="text" name="mdalog" value="/var/log/mail.log" /><br />';
|
||||
eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user