Marius Cramer
2015-05-21 6b1fde7e9a450ae8e4835f7e8c2ba1f398e78c1f
server/plugins-available/mail_plugin_dkim.inc.php
@@ -75,9 +75,9 @@
    */
   function get_amavis_config() {
      $pos_config=array(
         '/etc/amavisd.conf',
         '/etc/amavisd.conf/50-user',
         '/etc/amavis/conf.d/50-user',
         '/etc/amavisd.conf',
         '/etc/amavisd/amavisd.conf'
      );
      $amavis_configfile='';
@@ -142,6 +142,11 @@
            } else {
               mkdir($mail_config['dkim_path'], 0755, true);
               $app->log('No user amavis or vscan found - using root for '.$mail_config['dkim_path'], LOGLEVEL_WARNING);
            }
            } else {
            if (!$app->system->checkpath($mail_config['dkim_path'])) {
               $app->log('Unable to write DKIM settings - invalid DKIM-Path (symlink?)', LOGLEVEL_ERROR);
               $check=false;
            }
            }
@@ -320,7 +325,7 @@
               $this->remove_dkim_key($mail_config['dkim_path']."/".$data['new']['domain'], $data['new']['domain']);
            }
         } else {
            $app->log('Error saving the DKIM Private-key for '.$data['new']['domain'].' - DKIM is not enabled for the domain.', LOGLEVEL_ERROR);
            $app->log('Error saving the DKIM Private-key for '.$data['new']['domain'].' - DKIM is not enabled for the domain.', LOGLEVEL_DEBUG);
         }
      }
   }
@@ -364,6 +369,7 @@
    */
   function domain_dkim_update($event_name, $data) {
      global $app;
      if($data['new']['dkim'] == 'y' || $data['old']['dkim'] == 'y'){
      if ($this->check_system($data)) {
         /* maildomain disabled */
         if ($data['new']['active'] == 'n' && $data['old']['active'] == 'y' && $data['new']['dkim']=='y') {
@@ -400,11 +406,12 @@
         }
         /* resync */
         if ($data['new']['active'] == 'y' && $data['new'] == $data['old']) {
            if ($data['new']['active'] == 'y' && $data['new'] == $data['old'] && $data['new']['dkim']=='y') {
            $this->add_dkim($data);
         }
      }
   }
   }
}