If you have an SMTP server on your local network you can use the SMTP option and it will make a direct connection to your SMTP server to deliver alerts. This is how I initially had our LibreNMS installation configured and it worked fine. *
The “from” address for the alerts must be a valid looking fully qualified email address (“mail” won’t work) and ideally should be on the domain that the mail server handles, eg treats as the local domain, so it processes it as a local->local email.
For example my from field in the email settings looks like this, with the domain named obfuscated…
"LibreNMS" <[email protected]>
If the SMTP server will accept unauthenticated emails from local IP addresses (or you can add an IP exception for the LibreNMS server) this is probably the easiest approach. Depending on your mailserver config the email address may not even have to exist, as long as the domain is correct.
If your server demands SMTP authentication or you are trying to send to an SMTP server on the public internet it’s almost certainly going to require authentication. (Otherwise it would be subject to spam relaying)
*The problem I found with using the SMTP option for alerts is that if the SMTP server itself is down at the time LibreNMS tries to deliver the alert it gives up and does not retry sending the alert. (Or if it does retry, it only retries for a relatively short time then gives up)
So if the SMTP server is down for an hour or two being updated no alerts sent during that time will make it to the recipient even after the server is back up again, they will just go missing. (Fortunately I use Pushover as well as email for alerts)
So I installed Postfix on the LibreNMS (Ubuntu) server and set up a very basic forwarder configuration so that Postfix forwards all outgoing mail to the domain SMTP server, then changed LibreNMS “how to deliver mail” from “SMTP” to “mail”. This tells it to use the default mail delivery agent installed which is now Postfix.
Postfix has a proper queuing and retry mechanism which will try for days if necessary to get emails delivered, so if the target SMTP server is down, even if it is down for hours, all alerts will be sent through without missing any once it is back up, although some may arrive out of order.
If you don’t want to miss any alerts then I’d recommend this approach instead of direct SNMP, and also using an additional notification mechanism like Pushover.
I find Pushover convenient for alerts and email better for a more permanent record of alerts and as a backup mechanism. Having both is advantageous because if the mail server goes down I get Pushover alerts without delay to tell me that the mail server is down, (and wouldn’t get email alerts until after it was back up, naturally) while a complete internet outage will prevent pushover alerts from working since LibreNMS has to connect to the Pushover servers, but still allow email alerts within the locally hosted email domain to be received during the internet outage.
In either scenario I still always get an alert through at least one of the two alerting mechanisms.