RE: How to forward all root server security emails to outside email address?
05-04-2015, 07:33 PM
Hi everyone,
I posted this question on stackoverflow to get more visibility and was able to solve this problem quickly with just the modification of the main.cf file of postfix.
Basically, the issue is that postfix ignores the .forward file because it thinks it's sending this email to an external address/domain. Hence the error message:
95706148387 2588 Mon May 4 03:41:22 MAILER-DAEMON
(mail for panel.myrealdomain.com loops back to myself)
root@panel.myrealdomain.com
So basically you need to inform the server that the panel.myrealdomain.com is, in fact the internal domain or local hostname. Not sure why this doesn't get setup by default with Sentora as it would seem this should be something that is configured when installing the server.
So if I run hostname in the terminal, the output is panel.mydomain.com. So emails being sent to root@panel.mydomain.com get stuck in this loop in the mailq as deferred because they can't be sent. The .forward file gets ignored because it thinks it's an external domain, only internal (local) domains reference the .forward file.
So all you have to do is edit the file /etc/postfix/main.cf
search for mydestinations, you will see something like this:
mydestination = localhost.$mydomain, localhost
now edit this line to include your domain/hostname:
mydestination = panel.mydomain.com, localhost.$mydomain, localhost
Save the file and you should be good to go. Do a test by sending a test mail to user root. It should arrive into the inbox of the email address you listed in .forward file for the root user. Bam!
check here for additional information: http://stackoverflow.com/questions/30021...S#30021216>
I posted this question on stackoverflow to get more visibility and was able to solve this problem quickly with just the modification of the main.cf file of postfix.
Basically, the issue is that postfix ignores the .forward file because it thinks it's sending this email to an external address/domain. Hence the error message:
95706148387 2588 Mon May 4 03:41:22 MAILER-DAEMON
(mail for panel.myrealdomain.com loops back to myself)
root@panel.myrealdomain.com
So basically you need to inform the server that the panel.myrealdomain.com is, in fact the internal domain or local hostname. Not sure why this doesn't get setup by default with Sentora as it would seem this should be something that is configured when installing the server.
So if I run hostname in the terminal, the output is panel.mydomain.com. So emails being sent to root@panel.mydomain.com get stuck in this loop in the mailq as deferred because they can't be sent. The .forward file gets ignored because it thinks it's an external domain, only internal (local) domains reference the .forward file.
So all you have to do is edit the file /etc/postfix/main.cf
search for mydestinations, you will see something like this:
mydestination = localhost.$mydomain, localhost
now edit this line to include your domain/hostname:
mydestination = panel.mydomain.com, localhost.$mydomain, localhost
Save the file and you should be good to go. Do a test by sending a test mail to user root. It should arrive into the inbox of the email address you listed in .forward file for the root user. Bam!
check here for additional information: http://stackoverflow.com/questions/30021...S#30021216>