Service Auto Restart Notification Sent to root@localhost and Failed Delivery

Meiji

Verified User
Joined
Jul 2, 2019
Messages
72
Hi,

I have [email protected] in /root/.forward to forward all [email protected] emails to [email protected].
I am receiving all server notifications to this email.

But today I received an email titled "Mail delivery failed: returning message to sender" with an attachment.
I received the delivery failed notification at [email protected]

The attachment contains a notification stating OpenLiteSpeed was automatically restarted, but the notification was sent to root@localhost

Which software is sending this notification? There is no indication in exim mainlog.

How do I send the service restart notification to [email protected]?
[email protected] is being forwarded to [email protected] via /root/.forward

Here is the content of the attachment of the delivery failed notification:

Code:
Return-path: <[email protected]>
Received: from root by hotname.serverdomain.com with local (Exim 4.93.0.4)
    (envelope-from <[email protected]>)
    id 1jJ8Pj-0000hf-W8
    for root@localhost; Tue, 31 Mar 2020 04:22:12 +0000
Date: Tue, 31 Mar 2020 04:22:11 +0000
To: root@localhost
Subject: Web server /usr/local/lsws/bin/openlitespeed on
hotname.serverdomain.com is automatically restarted
User-Agent: Heirloom mailx 12.5 7/5/10
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Message-Id: <[email protected]>
From: root <[email protected]>

Edit:
This is on a fresh installation. Installed 3 days ago.
 
I don't know how you did this in /root/.forward but as far as I know a .forward file in /root is only to forward mail to [email protected] and not for admin.
Admin e-mails is setup in Directadmin itself.


Thank you for answering.

The admin email was already set up, too.

If you haven't noticed, the system sent the email to root@localhost, not [email protected] or [email protected] or [email protected]

And the delivery failed. I want to know what software sent the email and how can I change the 'to' field of the email.
 
Your welcome. Hopefully this answer helps more then my previous one.

the system sent the email to root@localhost
Which makes no difference, the forwarder in /root/.forward should normally also work for mails to root@localhost so it's still odd.

I don't know exactly which software send it, but maybe you can figure it out anoter way. I had never had issues with mails to root (either @localhost or hostname) but I did it like this.
Edit the /etc/aliases file.
At the bottom, write:
root: [email protected]
save, run the newaliases command and restart Exim.

You should at least be able to receive the full mail and maybe see where it came from.
But since the returnpath was [email protected] it might have come from Openlitespeed itself. I don't work with Openlitespeed so I'm not sure of that.
 
Which makes no difference, the forwarder in /root/.forward should normally also work for mails to root@localhost so it's still odd.


Thank you for your detailed info.

/etc/alias set up, ran newaliases, restart exim. But root@localhost emails are frozen when sent from terminal:

Code:
echo "This is a mail test" | mail -s "Hi, there is nothing more to it." root@localhost

Since it is frozen, it is safe to assume that it will generate a failed delivery notification down the line. Also tested on a second server running DA+OpenLiteSpeed

I can send emails to [email protected] from the terminal without any issue.

maybe you can figure it out anoter way.

But since the returnpath was [email protected] it might have come from Openlitespeed itself.

It would be nice if we could figure out the source of the service auto-restart notification email.

I am using LiteSpeed+cPanel for a long time and never received any such email from LiteSpeed. But I am using OpenLiteSpeed only a few months ago. I never received any such email from OLS, too.

You should at least be able to receive the full mail and maybe see where it came from.

Are you indicating that the email that failed to deliver, I could receive that email in another way?

Would you share how I can do that? I am really a novice and all I know are a few instructions only.


Edit:

I set up a server with Da+Apache, alias+ root forward setup. That server could not deliver root@localhost, too.
 
Are you indicating that the email that failed to deliver, I could receive that email in another way?
Yes I was presuming that when using the /etc/aliases edit, it might be delivered normally to the email account you would place in /etc/aliases but you tried that now and it still does not work. So in that case I'm out of idea's.

I set up a server with Da+Apache, alias+ root forward setup. That server could not deliver root@localhost, too.
Aaaah..... I'm sorry. I was confused between root and root@localhost. Exim is not sending mail to localhost by default, so you can receive mail to root, but not to root@localhost.

You might be able to fix this, by adding localhost to /etc/virtual/domains which defines which domains are allowed to send and receive mail.
However, this might be a security issue and I certainly won't leave that in there.

Best is to find out who or what is sending mail to root@localhost and change it to send mail to either just root or [email protected].

I never encountered things to send mail to root@localhost. So I guess it's in the Openlitespeed configuration. And it's better to change it there then to put localhost in the /etc/virtual/domains file.

Have a look at this:
it says:
adminEmails root@localhost
maybe there it's coming from and maybe you can change it in there?
 

Its not the same?
echo "[email protected]" > /root/.forward
Temporary fix
 
I never encountered things to send mail to root@localhost. So I guess it's in the Openlitespeed configuration. And it's better to change it there then to put localhost in the /etc/virtual/domains file.


Thank you for pointing that out.

Did that. Fingers crossed now. Let's see what happens when OLS is automatically restarted.

Is there a way to create the event, I mean, create an event where DirectAdmin automatically restarts OLS after a period of time?

Any manual restart of OLS, or during configuring something via custombuild does not generate this email notification.
 
Back
Top