pfSense and OPNsense alert emails via Office 365 or Gmail
pfSense and OPNsense can email you about gateway failures, interface changes, certificate expiry, and other system events. Both sign in to the SMTP server with a username and password, and have no OAuth option, so they can’t send through Microsoft 365 or Gmail directly.
With Auth-Email, you only change the mail server, port, and password in the firewall’s notification settings. Nothing needs installing on the firewall.
Before you start: link the mailbox in your Auth-Email dashboard, and choose a password for it. That is the password you’ll enter in pfSense or OPNsense – not your mailbox password.
Show the settings below for an account provided by Outlook.
pfSense
Go to System > Advanced > Notifications, and in the E-Mail section, enter:
- Disable SMTP: Unticked
- E-Mail server:
outlook.auth-email.com - SMTP Port of E-Mail server:
465 - Secure SMTP Connection: Ticked (Enable SMTP over SSL/TLS)
- Validate SSL/TLS: Ticked
- From e-mail address: The linked mailbox’s email address (e.g.,
you@outlook.com) - Notification E-Mail address: The address that should receive notifications
- Notification E-Mail auth username (optional): The linked mailbox’s full email address
- Notification E-Mail auth password: The password you chose in Auth-Email
- Notification E-Mail auth mechanism:
LOGIN(orPLAIN)
Click Save, and then Test SMTP Settings. (The test uses the saved settings, so save first.)
OPNsense
OPNsense sends email alerts using Monit. Go to Services > Monit > Settings, and on the General Settings tab, enter:
- Mail Server Address:
outlook.auth-email.com - Mail Server Port:
465 - Mail Server Username: The linked mailbox’s full email address
- Mail Server Password: The password you chose in Auth-Email
- Mail Server SSL Connection: Ticked
- SSL Version:
AUTO - Verify SSL certificates: Ticked
Then, on the Alert Settings tab, add (or edit) an alert with your address as the Recipient. Set its Mail format so that alerts come from the linked mailbox – for example, from: firewall@yourdomain.com – and click Apply.
Troubleshooting
- Authentication errors: check that the username is the full email address, and that the password is the one you chose in Auth-Email (not your mailbox password)
- Timeouts or TLS errors: check that SSL/TLS is ticked, with port
465, and that your firewall rules allow the firewall itself to connect out on that port - “Sender address rejected” or “SendAsDenied”: the From address (pfSense) or Mail format (OPNsense) must use the linked mailbox, or an address that the mailbox is allowed to send as
For other errors, such as Microsoft 365 reporting that SMTP AUTH is disabled, see fixing common errors. Your account’s connection page in the Auth-Email dashboard also shows whether pfSense or OPNsense has connected, and explains any error it received. Still stuck? Email us – we’ll help you get it working.
Related articles
Try Auth-Email with your firewall
Link your mailbox, update the firewall’s notification settings, and send a test message.
Start your free trial →No credit card needed. Check that it works, including sending yourself test messages, before you pay.