@@ -117,14 +117,14 @@ function check_system($data) {
117117 $ app ->log ('Amavis-config not found or not writeable. ' , LOGLEVEL_ERROR );
118118 $ check =false ;
119119 }
120+
120121 /* dir for dkim-keys writeable? */
121122 $ mail_config = $ app ->getconf ->get_server_config ($ conf ['server_id ' ], 'mail ' );
122123 if ( isset ($ mail_config ['dkim_path ' ]) &&
123124 !empty ($ mail_config ['dkim_path ' ]) &&
124125 isset ($ data ['new ' ]['dkim_private ' ]) &&
125126 !empty ($ data ['new ' ]['dkim_private ' ]) &&
126- $ mail_config ['dkim_path ' ] != '/ ' &&
127- $ app ->system ->checkpath ($ mail_config ['dkim_path ' ])
127+ $ mail_config ['dkim_path ' ] != '/ '
128128 ) {
129129 if (!is_dir ($ mail_config ['dkim_path ' ])) {
130130 $ app ->log ('DKIM Path ' .$ mail_config ['dkim_path ' ].' not found - (re)created. ' , LOGLEVEL_DEBUG );
@@ -150,6 +150,11 @@ function check_system($data) {
150150 $ check =false ;
151151 }
152152
153+ if ( !$ app ->system ->checkpath ($ mail_config ['dkim_path ' ]) ) {
154+ $ app ->log ('DKIM Path ' .$ mail_config ['dkim_path ' ].' failed in checkpath. ' , LOGLEVEL_ERROR );
155+ $ check = false ;
156+ }
157+
153158 } else {
154159 $ app ->log ('Unable to write DKIM settings - no or invalid DKIM-Path defined ' , LOGLEVEL_ERROR );
155160 $ check =false ;
@@ -184,7 +189,7 @@ function restart_amavis() {
184189 * @param string $key_file full path to the key-file
185190 * @param string $key_value private-key
186191 * @param string $key_domain mail-domain
187- * @return bool - true when the key is written to disk
192+ * @return bool - true when the private key was written to disk
188193 */
189194 function write_dkim_key ($ key_file , $ key_value , $ key_domain ) {
190195 global $ app , $ mailconfig ;
0 commit comments