Router Mail
The source material this page replaces covers installing ssmtp on OpenWrt to relay system mail from the router. ssmtp is abandoned software and does not apply to UniFi OS in any case.
For this network, system notifications reach you through two paths depending on their source:
UniFi OS alerts are handled natively by the UniFi notification system. The UDM-SE sends alerts about network events, device state changes, and security events through the UniFi platform rather than via system mail.
Homelab server alerts are handled by the Postfix null client configured in the desktop section and the server’s own monitoring setup. Cron output, system warnings, backup failures, and service alerts all go through Postfix to your mail server.
This page covers both.
UniFi OS notifications
Email notifications
Navigate to UniFi OS > Notifications > Email.
Add your email address as a notification recipient. UniFi OS sends alerts directly via its own mail relay infrastructure, not through your self-hosted mail server. This is one of the few areas where the network depends on Ubiquiti’s cloud services for alerting.
Notification categories worth enabling:
| Category | Recommended setting |
|---|---|
| Device connected | Enable |
| Device disconnected | Enable |
| Device restarted | Enable |
| Device firmware update available | Enable |
| Threat detected | Enable |
| Suspicious activity | Enable |
| VPN client connected | Optional |
| VPN client disconnected | Optional |
| ISP speed test results | Optional |
| Gateway WAN connection status | Enable |
Push notifications
If the UniFi mobile app is installed on your phone, push notifications work alongside email. The app provides faster alerting for critical events like WAN connectivity loss.
Enable push notifications in the UniFi mobile app settings after logging in to the network.
Local email via syslog forwarding
For network events that do not appear in the UniFi notification system, syslog forwarding to the homelab server captures them. Once the homelab server is running a syslog receiver, configure the UDM-SE to forward logs:
Navigate to UniFi OS > System > System Log.
Set the remote syslog server address to the homelab server:
Syslog Server: 10.1.0.x
Syslog Port: 514
On the homelab server, configure rsyslog to receive logs and optionally email specific severity levels. This is covered in the server monitoring section.
Homelab server: Postfix null client
The Postfix null client configuration from the desktop section applies identically to the homelab server. System mail generated by cron jobs, monitoring scripts, and system services is relayed to your mail server.
Install and configure on the homelab server:
sudo apt install postfix libsasl2-modules
Configure as a null client pointing at your mail server:
sudo postconf compatibility_level=3.6
sudo postconf myhostname=$(hostname -f)
sudo postconf inet_interfaces=loopback-only
sudo postconf mydestination=
sudo postconf "virtual_alias_maps=regexp:/etc/postfix/virtual_alias"
sudo postconf "relayhost=[mail.yourdomain.net]:submission"
sudo postconf smtp_sasl_auth_enable=yes
sudo postconf smtp_sasl_security_options=noanonymous
sudo postconf "smtp_sasl_password_maps=hash:/etc/postfix/smtp_password"
sudo postconf smtp_tls_security_level=secure
sudo postconf smtp_tls_CAfile=/etc/ssl/certs/ca-certificates.crt
Create the virtual alias map to redirect all system mail to your inbox:
echo "/.+@.+/ you@yourdomain.net" | sudo tee /etc/postfix/virtual_alias
sudo postmap /etc/postfix/virtual_alias
Create the SMTP credentials file:
sudo tee /etc/postfix/smtp_password << 'EOF'
[mail.yourdomain.net]:submission you@yourdomain.net:yourpassword
EOF
sudo chmod 600 /etc/postfix/smtp_password
sudo postmap /etc/postfix/smtp_password
Set up system aliases:
sudo tee -a /etc/aliases << 'EOF'
root: you@yourdomain.net
postmaster: you@yourdomain.net
EOF
sudo newaliases
sudo systemctl enable --now postfix
Refer to the desktop Postfix null client page for the complete configuration including the internal CA certificate trust step, since your mail server uses a certificate signed by your own CA.
Dedicated router mail account
The source material creates a dedicated router@example.net mail account for sending system mail. This is good practice: it separates system mail from personal mail, makes it easy to filter in your inbox, and means the credentials used for relaying system mail are distinct from personal account credentials.
Create a dedicated account on your Nextcloud or mail server for system-generated mail:
- Username:
sysmail@yourdomain.netoralerts@yourdomain.net - This account needs SMTP submission access only, not IMAP
- All mail sent by this account should be delivered to your main inbox via a server-side rule or alias
Store the account credentials in KeePassXC and reference them in /etc/postfix/smtp_password on each server.
Testing router alerts
Test UniFi notifications
Trigger a test notification from UniFi OS: disconnect and reconnect a device, or temporarily disable a LAN port. A notification should arrive via email and push within a minute or two.
Test server mail
From the homelab server:
echo "Test from $(hostname -f) at $(date)" | mail -s "Server mail test" you@yourdomain.net
Check the mail queue:
mailq
An empty queue means delivery succeeded. Check the Postfix log if the message does not arrive:
sudo journalctl -u postfix -f
Test cron mail
Verify that cron job output reaches your inbox:
crontab -e
Add a temporary test entry:
* * * * * echo "Cron test from $(hostname -f)"
Wait a couple of minutes and check your inbox. Remove the entry once confirmed.
Alert fatigue
A word on alert volume: notifications are only useful if they are acted on. An inbox full of routine alerts becomes noise that gets ignored, including the genuinely important ones.
Configure notifications conservatively:
- Enable alerts for events that require action: device offline, firmware available, WAN failure, threat detected
- Disable alerts for routine events: scheduled tasks completing successfully, regular speed test results, expected device restarts during maintenance
- Set up mail filters to sort system mail into a dedicated folder that is reviewed regularly but does not interrupt the main inbox
The monitoring setup in the server section covers more sophisticated alerting with thresholds and escalation. For the router specifically, the UniFi notification system handles the critical events well with sensible defaults.
The UDM-SE sends email via Ubiquiti’s cloud mail relay, not your own mail server. This means router alerts arrive even when your self-hosted mail server is down. It also means Ubiquiti sees your notification email address. Both are worth knowing. For the homelab server and other infrastructure, Postfix relay through your own server is the right approach.