Commit 535a69cf authored by tbrehm's avatar tbrehm

- Improved dkim support.

- Added dkim installation to installer.
- Added backup filesize in backup cronjob.
parent 558bf785
......@@ -1048,7 +1048,20 @@ class installer_base {
// Add the clamav user to the amavis group
exec('adduser clamav amavis');
// Create the director for DKIM-Keys
mkdir("/var/lib/amavis/dkim",0750);
// get shell-user for amavis
$amavis_user=exec('grep -o "^amavis:\|^vscan:" /etc/passwd');
if(!empty($amavis_user)) {
$amavis_user=rtrim($amavis_user,":");
exec('chown '.$amavis_user.'/var/lib/amavis/dkim');
}
// get shell-group for amavis
$amavis_group=exec('grep -o "^amavis:\|^vscan:" /etc/group');
if(!empty($amavis_group)) {
$amavis_group=rtrim($amavis_group,":");
exec('chgrp '.$amavis_group.'/var/lib/amavis/dkim');
}
}
public function configure_spamassassin() {
......
......@@ -28,7 +28,7 @@ munin_password=
module=postfix_mysql
maildir_path=/var/vmail/[domain]/[localpart]
homedir_path=/var/vmail
dkim_path=/etc/postfix/dkim
dkim_path=/var/lib/amavis/dkim
pop3_imap_daemon=courier
mail_filter_syntax=maildrop
mailuser_uid=5000
......
......@@ -278,7 +278,7 @@ $form["tabs"]['mail'] = array(
'dkim_path' => array(
'datatype' => 'VARCHAR',
'formtype' => 'TEXT',
'default' => '/var/db/dkim',
'default' => '/var/lib/amavis/dkim',
'validators' => array ( 0 => array ('type' => 'CUSTOM',
'class' => 'validate_dkim',
'function' => 'check_dkim_path',
......
......@@ -121,7 +121,7 @@ class cronjob_backup extends cronjob {
//* Insert web backup record in database
//$insert_data = "(server_id,parent_domain_id,backup_type,backup_mode,tstamp,filename) VALUES (".$conf['server_id'].",".$web_id.",'web','".$backup_mode."',".time().",'".$app->db->quote($web_backup_file)."')";
//$app->dbmaster->datalogInsert('web_backup', $insert_data, 'backup_id');
$sql = "INSERT INTO web_backup (server_id,parent_domain_id,backup_type,backup_mode,tstamp,filename) VALUES (".$conf['server_id'].",".$web_id.",'web','".$backup_mode."',".time().",'".$app->db->quote($web_backup_file)."')";
$sql = "INSERT INTO web_backup (server_id,parent_domain_id,backup_type,backup_mode,tstamp,filename,filesize) VALUES (".$conf['server_id'].",".$web_id.",'web','".$backup_mode."',".time().",'".$app->db->quote($web_backup_file)."','".formatBytes(filesize($web_backup_dir.'/'.$web_backup_file))."')";
$app->db->query($sql);
if($app->db->dbHost != $app->dbmaster->dbHost) $app->dbmaster->query($sql);
} else {
......@@ -227,7 +227,7 @@ class cronjob_backup extends cronjob {
//* Insert web backup record in database
//$insert_data = "(server_id,parent_domain_id,backup_type,backup_mode,tstamp,filename) VALUES (".$conf['server_id'].",$web_id,'mysql','sqlgz',".time().",'".$app->db->quote($db_backup_file).".gz')";
//$app->dbmaster->datalogInsert('web_backup', $insert_data, 'backup_id');
$sql = "INSERT INTO web_backup (server_id,parent_domain_id,backup_type,backup_mode,tstamp,filename) VALUES (".$conf['server_id'].",$web_id,'mysql','sqlgz',".time().",'".$app->db->quote($db_backup_file).".gz')";
$sql = "INSERT INTO web_backup (server_id,parent_domain_id,backup_type,backup_mode,tstamp,filename,filesize) VALUES (".$conf['server_id'].",$web_id,'mysql','sqlgz',".time().",'".$app->db->quote($db_backup_file).".gz','".formatBytes(filesize($db_backup_dir.'/'.$db_backup_file))."')";
$app->db->query($sql);
if($app->db->dbHost != $app->dbmaster->dbHost) $app->dbmaster->query($sql);
......
......@@ -105,7 +105,7 @@ class mail_plugin_dkim {
$check=false;
}
} else {
$app->log('Unable to write DKIM settings; Check your config!',LOGLEVEL_ERROR);
$app->log('Unable to write DKIM settings. Check your config!',LOGLEVEL_ERROR);
$check=false;
}
return $check;
......
Markdown is supported
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