Commit 5dcb3afd authored by Jesse Norell's avatar Jesse Norell
Browse files

recipient_delimiter can be a list of characters

parent 9ab1b1ef
......@@ -776,10 +776,15 @@ class installer_base {
exec('postconf -h recipient_delimiter 2>/dev/null', $out);
if (strlen($out[0]) > 0) {
$recipient_delimiter = $this->db->escape( str_replace('%', '%%', $out[0]) );
$addr_no_extension = "CONCAT(SUBSTRING_INDEX('%u', '${recipient_delimiter}', 1), '@%d')";
// build string like: CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX('%u', '%%', 1), '+', 1), '@%d')
$addr_cleanup = "'%u'";
foreach (str_split($out[0]) as $delim) {
$recipient_delimiter = $this->db->escape( str_replace('%', '%%', $delim) );
$addr_cleanup = "SUBSTRING_INDEX(${addr_cleanup}, '${recipient_delimiter}', 1)";
}
$no_addr_extension = "CONCAT(${addr_cleanup}, '@%d')";
} else {
$addr_no_extension = "'%s'";
$no_addr_extension = "''";
}
unset($out);
......@@ -790,7 +795,7 @@ class installer_base {
$content = str_replace('{mysql_server_database}', $conf['mysql']['database'], $content);
$content = str_replace('{mysql_server_ip}', $conf['mysql']['ip'], $content);
$content = str_replace('{server_id}', $conf['server_id'], $content);
$content = str_replace('{address_without_extension}', $addr_no_extension, $content);
$content = str_replace('{address_without_extension}', $no_addr_extension, $content);
wf($full_file_name, $content);
//* Changing mode and group of the new created config file
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment