| | |
| | | } |
| | | |
| | | } else { |
| | | $app->log('Unable to write DKIM settings; Check your config!', LOGLEVEL_ERROR); |
| | | $app->log('Unable to write DKIM settings - no DKIM-Path defined', LOGLEVEL_ERROR); |
| | | $check=false; |
| | | } |
| | | return $check; |
| | |
| | | * This function adds the entry to the amavisd-config |
| | | * @param string $key_domain mail-domain |
| | | */ |
| | | function add_to_amavis($key_domain) { |
| | | function add_to_amavis($key_domain, $selector, $old_selector) { |
| | | global $app, $mail_config; |
| | | |
| | | if (empty($selector)) $selector = 'default'; |
| | |
| | | if ( substr($mail_config['dkim_path'], strlen($mail_config['dkim_path'])-1) == '/' ) |
| | | $mail_config['dkim_path'] = substr($mail_config['dkim_path'], 0, strlen($mail_config['dkim_path'])-1); |
| | | if ($this->write_dkim_key($mail_config['dkim_path']."/".$data['new']['domain'], $data['new']['dkim_private'], $data['new']['domain'])) { |
| | | if ($this->add_to_amavis($data['new']['domain'])) { |
| | | if ($this->add_to_amavis($data['new']['domain'], $data['new']['dkim_selector'], $data['old']['dkim_selector'] )) { |
| | | $this->restart_amavis(); |
| | | } else { |
| | | $this->remove_dkim_key($mail_config['dkim_path']."/".$data['new']['domain'], $data['new']['domain']); |