@@ -812,7 +812,7 @@ public function configure_mailman($status = 'insert') {
812812 public function get_postfix_service ($ service , $ type ) {
813813 global $ conf ;
814814
815- exec ("postconf -M " , $ out , $ ret );
815+ exec ("postconf -M 2> /dev/null " , $ out , $ ret );
816816
817817 if ($ ret === 0 ) { //* with postfix >= 2.9 we can detect configured services with postconf
818818 unset($ out );
@@ -822,9 +822,9 @@ public function get_postfix_service($service, $type) {
822822 }
823823 $ postfix_service = @($ out [0 ]=='' )?false :true ;
824824 } else { //* fallback - Postfix < 2.9
825- rf ($ conf ['postfix ' ]['config_dir ' ].'/master.cf ' );
826- $ regex = ' /[^#] ' .$ service .' .*. ' . $ type .' .*/ ' ;
827- $ postfix_service = @(! preg_match ($ regex , $ content ))?true :false ;
825+ $ content = rf ($ conf ['postfix ' ]['config_dir ' ].'/master.cf ' );
826+ $ regex = " /^((?!#) " .$ service ." .* " . $ type ." .*)$/m " ;
827+ $ postfix_service = @(preg_match ($ regex , $ content ))?true :false ;
828828 }
829829
830830 return $ postfix_service ;
@@ -1366,21 +1366,25 @@ public function configure_amavis() {
13661366
13671367 // Add the clamav user to the amavis group
13681368 exec ('adduser clamav amavis ' );
1369-
1370- // Create the director for DKIM-Keys
1371- if (!is_dir ('/var/lib/amavis/dkim ' )) mkdir ('/var/lib/amavis/dkim ' , 0750 , true );
1372- // get shell-user for amavis
1373- $ amavis_user =exec ('grep -o "^amavis:\|^vscan:" /etc/passwd ' );
1374- if (!empty ($ amavis_user )) {
1375- $ amavis_user =rtrim ($ amavis_user , ": " );
1376- exec ('chown ' .$ amavis_user .' /var/lib/amavis/dkim ' );
1377- }
13781369 // get shell-group for amavis
13791370 $ amavis_group =exec ('grep -o "^amavis:\|^vscan:" /etc/group ' );
13801371 if (!empty ($ amavis_group )) {
13811372 $ amavis_group =rtrim ($ amavis_group , ": " );
1382- exec ('chgrp ' .$ amavis_group .' /var/lib/amavis/dkim ' );
13831373 }
1374+ // get shell-user for amavis
1375+ $ amavis_user =exec ('grep -o "^amavis:\|^vscan:" /etc/passwd ' );
1376+ if (!empty ($ amavis_user )) {
1377+ $ amavis_user =rtrim ($ amavis_user , ": " );
1378+ }
1379+
1380+ // Create the director for DKIM-Keys
1381+ if (!is_dir ('/var/lib/amavis ' )) mkdir ('/var/lib/amavis ' , 0750 , true );
1382+ if (!empty ($ amavis_user )) exec ('chown ' .$ amavis_user .' /var/lib/amavis ' );
1383+ if (!empty ($ amavis_group )) exec ('chgrp ' .$ amavis_group .' /var/lib/amavis ' );
1384+ if (!is_dir ('/var/lib/amavis/dkim ' )) mkdir ('/var/lib/amavis/dkim ' , 0750 );
1385+ if (!empty ($ amavis_user )) exec ('chown -R ' .$ amavis_user .' /var/lib/amavis/dkim ' );
1386+ if (!empty ($ amavis_group )) exec ('chgrp -R ' .$ amavis_group .' /var/lib/amavis/dkim ' );
1387+
13841388 }
13851389
13861390 public function configure_spamassassin () {
@@ -1693,7 +1697,7 @@ public function configure_apache() {
16931697 if (is_file ('/etc/suphp/suphp.conf ' )) {
16941698 replaceLine ('/etc/suphp/suphp.conf ' , 'php="php:/usr/bin ' , 'x-httpd-suphp="php:/usr/bin/php-cgi" ' , 0 );
16951699 //replaceLine('/etc/suphp/suphp.conf','docroot=','docroot=/var/clients',0);
1696- replaceLine ('/etc/suphp/suphp.conf ' , 'umask=0077 ' , 'umask=0022 ' , 0 );
1700+ replaceLine ('/etc/suphp/suphp.conf ' , 'umask=00 ' , 'umask=0022 ' , 0 );
16971701 }
16981702
16991703 if (is_file ('/etc/apache2/sites-enabled/000-default ' )) {
0 commit comments