I’ve got a script which will restart a bunch of services periodically, including mysql. It ran recently and I got the following mail.
Date: Tue, 27 Apr 2021 05:05:03 +0800
From: Mail Delivery System <[email protected]>
To: [email protected]
Subject: Mail failure - malformed recipient address
A message that you sent contained one or more recipient addresses that were
incorrectly constructed:
< >: missing or malformed local part
This address has been ignored. There were no other addresses in your
message, and so no attempt at delivery was possible.
------ This is a copy of your message, including all the headers. ------
To: < >
Subject: =?utf-8?B?Cg==?=
From: Hestia Control Panel <[email protected]>
X-Priority: 3 (Normal)
CC:
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Mailer: Php/libMailv1.3
Message-Id: <[email protected]>
Date: Tue, 27 Apr 2021 05:05:03 +0800
Can't connect to MySQL localhost
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/run/mysqld/mysqld.sock' (2)
So the fact that the message was sent is absolutely fine. I know Mysql was busy rebooting at this time, and I think Hestia might have been trying to do a backup or something.
But the email is sent with a blank To: field, and a nonsense Subject, which means it doesn’t get to where its meant to go, and bounces back to root@. I get other emails to the correct address, such as when Hestia updates itself, and the ‘notify me’ setting is set.
So I’m thinking there’s some legacy code somewhere which might not be picking up these settings, which should probably be fixed. I’ve found the send_email function, but that seems to be part of the web code (ie, used from the control panel). I’ve located a function in func/db.sh that looks likely, which seems to fire off when there is no connection.
Any ideas? Is this worth raising as a bug or will 1.4 fix everything!