Merge branch 'master' into 'master'
Master
| | |
| | | # 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 |
| | |
| | | # 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; |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 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 |
| | | */ |
| | |
| | | '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', |
| | |
| | | $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'; |
| | |
| | | $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'; |
| | |
| | | $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'; |
| | |
| | | $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'; |
| | |
| | | $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'; |
| | |
| | | $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'; |
| | |
| | | $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'; |
| | |
| | | $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'; |
| | |
| | | $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'; |
| | |
| | | $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'; |
| | |
| | | $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'; |
| | |
| | | $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'; |
| | |
| | | $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'; |
| | |
| | | $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'; |
| | |
| | | $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'; |
| | |
| | | $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'; |
| | |
| | | $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'; |
| | |
| | | $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'; |
| | |
| | | $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'; |
| | |
| | | $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'; |
| | |
| | | $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'; |
| | |
| | | $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'; |
| | |
| | | } |
| | | /* 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; |
| | |
| | | /* 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; |
| | | } |
| | |
| | | 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); |
| | | } |
| | | |
| | | /** |