So I have noticed that my mailq deferred list has a lot of emails in it that are supposed to be going to the root user, but since the root user is pointing to the local hostname which doesn't exist outside of the server, these messages are going undelivered.
For example, mailq looks like this:
root@panel:~# mailq
-Queue ID- --Size-- ----Arrival Time---- -Sender/Recipient-------
3FCDA148331 571 Sun May 3 12:46:40 testuser@panel.mydomain.com
(mail for panel.mydomain.com loops back to myself)
root@panel.mydomain.com
So, at first there was a bunch of emails in here trying to be sent to root@panel.mydomain.com, which doesn't exist. It's just the local hostname of the server. These were error notifications being created by cron. So I was able to fix that by editing crontab -e and adding:
# Set Mailto Address for Cron Errors
MAILTO="myemail@gmail.com"
now all cron error emails go to my gmail account and all is good. However, this only affects cron of course. So now when there is a general security issue on the site, such as a user attempting to do something they shouldn't, it says attempt logged and will be notified. Then an email is made to be sent to the root user to notify of the security issue.
I have searched high and dry and cannot figure out how to just get this darn thing to forward any emails for root to a real email address. Anyone know how I can do this?
I found online a few suggestions, but none of them seemed to work. For example:
1.) editing /etc/aliases and adding:
root: myemail@gmail.com
then running "newaliases" and then service postfix restart.
Emails are still being attempted at root@mydomain.com
2.) creating a forward file
# cd ~
# nano .forward
adding one line with "myemail@gmail.com"
saving the file
Alerts still get generated to the root@mydomain.com address.
Any idea on what I am doing wrong? Is there a setting in Sentora that is overwriting what I am doing?
Please help...thank you!
For example, mailq looks like this:
root@panel:~# mailq
-Queue ID- --Size-- ----Arrival Time---- -Sender/Recipient-------
3FCDA148331 571 Sun May 3 12:46:40 testuser@panel.mydomain.com
(mail for panel.mydomain.com loops back to myself)
root@panel.mydomain.com
So, at first there was a bunch of emails in here trying to be sent to root@panel.mydomain.com, which doesn't exist. It's just the local hostname of the server. These were error notifications being created by cron. So I was able to fix that by editing crontab -e and adding:
# Set Mailto Address for Cron Errors
MAILTO="myemail@gmail.com"
now all cron error emails go to my gmail account and all is good. However, this only affects cron of course. So now when there is a general security issue on the site, such as a user attempting to do something they shouldn't, it says attempt logged and will be notified. Then an email is made to be sent to the root user to notify of the security issue.
I have searched high and dry and cannot figure out how to just get this darn thing to forward any emails for root to a real email address. Anyone know how I can do this?
I found online a few suggestions, but none of them seemed to work. For example:
1.) editing /etc/aliases and adding:
root: myemail@gmail.com
then running "newaliases" and then service postfix restart.
Emails are still being attempted at root@mydomain.com
2.) creating a forward file
# cd ~
# nano .forward
adding one line with "myemail@gmail.com"
saving the file
Alerts still get generated to the root@mydomain.com address.
Any idea on what I am doing wrong? Is there a setting in Sentora that is overwriting what I am doing?
Please help...thank you!