@@ -775,9 +775,22 @@ public function configure_postfix($options = '') {
775775
776776 public function configure_saslauthd () {
777777 global $ conf ;
778+
779+ //* Get saslsauthd version
780+ exec ('saslauthd -v 2>&1 ' ,$ out );
781+ $ parts = explode (' ' ,$ out [0 ]);
782+ $ saslversion = $ parts [1 ];
783+ unset($ parts );
784+ unset($ out );
778785
779-
780- $ configfile = 'sasl_smtpd.conf ' ;
786+ if (version_compare ($ saslversion , '2.1.23 ' ) > 0 ) {
787+ //* Configfile for saslauthd versions 2.1.24 and newer
788+ $ configfile = 'sasl_smtpd2.conf ' ;
789+ } else {
790+ //* Configfile for saslauthd versions up to 2.1.23
791+ $ configfile = 'sasl_smtpd.conf ' ;
792+ }
793+
781794 if (is_file ($ conf ['postfix ' ]['config_dir ' ].'/sasl/smtpd.conf ' )) copy ($ conf ['postfix ' ]['config_dir ' ].'/sasl/smtpd.conf ' ,$ conf ['postfix ' ]['config_dir ' ].'/sasl/smtpd.conf~ ' );
782795 if (is_file ($ conf ['postfix ' ]['config_dir ' ].'/sasl/smtpd.conf~ ' )) chmod ($ conf ['postfix ' ]['config_dir ' ].'/sasl/smtpd.conf~ ' , 0400 );
783796 $ content = rf ('tpl/ ' .$ configfile .'.master ' );
@@ -1417,7 +1430,7 @@ public function configure_vlogger() {
14171430 $ content = str_replace ('{mysql_server_ispconfig_user} ' ,$ conf ['mysql ' ]['ispconfig_user ' ],$ content );
14181431 $ content = str_replace ('{mysql_server_ispconfig_password} ' ,$ conf ['mysql ' ]['ispconfig_password ' ], $ content );
14191432 $ content = str_replace ('{mysql_server_database} ' ,$ conf ['mysql ' ]['database ' ],$ content );
1420- $ content = str_replace ('{mysql_server_ip} ' ,$ conf ['mysql ' ]['host ' ],$ content );
1433+ $ content = str_replace ('{mysql_server_ip} ' ,$ conf ['mysql ' ]['ip ' ],$ content );
14211434 }
14221435 wf ($ conf ['vlogger ' ]['config_dir ' ].'/ ' .$ configfile ,$ content );
14231436 chmod ($ conf ['vlogger ' ]['config_dir ' ].'/ ' .$ configfile , 0600 );
0 commit comments