Commit 64b2a9cb authored by Florian Schaal's avatar Florian Schaal

the path for the dkim-keys is automaticly creaed by the server-plugin, the...

the path for the dkim-keys is automaticly creaed by the server-plugin, the path could be empty in the interface, and the amavis-template for gentoo was updated
parent 738c3d47
......@@ -93,6 +93,22 @@ $LOGFILE = "/var/log/amavis.log"; # (defaults to empty, no log)
# Set the log_level to 5 for debugging
$log_level = 0; # (defaults to 0)
$inet_socket_port = [10024,10026];
$forward_method = 'smtp:[127.0.0.1]:10025';
$notify_method = 'smtp:[127.0.0.1]:10027';
$interface_policy{'10026'} = 'ORIGINATING';
$policy_bank{'ORIGINATING'} = {
originating => 1,
smtpd_discard_ehlo_keywords => ['8BITMIME'],
forward_method => 'smtp:[127.0.0.1]:10027',
};
@mynetworks = qw(0.0.0.0/8 127.0.0.0/8 10.0.0.0/8 172.16.0.0/12
192.168.0.0/16);
$signed_header_fields{'received'} = 0; # turn off signing of Received
$enable_dkim_verification = 1;
$enable_dkim_signing = 1;
@dkim_signature_options_bysender_maps = (
{ '.' => { ttl => 21*24*3600, c => 'relaxed/simple' } } );
#------------ Do not modify anything below this line -------------
1; # insure a defined return
......@@ -75,6 +75,18 @@ $LOGFILE = "/var/log/amavis.log"; # (defaults to empty, no log)
# Set the log_level to 5 for debugging
$log_level = 0; # (defaults to 0)
$inet_socket_port = [10024,10026];
$forward_method = 'smtp:[127.0.0.1]:10025';
$notify_method = 'smtp:[127.0.0.1]:10027';
$interface_policy{'10026'} = 'ORIGINATING';
$policy_bank{'ORIGINATING'} = {
originating => 1,
smtpd_discard_ehlo_keywords => ['8BITMIME'],
forward_method => 'smtp:[127.0.0.1]:10027',
};
@mynetworks = qw(0.0.0.0/8 127.0.0.0/8 10.0.0.0/8 172.16.0.0/12
192.168.0.0/16);
# DKIM
$enable_dkim_verification = 1;
......
......@@ -57,18 +57,6 @@ class validate_dkim {
}
}
/**
* Validator function for DKIM Path
* @return boolean - true when the dkim-path exists and is writeable
*/
function check_dkim_path($field_name, $field_value, $validator) {
if(empty($field_value)) return $this->get_error($validator['errmsg']);
if (substr(sprintf('%o', fileperms($field_value)), -3) <= 600)
return $this->get_error($validator['errmsg']);
}
/**
* Check function for DNS-Template
*/
......
......@@ -303,15 +303,19 @@ $form["tabs"]['mail'] = array(
'datatype' => 'VARCHAR',
'formtype' => 'TEXT',
'default' => '/var/lib/amavis/dkim',
'validators' => array ( 0 => array ('type' => 'CUSTOM',
'class' => 'validate_dkim',
'function' => 'check_dkim_path',
'errmsg'=> 'dkim_path_error'),
'value' => '',
'width' => '40',
'maxlength' => '255'
),
'relayhost_password' => array(
'datatype' => 'VARCHAR',
'formtype' => 'TEXT',
'default' => '',
'value' => '',
'width' => '40',
'maxlength' => '255'
),
'pop3_imap_daemon' => array(
'datatype' => 'VARCHAR',
'formtype' => 'SELECT',
......
......@@ -190,7 +190,6 @@ $wb['munin_password_txt'] = 'Munin Password';
$wb['munin_url_error_regex'] = 'Invalid Munin URL';
$wb['munin_url_note_txt'] = 'Placeholder:';
$wb["dkim_path_txt"] = 'DKIM Path';
$wb["dkim_path_error"] = 'DKIM Path not found or not writeable.';
$wb['backup_delete_txt'] = 'Delete backups on domain/website delete';
$wb["v6_prefix_txt"] = 'IPv6 Prefix';
$wb["vhost_rewrite_v6_txt"] = 'Rewrite IPv6 on Mirror';
......
......@@ -190,7 +190,6 @@ $wb['munin_password_txt'] = 'Munin Password';
$wb['munin_url_error_regex'] = 'Invalid Munin URL';
$wb['munin_url_note_txt'] = 'Placeholder:';
$wb["dkim_path_txt"] = 'DKIM Path';
$wb["dkim_path_error"] = 'DKIM Path not found or not writeable.';
$wb['backup_delete_txt'] = 'Delete backups on domain/website delete';
$wb["v6_prefix_txt"] = 'IPv6 Prefix';
$wb["vhost_rewrite_v6_txt"] = 'Rewrite IPv6 on Mirror';
......
......@@ -190,7 +190,6 @@ $wb['munin_password_txt'] = 'Munin Password';
$wb['munin_url_error_regex'] = 'Invalid Munin URL';
$wb['munin_url_note_txt'] = 'Placeholder:';
$wb["dkim_path_txt"] = 'DKIM Path';
$wb["dkim_path_error"] = 'DKIM Path not found or not writeable.';
$wb['backup_delete_txt'] = 'Delete backups on domain/website delete';
$wb["v6_prefix_txt"] = 'IPv6 Prefix';
$wb["vhost_rewrite_v6_txt"] = 'Rewrite IPv6 on Mirror';
......
......@@ -184,7 +184,6 @@ $wb['monit_user_txt'] = 'Monit User';
$wb['monit_password_txt'] = 'Monit Password';
$wb['monit_url_error_regex'] = 'Invalid Monit URL';
$wb["dkim_path_txt"] = 'DKIM Path';
$wb["dkim_path_error"] = 'DKIM Path not found or not writeable.';
$wb['backup_delete_txt'] = 'Delete backups on domain/website delete';
$wb['monit_url_note_txt'] = 'Placeholder:';
$wb['munin_url_txt'] = 'Munin URL';
......
......@@ -20,7 +20,6 @@ $wb['module_txt'] = 'Modul';
$wb['maildir_path_txt'] = 'Maildir Pfad';
$wb['homedir_path_txt'] = 'Homedir Pfad';
$wb['dkim_path_txt'] = 'DKIM Pfad';
$wb['dkim_path_error'] = 'DKIM Pfad nicht gefunden oder nicht beschreibbar.';
$wb['mailuser_uid_txt'] = 'Mailbenutzer UID';
$wb['mailuser_gid_txt'] = 'Mailbenutzer GID';
$wb['mailuser_name_txt'] = 'Mailbenutzer Name';
......
......@@ -31,7 +31,6 @@ $wb["module_txt"] = 'Module';
$wb["maildir_path_txt"] = 'Maildir Path';
$wb["homedir_path_txt"] = 'Homedir Path';
$wb["dkim_path_txt"] = 'DKIM Path';
$wb["dkim_path_error"] = 'DKIM Path not found or not writeable.';
$wb["mailuser_uid_txt"] = 'Mailuser UID';
$wb["mailuser_gid_txt"] = 'Mailuser GID';
$wb["mailuser_name_txt"] = 'Mailuser Name';
......
......@@ -190,7 +190,6 @@ $wb['munin_password_txt'] = 'Munin Password';
$wb['munin_url_error_regex'] = 'Invalid Munin URL';
$wb['munin_url_note_txt'] = 'Placeholder:';
$wb["dkim_path_txt"] = 'DKIM Path';
$wb["dkim_path_error"] = 'DKIM Path not found or not writeable.';
$wb['backup_delete_txt'] = 'Delete backups on domain/website delete';
$wb["v6_prefix_txt"] = 'IPv6 Prefix';
$wb["vhost_rewrite_v6_txt"] = 'Rewrite IPv6 on Mirror';
......
......@@ -190,7 +190,6 @@ $wb['munin_password_txt'] = 'Munin Password';
$wb['munin_url_error_regex'] = 'Invalid Munin URL';
$wb['munin_url_note_txt'] = 'Placeholder:';
$wb["dkim_path_txt"] = 'DKIM Path';
$wb["dkim_path_error"] = 'DKIM Path not found or not writeable.';
$wb['backup_delete_txt'] = 'Delete backups on domain/website delete';
$wb["v6_prefix_txt"] = 'IPv6 Prefix';
$wb["vhost_rewrite_v6_txt"] = 'Rewrite IPv6 on Mirror';
......
......@@ -19,7 +19,6 @@ $wb['module_txt'] = 'Module';
$wb['maildir_path_txt'] = 'Chemin Maildir';
$wb['homedir_path_txt'] = 'Chemin Homedir';
$wb['dkim_path_txt'] = 'Chemin DKIM';
$wb['dkim_path_error'] = 'Le chemin DKIM n\'est pas trouvé ou ne peut être écrit.';
$wb['mailuser_uid_txt'] = 'UID de l\'utilisateur mail';
$wb['mailuser_gid_txt'] = 'GID de l\'utilisateur mail';
$wb['mailuser_name_txt'] = 'Nom d\'utilisateur mail';
......
......@@ -190,7 +190,6 @@ $wb['munin_password_txt'] = 'Munin Password';
$wb['munin_url_error_regex'] = 'Invalid Munin URL';
$wb['munin_url_note_txt'] = 'Placeholder:';
$wb["dkim_path_txt"] = 'DKIM Path';
$wb["dkim_path_error"] = 'DKIM Path not found or not writeable.';
$wb['backup_delete_txt'] = 'Delete backups on domain/website delete';
$wb["v6_prefix_txt"] = 'IPv6 Prefix';
$wb["vhost_rewrite_v6_txt"] = 'Rewrite IPv6 on Mirror';
......
......@@ -190,7 +190,6 @@ $wb['munin_password_txt'] = 'Munin Password';
$wb['munin_url_error_regex'] = 'Invalid Munin URL';
$wb['munin_url_note_txt'] = 'Placeholder:';
$wb["dkim_path_txt"] = 'DKIM Path';
$wb["dkim_path_error"] = 'DKIM Path not found or not writeable.';
$wb['backup_delete_txt'] = 'Delete backups on domain/website delete';
$wb["v6_prefix_txt"] = 'IPv6 Prefix';
$wb["vhost_rewrite_v6_txt"] = 'Rewrite IPv6 on Mirror';
......
......@@ -190,7 +190,6 @@ $wb['munin_password_txt'] = 'Munin Password';
$wb['munin_url_error_regex'] = 'Invalid Munin URL';
$wb['munin_url_note_txt'] = 'Placeholder:';
$wb["dkim_path_txt"] = 'DKIM Path';
$wb["dkim_path_error"] = 'DKIM Path not found or not writeable.';
$wb['backup_delete_txt'] = 'Delete backups on domain/website delete';
$wb["v6_prefix_txt"] = 'IPv6 Prefix';
$wb["vhost_rewrite_v6_txt"] = 'Rewrite IPv6 on Mirror';
......
......@@ -190,7 +190,6 @@ $wb['munin_password_txt'] = 'Munin Password';
$wb['munin_url_error_regex'] = 'Invalid Munin URL';
$wb['munin_url_note_txt'] = 'Placeholder:';
$wb["dkim_path_txt"] = 'DKIM Path';
$wb["dkim_path_error"] = 'DKIM Path not found or not writeable.';
$wb['backup_delete_txt'] = 'Delete backups on domain/website delete';
$wb["v6_prefix_txt"] = 'IPv6 Prefix';
$wb["vhost_rewrite_v6_txt"] = 'Rewrite IPv6 on Mirror';
......
......@@ -190,7 +190,6 @@ $wb['munin_password_txt'] = 'Munin Password';
$wb['munin_url_error_regex'] = 'Invalid Munin URL';
$wb['munin_url_note_txt'] = 'Placeholder:';
$wb["dkim_path_txt"] = 'DKIM Path';
$wb["dkim_path_error"] = 'DKIM Path not found or not writeable.';
$wb['backup_delete_txt'] = 'Delete backups on domain/website delete';
$wb["v6_prefix_txt"] = 'IPv6 Prefix';
$wb["vhost_rewrite_v6_txt"] = 'Rewrite IPv6 on Mirror';
......
......@@ -190,7 +190,6 @@ $wb['munin_password_txt'] = 'Munin Password';
$wb['munin_url_error_regex'] = 'Invalid Munin URL';
$wb['munin_url_note_txt'] = 'Placeholder:';
$wb["dkim_path_txt"] = 'DKIM Path';
$wb["dkim_path_error"] = 'DKIM Path not found or not writeable.';
$wb['backup_delete_txt'] = 'Delete backups on domain/website delete';
$wb["v6_prefix_txt"] = 'IPv6 Prefix';
$wb["vhost_rewrite_v6_txt"] = 'Rewrite IPv6 on Mirror';
......
......@@ -190,7 +190,6 @@ $wb['munin_password_txt'] = 'Munin Password';
$wb['munin_url_error_regex'] = 'Invalid Munin URL';
$wb['munin_url_note_txt'] = 'Placeholder:';
$wb["dkim_path_txt"] = 'DKIM Path';
$wb["dkim_path_error"] = 'DKIM Path not found or not writeable.';
$wb['backup_delete_txt'] = 'Delete backups on domain/website delete';
$wb["v6_prefix_txt"] = 'IPv6 Prefix';
$wb["vhost_rewrite_v6_txt"] = 'Rewrite IPv6 on Mirror';
......
......@@ -190,7 +190,6 @@ $wb['munin_password_txt'] = 'Munin Password';
$wb['munin_url_error_regex'] = 'Invalid Munin URL';
$wb['munin_url_note_txt'] = 'Placeholder:';
$wb["dkim_path_txt"] = 'DKIM Path';
$wb["dkim_path_error"] = 'DKIM Path not found or not writeable.';
$wb['backup_delete_txt'] = 'Delete backups on domain/website delete';
$wb["v6_prefix_txt"] = 'IPv6 Prefix';
$wb["vhost_rewrite_v6_txt"] = 'Rewrite IPv6 on Mirror';
......
......@@ -190,7 +190,6 @@ $wb['munin_password_txt'] = 'Munin Password';
$wb['munin_url_error_regex'] = 'Invalid Munin URL';
$wb['munin_url_note_txt'] = 'Placeholder:';
$wb["dkim_path_txt"] = 'DKIM Path';
$wb["dkim_path_error"] = 'DKIM Path not found or not writeable.';
$wb['backup_delete_txt'] = 'Delete backups on domain/website delete';
$wb["v6_prefix_txt"] = 'IPv6 Prefix';
$wb["vhost_rewrite_v6_txt"] = 'Rewrite IPv6 on Mirror';
......
......@@ -190,7 +190,6 @@ $wb['munin_password_txt'] = 'Munin Password';
$wb['munin_url_error_regex'] = 'Invalid Munin URL';
$wb['munin_url_note_txt'] = 'Placeholder:';
$wb["dkim_path_txt"] = 'DKIM Path';
$wb["dkim_path_error"] = 'DKIM Path not found or not writeable.';
$wb['backup_delete_txt'] = 'Delete backups on domain/website delete';
$wb["v6_prefix_txt"] = 'IPv6 Prefix';
$wb["vhost_rewrite_v6_txt"] = 'Rewrite IPv6 on Mirror';
......
......@@ -190,7 +190,6 @@ $wb['munin_password_txt'] = 'Munin Password';
$wb['munin_url_error_regex'] = 'Invalid Munin URL';
$wb['munin_url_note_txt'] = 'Placeholder:';
$wb["dkim_path_txt"] = 'DKIM Path';
$wb["dkim_path_error"] = 'DKIM Path not found or not writeable.';
$wb['backup_delete_txt'] = 'Delete backups on domain/website delete';
$wb["v6_prefix_txt"] = 'IPv6 Prefix';
$wb["vhost_rewrite_v6_txt"] = 'Rewrite IPv6 on Mirror';
......
......@@ -190,7 +190,6 @@ $wb['munin_password_txt'] = 'Munin Password';
$wb['munin_url_error_regex'] = 'Invalid Munin URL';
$wb['munin_url_note_txt'] = 'Placeholder:';
$wb["dkim_path_txt"] = 'DKIM Path';
$wb["dkim_path_error"] = 'DKIM Path not found or not writeable.';
$wb['backup_delete_txt'] = 'Delete backups on domain/website delete';
$wb["v6_prefix_txt"] = 'IPv6 Prefix';
$wb["vhost_rewrite_v6_txt"] = 'Rewrite IPv6 on Mirror';
......
......@@ -190,7 +190,6 @@ $wb['munin_password_txt'] = 'Munin Password';
$wb['munin_url_error_regex'] = 'Invalid Munin URL';
$wb['munin_url_note_txt'] = 'Placeholder:';
$wb["dkim_path_txt"] = 'DKIM Path';
$wb["dkim_path_error"] = 'DKIM Path not found or not writeable.';
$wb['backup_delete_txt'] = 'Delete backups on domain/website delete';
$wb["v6_prefix_txt"] = 'IPv6 Prefix';
$wb["vhost_rewrite_v6_txt"] = 'Rewrite IPv6 on Mirror';
......
......@@ -107,11 +107,18 @@ class mail_plugin_dkim {
}
/* dir for dkim-keys writeable? */
$mail_config = $app->getconf->get_server_config($conf['server_id'], 'mail');
if (isset($mail_config['dkim_path']) && isset($data['new']['dkim_private']) && !empty($data['new']['dkim_private'])) {
if (isset($mail_config['dkim_path']) && (!empty($mail_config['dkim_path'])) && isset($data['new']['dkim_private']) && !empty($data['new']['dkim_private'])) {
if (!is_dir($mail_config['dkim_path'])) {
$app->log('DKIM Path '.$mail_config['dkim_path'].' not found - (re)created.', LOGLEVEL_DEBUG);
mkdir($mail_config['dkim_path'], 0750, true);
}
if (!is_writeable($mail_config['dkim_path'])) {
$app->log('DKIM Path '.$mail_config['dkim_path'].' not found or not writeable.', LOGLEVEL_ERROR);
$app->log('DKIM Path '.$mail_config['dkim_path'].' not writeable.', LOGLEVEL_ERROR);
$check=false;
}
} else {
$app->log('Unable to write DKIM settings; Check your config!', LOGLEVEL_ERROR);
$check=false;
......@@ -160,7 +167,7 @@ class mail_plugin_dkim {
/* save the DKIM Public-key in dkim-dir */
if (!file_put_contents($key_file.'.public', $public_key) === false)
$app->log('Saved DKIM Public to '.$key_domain.'.', LOGLEVEL_DEBUG);
else $app->log('Unable to save DKIM Public to '.$key_domain.'.', LOGLEVEL_WARNING);
else $app->log('Unable to save DKIM Public to '.$key_domain.'.', LOGLEVEL_DEBUG);
}
return $success;
}
......@@ -220,7 +227,7 @@ class mail_plugin_dkim {
file_put_contents($this->get_amavis_config(), $amavis_config);
$app->log('Deleted the DKIM settings from amavis-config for '.$key_domain.'.', LOGLEVEL_DEBUG);
$this->restart_amavis();
} else $app->log('Unable to delete the DKIM settings from amavis-config for '.$key_domain.'.', LOGLEVEL_ERROR);
} else $app->log('Unable to delete the DKIM settings from amavis-config for '.$key_domain.'.', LOGLEVEL_DEBUG);
}
/**
......
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