Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-22812

DNS error with Office 365 relay notification

XMLWordPrintable

    • Icon: Patch request Patch request
    • Resolution: Unresolved
    • Icon: Trivial Trivial
    • None
    • 6.4.2
    • Server (S)
    • Zabbix 6.4 on Ubuntu 22.04

      Steps to reproduce:

      1. Setup "Alert" "Media types" with "Office365 Relay"
      2. Configure "Email" with any domain @domain.com.br (TLD that are not just .com)
      3. 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);

            vcredidio Victor Breda Credidio
            rodrigo.camarao Rodrigo Camarao
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: