Skip to content

Commit 864ee2f

Browse files
author
xaver
committed
fix #1747 - check for amavised for postfix rules -> pure webserver need for php sendmail, most often postfix is used for it, because admin know it. I checked different repos for differnet names, alwas amavsid or with -new.
1 parent 87dd103 commit 864ee2f

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

install/lib/installer_base.lib.php

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -909,10 +909,19 @@ public function configure_amavis() {
909909

910910

911911
// Adding the amavisd commands to the postfix configuration
912-
$postconf_commands = array (
913-
'content_filter = amavis:[127.0.0.1]:10024',
914-
'receive_override_options = no_address_mappings'
915-
);
912+
// Add array for no error in foreach and maybe future options
913+
$postconf_commands = array ();
914+
915+
// Check for amavisd -> pure webserver with postfix for mailing without antispam
916+
// Check for different names
917+
system('which amavisd-new', $retval); // Debian, Ubuntu, ?
918+
if ($retval !== 0){
919+
system('which amavisd', $retval); // CentOS
920+
}
921+
if ($retval === 0) {
922+
$postconf_commands[] = 'content_filter = amavis:[127.0.0.1]:10024';
923+
$postconf_commands[] = 'receive_override_options = no_address_mappings';
924+
}
916925

917926
// Make a backup copy of the main.cf file
918927
copy($conf['postfix']['config_dir'].'/main.cf',$conf['postfix']['config_dir'].'/main.cf~2');

0 commit comments

Comments
 (0)