@@ -967,6 +967,11 @@ public function configure_postfix($options = '') {
967967 $ this ->error ("The postfix configuration directory ' $ config_dir' does not exist. " );
968968 }
969969
970+ //* Get postfix version
971+ exec ('postfix -d mail_version 2>&1 ' , $ out );
972+ $ postfix_version = preg_replace ('/.*=\s*/ ' , '' , $ out [0 ]);
973+ unset($ out );
974+
970975 //* mysql-virtual_domains.cf
971976 $ this ->process_postfix_config ('mysql-virtual_domains.cf ' );
972977
@@ -1093,6 +1098,26 @@ public function configure_postfix($options = '') {
10931098 $ postconf_tpl = strtr ($ postconf_tpl , $ postconf_placeholders );
10941099 $ postconf_commands = array_filter (explode ("\n" , $ postconf_tpl )); // read and remove empty lines
10951100
1101+ //* Merge version-specific postfix config
1102+ if (version_compare ($ postfix_version , '2.5 ' , '>= ' )) {
1103+ $ configfile = 'postfix_2-5.conf ' ;
1104+ $ content = rfsel ($ conf ['ispconfig_install_dir ' ].'/server/conf-custom/install/ ' .$ configfile .'.master ' , 'tpl/ ' .$ configfile .'.master ' );
1105+ $ content = strtr ($ content , $ postconf_placeholders );
1106+ $ postconf_commands = array_merge ($ postconf_commands , array_filter (explode ("\n" , $ content )));
1107+ }
1108+ if (version_compare ($ postfix_version , '2.10 ' , '>= ' )) {
1109+ $ configfile = 'postfix_2-10.conf ' ;
1110+ $ content = rfsel ($ conf ['ispconfig_install_dir ' ].'/server/conf-custom/install/ ' .$ configfile .'.master ' , 'tpl/ ' .$ configfile .'.master ' );
1111+ $ content = strtr ($ content , $ postconf_placeholders );
1112+ $ postconf_commands = array_merge ($ postconf_commands , array_filter (explode ("\n" , $ content )));
1113+ }
1114+ if (version_compare ($ postfix_version , '3.0 ' , '>= ' )) {
1115+ $ configfile = 'postfix_3-0.conf ' ;
1116+ $ content = rfsel ($ conf ['ispconfig_install_dir ' ].'/server/conf-custom/install/ ' .$ configfile .'.master ' , 'tpl/ ' .$ configfile .'.master ' );
1117+ $ content = strtr ($ content , $ postconf_placeholders );
1118+ $ postconf_commands = array_merge ($ postconf_commands , array_filter (explode ("\n" , $ content )));
1119+ }
1120+
10961121 //* These postconf commands will be executed on installation only
10971122 if ($ this ->is_update == false ) {
10981123 $ postconf_commands = array_merge ($ postconf_commands , array (
0 commit comments