-
Patch request
-
Resolution: Unresolved
-
Trivial
-
None
-
6.4.2
-
Zabbix 6.4 on Ubuntu 22.04
Steps to reproduce:
- Setup "Alert" "Media types" with "Office365 Relay"
- Configure "Email" with any domain @domain.com.br (TLD that are not just .com)
- Update configuration and MX/SMTP Server get misspelled.
Result:
SMTP server: "example.com-br.mail.protection.outlook.com"
Log entry
failed to send email: Couldn't resolve host name: Could not resolve host: domain.com-br.mail.protection.outlook.com
Expected:
SMTP server: "domain-com-br.mail.protection.outlook.com"
There's a "." (dot) after domain when should be "-" (hyphen)
domain-com-br.mail.protection.outlook.com
Fix: (WARNING)
I didn't spent a lot of time checking the code. I'm not a programmer, this change is not the best solution!! But I was able to identify the error.
zabbix/app/controllers/CControllerMediatypeUpdate.php => line 122
zabbix/app/controllers/CControllerMediatypeUpdate.php => line 132
$formatted_domain = substr_replace($domain, '-', strrpos($domain, '.'), 1);
Changed to:
$formatted_domain = str_replace('.', '-', $domain);