@@ -774,13 +774,28 @@ public function process_postfix_config($configfile) {
774774 chmod ($ config_dir .$ configfile .'~ ' ,0600 );
775775 }
776776
777+ exec ('postconf -h recipient_delimiter 2>/dev/null ' , $ out );
778+ if (strlen ($ out [0 ]) > 0 ) {
779+ // build string like: CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX('%u', '%%', 1), '+', 1), '@%d')
780+ $ addr_cleanup = "'%u' " ;
781+ foreach (str_split ($ out [0 ]) as $ delim ) {
782+ $ recipient_delimiter = $ this ->db ->escape ( str_replace ('% ' , '%% ' , $ delim ) );
783+ $ addr_cleanup = "SUBSTRING_INDEX( $ {addr_cleanup}, ' $ {recipient_delimiter}', 1) " ;
784+ }
785+ $ no_addr_extension = "CONCAT( $ {addr_cleanup}, '@%d') " ;
786+ } else {
787+ $ no_addr_extension = "'' " ;
788+ }
789+ unset($ out );
790+
777791 //* Replace variables in config file template
778792 $ content = rfsel ($ conf ['ispconfig_install_dir ' ].'/server/conf-custom/install/ ' .$ configfile .'.master ' , 'tpl/ ' .$ configfile .'.master ' );
779793 $ content = str_replace ('{mysql_server_ispconfig_user} ' , $ conf ['mysql ' ]['ispconfig_user ' ], $ content );
780794 $ content = str_replace ('{mysql_server_ispconfig_password} ' , $ conf ['mysql ' ]['ispconfig_password ' ], $ content );
781795 $ content = str_replace ('{mysql_server_database} ' , $ conf ['mysql ' ]['database ' ], $ content );
782796 $ content = str_replace ('{mysql_server_ip} ' , $ conf ['mysql ' ]['ip ' ], $ content );
783797 $ content = str_replace ('{server_id} ' , $ conf ['server_id ' ], $ content );
798+ $ content = str_replace ('{address_without_extension} ' , $ no_addr_extension , $ content );
784799 wf ($ full_file_name , $ content );
785800
786801 //* Changing mode and group of the new created config file
@@ -1418,7 +1433,7 @@ public function configure_dovecot() {
14181433 $ configure_lmtp = false ;
14191434
14201435 // use lmtp if installed
1421- if ($ configure_lmtp = is_file ('/usr/lib/dovecot/lmtp ' )) {
1436+ if ($ configure_lmtp = ( is_file ('/usr/lib/dovecot/lmtp ' ) || is_file ( ' /usr/libexec/dovecot/lmtp ' ) )) {
14221437 $ virtual_transport = 'lmtp:unix:private/dovecot-lmtp ' ;
14231438 }
14241439
@@ -1577,7 +1592,7 @@ public function configure_dovecot() {
15771592 }
15781593
15791594 //* dovecot-managesieved
1580- if (is_file ('/usr/lib/dovecot/managesieve ' )) {
1595+ if (is_file ('/usr/lib/dovecot/managesieve ' ) || is_file ( ' /usr/libexec/dovecot/managesieve ' ) ) {
15811596 $ dovecot_protocols .= ' sieve ' ;
15821597 }
15831598
0 commit comments