@@ -106,7 +106,7 @@ function update($event_name, $data) {
106106 $ vhost_port_listen = '# ' ;
107107 }
108108 $ tpl ->setVar ('vhost_port_listen ' , $ vhost_port_listen );
109-
109+
110110 $ mail_config = $ app ->getconf ->get_server_config ($ conf ['server_id ' ], 'mail ' );
111111 if ($ mail_config ['content_filter ' ] == 'rspamd ' ){
112112 $ use_rspamd = true ;
@@ -127,6 +127,17 @@ function update($event_name, $data) {
127127 $ content = str_replace ('{apps_vhost_basedir} ' , $ web_config ['website_basedir ' ], $ content );
128128 $ content = str_replace ('{vhost_port_listen} ' , $ vhost_port_listen , $ content );
129129 /* end of backwards compatibility section */
130+ /* Check if SSL should be enabled: */
131+ if (is_file ($ install_dir .'/interface/ssl/ispserver.crt ' ) && is_file ($ install_dir .'/interface/ssl/ispserver.key ' )) {
132+ $ tpl ->setVar ('ssl_comment ' ,'' );
133+ } else {
134+ $ tpl ->setVar ('ssl_comment ' ,'# ' );
135+ }
136+ if (is_file ($ install_dir .'/interface/ssl/ispserver.crt ' ) && is_file ($ install_dir .'/interface/ssl/ispserver.key ' ) && is_file ($ install_dir .'/interface/ssl/ispserver.bundle ' )) {
137+ $ tpl ->setVar ('ssl_bundle_comment ' ,'' );
138+ } else {
139+ $ tpl ->setVar ('ssl_bundle_comment ' ,'# ' );
140+ }
130141
131142 $ app ->system ->file_put_contents ("$ vhost_conf_dir/apps.vhost " , $ content );
132143
@@ -194,7 +205,7 @@ function update($event_name, $data) {
194205 }
195206 $ content = str_replace ('{use_tcp} ' , $ use_tcp , $ content );
196207 $ content = str_replace ('{use_socket} ' , $ use_socket , $ content );
197-
208+
198209 $ mail_config = $ app ->getconf ->get_server_config ($ conf ['server_id ' ], 'mail ' );
199210 if ($ mail_config ['content_filter ' ] == 'rspamd ' ){
200211 $ use_rspamd = '' ;
0 commit comments