Alerts can´t send SMTP mails

Hello guys,

a few days ago I decided to setup a LibreNMS server on my linux machine. Only thing left is automatically sending mails via SMTP. I recieve mails when testing the transport over the webUI and when executing test_alerts.php. Here´s the output:

SQL[select * from `devices` where `hostname` = ? limit 1 [""] 1.59ms]

SQL[SELECT, alerts.alerted, alerts.device_id, alerts.rule_id, alerts.state, alerts.note, FROM alerts WHERE alerts.device_id = 1 && alerts.rule_id = 1 [] 0.87ms]

SQL[SELECT,alert_log.rule_id,alert_log.device_id,alert_log.state,alert_log.details,alert_log.time_logged,alert_rules.rule,alert_rules.severity,alert_rules.extra,,alert_rules.query,alert_rules.builder,alert_rules.proc FROM alert_log,alert_rules WHERE alert_log.rule_id = && alert_log.device_id = ? && alert_log.rule_id = ? && alert_rules.disabled = 0 ORDER BY DESC LIMIT 1 [1,1] 0.96ms]

SQL[SELECT DISTINCT a.* FROM alert_rules a
        LEFT JOIN alert_device_map d ON AND (a.invert_map = 0 OR a.invert_map = 1 AND d.device_id = ?)
        LEFT JOIN alert_group_map g ON AND (a.invert_map = 0 OR a.invert_map = 1 AND g.group_id IN (SELECT DISTINCT device_group_id FROM device_group_device WHERE device_id = ?))
        LEFT JOIN alert_location_map l ON AND (a.invert_map = 0 OR a.invert_map = 1 AND l.location_id IN (SELECT DISTINCT location_id FROM devices WHERE device_id = ?))
        LEFT JOIN device_group_device dg ON g.group_id=dg.device_group_id AND dg.device_id = ?
        WHERE a.disabled = 0 AND (
            (d.device_id IS NULL AND g.group_id IS NULL)
            OR (a.invert_map = 0 AND (d.device_id=? OR dg.device_id=?))
            OR (a.invert_map = 1  AND (d.device_id != ? OR d.device_id IS NULL) AND (dg.device_id != ? OR dg.device_id IS NULL))
        ) [1,1,1,1,1,1,1,1] 2.72ms]

SQL[SELECT hostname, sysName, sysDescr, sysContact, os, type, ip, hardware, version, purpose, notes, uptime, status, status_reason, locations.location FROM devices LEFT JOIN locations ON = devices.location_id WHERE device_id = ? [1] 0.76ms]

SQL[select * from `devices_attribs` where `devices_attribs`.`device_id` = ? and `devices_attribs`.`device_id` is not null [1] 0.64ms]

SQL[select * from `device_perf` where `device_id` = ? order by `timestamp` desc limit 1 [1] 0.74ms]

SQL[select * from `alert_templates` where exists (select * from `alert_template_map` where `alert_templates`.`id` = `alert_template_map`.`alert_templates_id` and `alert_rule_id` = ?) limit 1 [1] 0.87ms]

SQL[select * from `alert_templates` where `name` = ? limit 1 ["Default Alert Template"] 0.75ms]

Issuing Alert-UID #1/1:
SQL[SELECT `rule_id` FROM `alerts` WHERE `id`=? [1] 0.47ms]

SQL[SELECT b.transport_id, b.transport_type, b.transport_name FROM alert_transport_map AS a LEFT JOIN alert_transports AS b ON b.transport_id=a.transport_or_group_id WHERE a.target_type='single' AND a.rule_id=? UNION DISTINCT SELECT d.transport_id, d.transport_type, d.transport_name FROM alert_transport_map AS a LEFT JOIN alert_transport_groups AS b ON a.transport_or_group_id=b.transport_group_id LEFT JOIN transport_group_transport AS c ON b.transport_group_id=c.transport_group_id LEFT JOIN alert_transports AS d ON c.transport_id=d.transport_id WHERE a.target_type='group' AND a.rule_id=? [1,1] 0.78ms]

SQL[SELECT transport_id, transport_type, transport_name FROM alert_transports WHERE is_default=true [] 0.45ms]

 :: Transport mail => SQL[SELECT `transport_config` FROM `alert_transports` WHERE `transport_id`=? [1] 0.56ms]

Attempting to email Alert for device - ress to: [email protected]
OKSQL[insert into `eventlog` (`device_id`, `reference`, `type`, `datetime`, `severity`, `message`, `username`) values (?, ?, ?, ?, ?, ?, ?) [1,null,"alert","2021-05-04 16:43:07",4,"Issued warning alert for rule 'ress' to transport 'mail'",""] 1.62ms]

Everything should work then, right?
But the eventlog always shows the following errors when the alert is trying to send mails automatically (one entry was caused by me manually triggering the alert):

The output of my validate.php:


Component Version
LibreNMS 21.4.0
DB Schema 2021_04_08_151101_add_foreign_keys_to_port_group_port_table (208)
PHP 7.4.15
Python 3.8.8
MySQL 10.5.9-MariaDB-1:10.5.9+maria~focal
RRDTool 1.7.2

[OK] Installed from the official Docker image; no Composer required
[OK] Database connection successful
[OK] Database schema correct
[WARN] IPv6 is disabled on your server, you will not be able to add IPv6 devices.
[WARN] Updates are managed through the official Docker image

I hope someone has an idea, because I really like LibreNMS so far.
Thanks in advance

Could not connect to SMTP host

Have you configured a valid SMTP server in the UI? Is the server allowing mail from your LibreNMS server? You may want to take a look at the logs on the SMTP server for more information.

Yes I did. When I test the alert transport, the mail comes through. The LibreNMS server runs in a container ( We also have a Jenkins-Server running (also as docker), which is successfully using our SMTP server.

This topic was automatically closed 186 days after the last reply. New replies are no longer allowed.