@@ -567,23 +567,6 @@ public function configure_mailman($status = 'insert') {
567567 }
568568 }
569569 }
570-
571- $ config_dir = $ conf ['mailman ' ]['config_dir ' ].'/ ' ;
572- $ full_file_name = $ config_dir .'virtual_to_transport.sh ' ;
573-
574- //* Backup exiting virtual_to_transport.sh script
575- if (is_file ($ full_file_name )) {
576- copy ($ full_file_name , $ config_dir .'virtual_to_transport.sh~ ' );
577- }
578-
579- copy ('tpl/mailman-virtual_to_transport.sh ' ,$ full_file_name );
580- chgrp ($ full_file_name ,'list ' );
581- chmod ($ full_file_name ,0750 );
582-
583- if (!is_file ('/var/lib/mailman/data/transport-mailman ' )) touch ('/var/lib/mailman/data/transport-mailman ' );
584- exec ('/usr/sbin/postmap /var/lib/mailman/data/transport-mailman ' );
585-
586- exec ('/usr/lib/mailman/bin/genaliases 2>/dev/null ' );
587570
588571 $ virtual_domains = '' ;
589572 if ($ status == 'update ' )
@@ -608,8 +591,27 @@ public function configure_mailman($status = 'insert') {
608591 if (!isset ($ old_options ['DEFAULT_SERVER_LANGUAGE ' ])) $ old_options ['DEFAULT_SERVER_LANGUAGE ' ] = '' ;
609592 $ content = str_replace ('{default_language} ' , $ old_options ['DEFAULT_SERVER_LANGUAGE ' ], $ content );
610593 $ content = str_replace ('{virtual_domains} ' , $ virtual_domains , $ content );
611-
594+
612595 wf ($ full_file_name , $ content );
596+
597+ //* Write virtual_to_transport.sh script
598+ $ config_dir = $ conf ['mailman ' ]['config_dir ' ].'/ ' ;
599+ $ full_file_name = $ config_dir .'virtual_to_transport.sh ' ;
600+
601+ //* Backup exiting virtual_to_transport.sh script
602+ if (is_file ($ full_file_name )) {
603+ copy ($ full_file_name , $ config_dir .'virtual_to_transport.sh~ ' );
604+ }
605+
606+ if (is_dir ('/etc/mailman ' )) {
607+ copy ('tpl/mailman-virtual_to_transport.sh ' ,$ full_file_name );
608+ chgrp ($ full_file_name ,'list ' );
609+ chmod ($ full_file_name ,0750 );
610+ }
611+
612+ //* Create aliasaes
613+ exec ('/usr/lib/mailman/bin/genaliases 2>/dev/null ' );
614+
613615 }
614616
615617 public function configure_postfix ($ options = '' ) {
@@ -732,11 +734,13 @@ public function configure_postfix($options = '') {
732734 touch ($ config_dir .'/body_checks ' );
733735
734736 //* Create the mailman files
735- exec ('mkdir -p /var/lib/mailman/data ' );
737+ if (! is_dir ( ' /var/lib/mailman/data ' )) exec ('mkdir -p /var/lib/mailman/data ' );
736738 if (!is_file ('/var/lib/mailman/data/aliases ' )) touch ('/var/lib/mailman/data/aliases ' );
737739 exec ('postalias /var/lib/mailman/data/aliases ' );
738740 if (!is_file ('/var/lib/mailman/data/virtual-mailman ' )) touch ('/var/lib/mailman/data/virtual-mailman ' );
739741 exec ('postmap /var/lib/mailman/data/virtual-mailman ' );
742+ if (!is_file ('/var/lib/mailman/data/transport-mailman ' )) touch ('/var/lib/mailman/data/transport-mailman ' );
743+ exec ('/usr/sbin/postmap /var/lib/mailman/data/transport-mailman ' );
740744
741745 //* Make a backup copy of the main.cf file
742746 copy ($ config_dir .'/main.cf ' , $ config_dir .'/main.cf~ ' );
@@ -1921,16 +1925,16 @@ public function install_ispconfig() {
19211925 symlink ($ vhost_conf_dir .'/ispconfig.vhost ' ,$ vhost_conf_enabled_dir .'/000-ispconfig.vhost ' );
19221926 }
19231927 }
1924- if (!is_file ('/var/www/php-fcgi-scripts/ispconfig/.php-fcgi-starter ' )) {
1928+ // if(!is_file('/var/www/php-fcgi-scripts/ispconfig/.php-fcgi-starter')) {
19251929 $ content = rf ('tpl/apache_ispconfig_fcgi_starter.master ' );
19261930 $ content = str_replace ('{fastcgi_bin} ' , $ conf ['fastcgi ' ]['fastcgi_bin ' ], $ content );
19271931 $ content = str_replace ('{fastcgi_phpini_path} ' , $ conf ['fastcgi ' ]['fastcgi_phpini_path ' ], $ content );
1928- mkdir ('/var/www/php-fcgi-scripts/ispconfig ' , 0755 , true );
1932+ @ mkdir ('/var/www/php-fcgi-scripts/ispconfig ' , 0755 , true );
19291933 wf ('/var/www/php-fcgi-scripts/ispconfig/.php-fcgi-starter ' , $ content );
19301934 exec ('chmod +x /var/www/php-fcgi-scripts/ispconfig/.php-fcgi-starter ' );
1931- symlink ($ install_dir .'/interface/web ' ,'/var/www/ispconfig ' );
1935+ @ symlink ($ install_dir .'/interface/web ' ,'/var/www/ispconfig ' );
19321936 exec ('chown -R ispconfig:ispconfig /var/www/php-fcgi-scripts/ispconfig ' );
1933- }
1937+ // }
19341938 }
19351939
19361940 if ($ conf ['nginx ' ]['installed ' ] == true && $ this ->install_ispconfig_interface == true ){
@@ -2116,7 +2120,7 @@ public function install_crontab() {
21162120 $ existing_cron_jobs = file ('crontab.txt ' );
21172121
21182122 $ cron_jobs = array (
2119- '*/5 * * * * /usr/local/bin/run-getmail.sh > /dev/null 2>> ' . $ conf [ ' ispconfig_log_dir ' ]. ' /cron.log '
2123+ '*/5 * * * * /usr/local/bin/run-getmail.sh > /dev/null 2>> /dev/null '
21202124 );
21212125
21222126 // remove existing ispconfig cronjobs, in case the syntax has changed
@@ -2135,7 +2139,7 @@ public function install_crontab() {
21352139 }
21362140
21372141 touch ($ conf ['ispconfig_log_dir ' ].'/cron.log ' );
2138- chmod ($ conf ['ispconfig_log_dir ' ].'/cron.log ' , 0666 );
2142+ chmod ($ conf ['ispconfig_log_dir ' ].'/cron.log ' , 0660 );
21392143
21402144 }
21412145
0 commit comments