Change default admin email from root@localhost to root

mcbsys

New Member
#1
I've set up OLS 1.6.18 as part of CyberPanel. I installed from scratch on Ubuntu 20.04 LTS on Azure.

I set up ssmtp and later msmtp for sending emails from the server. Both of these programs allow configuring an alias to forward mails that are sent to the root user to an external email address (e.g. myalerts@gmail.com).

OLS has a valuable feature to send email notification when someone fails to log in to the admin panel. Maybe there are other notifications.

However, OLS by default sends email to "root@localhost". Apparently ssmtp and msmtp interpret that as a "real" email address because of the "@" sign. In both programs, the root alias does not rewrite the TO address. The mail is sent directly TO "root@localhost". It bounces because the public email host (Gmail in my case) cannot resolve "root@localhost". If there is a way to change this behavior at the system level, I would love to hear about it--I couldn't find one.

In /usr/local/lsws/conf/httpd_config.conf, I changed adminEmails from "root@localhost" to "root". msmtp immediately started forwarding emails to the external address. I later discovered that this can be configured through the OLS web UI from Server Configuration > General tab > General Settings section > Administrator Email. However, the UI does not allow setting "root" as the email.
OLS root email.png

Please change the default admin email address so it will work with ssmtp and msmtp. Probably that just means changing it to "root" without "@localhost". Also update the UI validation to allow setting "root" as the value.
 
Top