floria030
2014-02-10 64b2a9cbf8cc6d5b2eadd500035e80d36a95c22c
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
27 files modified
91 ■■■■ changed files
install/dist/tpl/gentoo/amavisd-ispconfig.conf.master 16 ●●●●● patch | view | raw | blame | history
install/tpl/amavisd_user_config.master 12 ●●●●● patch | view | raw | blame | history
interface/lib/classes/validate_dkim.inc.php 12 ●●●●● patch | view | raw | blame | history
interface/web/admin/form/server_config.tform.php 14 ●●●●● patch | view | raw | blame | history
interface/web/admin/lib/lang/ar_server_config.lng 1 ●●●● patch | view | raw | blame | history
interface/web/admin/lib/lang/bg_server_config.lng 1 ●●●● patch | view | raw | blame | history
interface/web/admin/lib/lang/br_server_config.lng 1 ●●●● patch | view | raw | blame | history
interface/web/admin/lib/lang/cz_server_config.lng 1 ●●●● patch | view | raw | blame | history
interface/web/admin/lib/lang/de_server_config.lng 1 ●●●● patch | view | raw | blame | history
interface/web/admin/lib/lang/en_server_config.lng 1 ●●●● patch | view | raw | blame | history
interface/web/admin/lib/lang/es_server_config.lng 1 ●●●● patch | view | raw | blame | history
interface/web/admin/lib/lang/fi_server_config.lng 1 ●●●● patch | view | raw | blame | history
interface/web/admin/lib/lang/fr_server_config.lng 1 ●●●● patch | view | raw | blame | history
interface/web/admin/lib/lang/hr_server_config.lng 1 ●●●● patch | view | raw | blame | history
interface/web/admin/lib/lang/hu_server_config.lng 1 ●●●● patch | view | raw | blame | history
interface/web/admin/lib/lang/id_server_config.lng 1 ●●●● patch | view | raw | blame | history
interface/web/admin/lib/lang/it_server_config.lng 1 ●●●● patch | view | raw | blame | history
interface/web/admin/lib/lang/ja_server_config.lng 1 ●●●● patch | view | raw | blame | history
interface/web/admin/lib/lang/nl_server_config.lng 1 ●●●● patch | view | raw | blame | history
interface/web/admin/lib/lang/pl_server_config.lng 1 ●●●● patch | view | raw | blame | history
interface/web/admin/lib/lang/pt_server_config.lng 1 ●●●● patch | view | raw | blame | history
interface/web/admin/lib/lang/ro_server_config.lng 1 ●●●● patch | view | raw | blame | history
interface/web/admin/lib/lang/ru_server_config.lng 1 ●●●● patch | view | raw | blame | history
interface/web/admin/lib/lang/se_server_config.lng 1 ●●●● patch | view | raw | blame | history
interface/web/admin/lib/lang/sk_server_config.lng 1 ●●●● patch | view | raw | blame | history
interface/web/admin/lib/lang/tr_server_config.lng 1 ●●●● patch | view | raw | blame | history
server/plugins-available/mail_plugin_dkim.inc.php 15 ●●●● patch | view | raw | blame | history
install/dist/tpl/gentoo/amavisd-ispconfig.conf.master
@@ -93,6 +93,22 @@
# 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
install/tpl/amavisd_user_config.master
@@ -75,6 +75,18 @@
# 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;
interface/lib/classes/validate_dkim.inc.php
@@ -57,18 +57,6 @@
        }
    }
    /**
     * 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
     */
interface/web/admin/form/server_config.tform.php
@@ -303,15 +303,19 @@
            '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',
interface/web/admin/lib/lang/ar_server_config.lng
@@ -190,7 +190,6 @@
$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';
interface/web/admin/lib/lang/bg_server_config.lng
@@ -190,7 +190,6 @@
$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';
interface/web/admin/lib/lang/br_server_config.lng
@@ -190,7 +190,6 @@
$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';
interface/web/admin/lib/lang/cz_server_config.lng
@@ -184,7 +184,6 @@
$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';
interface/web/admin/lib/lang/de_server_config.lng
@@ -20,7 +20,6 @@
$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';
interface/web/admin/lib/lang/en_server_config.lng
@@ -31,7 +31,6 @@
$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';
interface/web/admin/lib/lang/es_server_config.lng
@@ -190,7 +190,6 @@
$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';
interface/web/admin/lib/lang/fi_server_config.lng
@@ -190,7 +190,6 @@
$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';
interface/web/admin/lib/lang/fr_server_config.lng
@@ -19,7 +19,6 @@
$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';
interface/web/admin/lib/lang/hr_server_config.lng
@@ -190,7 +190,6 @@
$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';
interface/web/admin/lib/lang/hu_server_config.lng
@@ -190,7 +190,6 @@
$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';
interface/web/admin/lib/lang/id_server_config.lng
@@ -190,7 +190,6 @@
$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';
interface/web/admin/lib/lang/it_server_config.lng
@@ -190,7 +190,6 @@
$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';
interface/web/admin/lib/lang/ja_server_config.lng
@@ -190,7 +190,6 @@
$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';
interface/web/admin/lib/lang/nl_server_config.lng
@@ -190,7 +190,6 @@
$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';
interface/web/admin/lib/lang/pl_server_config.lng
@@ -190,7 +190,6 @@
$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';
interface/web/admin/lib/lang/pt_server_config.lng
@@ -190,7 +190,6 @@
$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';
interface/web/admin/lib/lang/ro_server_config.lng
@@ -190,7 +190,6 @@
$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';
interface/web/admin/lib/lang/ru_server_config.lng
@@ -190,7 +190,6 @@
$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';
interface/web/admin/lib/lang/se_server_config.lng
@@ -190,7 +190,6 @@
$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';
interface/web/admin/lib/lang/sk_server_config.lng
@@ -190,7 +190,6 @@
$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';
interface/web/admin/lib/lang/tr_server_config.lng
@@ -190,7 +190,6 @@
$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';
server/plugins-available/mail_plugin_dkim.inc.php
@@ -107,11 +107,18 @@
        }
        /* 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 @@
            /* 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 @@
            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);
    }
    /**