@@ -122,8 +122,8 @@ function check_system($data) {
122122 $ mail_config = $ app ->getconf ->get_server_config ($ conf ['server_id ' ], 'mail ' );
123123 if ( isset ($ mail_config ['dkim_path ' ]) &&
124124 !empty ($ mail_config ['dkim_path ' ]) &&
125- isset ($ data ['new ' ]['dkim_private ' ]) &&
126- !empty ($ data ['new ' ]['dkim_private ' ]) &&
125+ // isset($data['new']['dkim_private']) &&
126+ // !empty($data['new']['dkim_private']) &&
127127 $ mail_config ['dkim_path ' ] != '/ '
128128 ) {
129129 if (!is_dir ($ mail_config ['dkim_path ' ])) {
@@ -199,6 +199,10 @@ function restart_amavis() {
199199 function write_dkim_key ($ key_file , $ key_value , $ key_domain ) {
200200 global $ app , $ mailconfig ;
201201 $ success =false ;
202+ if ($ key_file == '' || $ key_value == '' || $ key_domain == '' ) {
203+ $ app ->log ('DKIM internal error for domain ' .$ key_domain , LOGLEVEL_ERROR );
204+ return $ success ;
205+ }
202206 if ( $ app ->system ->file_put_contents ($ key_file .'.private ' , $ key_value ) ) {
203207 $ app ->log ('Saved DKIM Private-key to ' .$ key_file .'.private ' , LOGLEVEL_DEBUG );
204208 $ success =true ;
@@ -211,7 +215,7 @@ function write_dkim_key($key_file, $key_value, $key_domain) {
211215 $ app ->log ('Saved DKIM Public to ' .$ key_domain .'. ' , LOGLEVEL_DEBUG );
212216 else $ app ->log ('Unable to save DKIM Public to ' .$ key_domain .'. ' , LOGLEVEL_DEBUG );
213217 } else {
214- $ app ->log ('Unable to save DKIM Privte -key to ' .$ key_file .'.private ' , LOGLEVEL_ERROR );
218+ $ app ->log ('Unable to save DKIM Private -key to ' .$ key_file .'.private ' , LOGLEVEL_ERROR );
215219 }
216220 return $ success ;
217221 }
0 commit comments