Exim local delivery of email to root on the same HestiaCP host

I’ve just noticed the following odd behavior on my HestiaCP test server vm05 (note: behind NAT but I have tested this on another server with a public IP): When I am logged in vm05 as root at the Linux command line and use the mail command to send an email to myself (root), it doesn’t get delivered, It remains “frozen” in the Exim4 queue.

However any outbound emails from server vm05 to other servers get sent fine (e.g. the automatic “Update installed …” emails that get sent by root with envelope-from noreply@ every time HestiaCP is updated).

Please also note in Exim’s log below that another test email I sent at 02:03:47 from root to a user of a domain hosted on the same HestiaCP server (vm05) gets locally delivered fine.

So the problem seems Exim local delivery from root to root on the same HestiaCP system.

Commands and logs

Sending an email to root from the CLI never gets delivered (to /var/mail/root):

root@vm05:~# mail root
Cc: 
Subject: test
test
root@vm05:~#

/var/log/exim4/mainlog:

2022-02-03 01:55:40 Start queue run: pid=16779
2022-02-03 01:55:40 1nEkl7-0005kn-Cc Message is frozen
2022-02-03 01:55:40 1nEklD-0005ku-Dt Message is frozen
2022-02-03 01:55:40 1nF7Em-0007kI-CI Message is frozen
2022-02-03 01:55:40 1nF7Ee-0007kB-6O Message is frozen
2022-02-03 01:55:40 End queue run: pid=16779
2022-02-03 02:03:47 1nFPbH-0004St-FJ <= [email protected] U=root P=local S=398
2022-02-03 02:03:47 1nFPbH-0004St-FJ => editors <[email protected]> R=localuser T=local_delivery
2022-02-03 02:03:47 1nFPbH-0004St-FJ Completed
2022-02-03 02:25:40 Start queue run: pid=19569
2022-02-03 02:25:40 1nEkl7-0005kn-Cc Message is frozen
2022-02-03 02:25:40 1nEklD-0005ku-Dt Message is frozen
2022-02-03 02:25:40 1nF7Em-0007kI-CI Message is frozen
2022-02-03 02:25:40 1nF7Ee-0007kB-6O Message is frozen
2022-02-03 02:25:40 End queue run: pid=19569
2022-02-03 02:47:53 exim 4.92 daemon started: pid=1219, -q30m, listening for SMTP on port 25 (IPv4) port 587 (IPv4) and for SMTPS on port 465 (IPv4)
2022-02-03 02:47:53 Start queue run: pid=1221
2022-02-03 02:47:53 1nF7Ee-0007kB-6O Message is frozen
2022-02-03 02:47:53 1nEkl7-0005kn-Cc Message is frozen
2022-02-03 02:47:53 1nF7Em-0007kI-CI Message is frozen
2022-02-03 02:47:53 1nEklD-0005ku-Dt Message is frozen
2022-02-03 02:47:53 End queue run: pid=1221
2022-02-03 03:02:05 1nFQVh-0000fR-PD <= [email protected] U=root P=local S=365
2022-02-03 03:04:15 1nFQVh-0000fR-PD H=vm05.mydomain.tld [vm05-IP-address] Connection timed out
2022-02-03 03:04:15 1nFQVh-0000fR-PD == [email protected] R=dnslookup T=remote_smtp defer (110): Connection timed out
2022-02-03 03:04:15 1nFQVh-0000fR-PD ** [email protected]: retry timeout exceeded
2022-02-03 03:04:16 1nFQXn-0000g4-V0 <= <> R=1nFQVh-0000fR-PD U=Debian-exim P=local S=1566
2022-02-03 03:04:16 1nFQVh-0000fR-PD Completed
2022-02-03 03:04:16 1nFQXn-0000g4-V0 ** [email protected] R=dnslookup T=remote_smtp: all hosts for 'vm05.mydomain.tld' have been failing for a long time (and retry time not reached)
2022-02-03 03:04:16 1nFQXn-0000g4-V0 Frozen (delivery error message)

Mail queue (note: all 5 frozen emails are from root to root):

root@vm05:~# mailq
45h  2.0K 1nEkl7-0005kn-Cc <> *** frozen ***
          [email protected]

45h  1.9K 1nEklD-0005ku-Dt <> *** frozen ***
          [email protected]

21h  2.0K 1nF7Ee-0007kB-6O <> *** frozen ***
          [email protected]

21h  1.9K 1nF7Em-0007kI-CI <> *** frozen ***
          [email protected]

46m  1.5K 1nFQXn-0000g4-V0 <> *** frozen ***
          [email protected]

root@vm05:~#

The server vm05 is Debian 10 with HestiaCP 1.5.7 with minimal config.

Any ideas / suggestions?

And here is the same test on another HestiaCP host myserver, this time the email I sent from root to root (using mail from the command-line) simply vanished …

root@srv02:~# tail -20 /var/log/exim4/mainlog
2022-02-03 01:08:06 End queue run: pid=20829
2022-02-03 01:38:06 Start queue run: pid=22896
2022-02-03 01:38:06 End queue run: pid=22896
2022-02-03 02:08:06 Start queue run: pid=24899
2022-02-03 02:08:06 End queue run: pid=24899
2022-02-03 02:38:06 Start queue run: pid=27620
2022-02-03 02:38:06 End queue run: pid=27620
2022-02-03 03:03:27 1nFQX1-0007ca-8z <= [email protected] U=root P=local S=401
2022-02-03 03:03:27 1nFQX1-0007ca-8z remote host address is the local host: myserver.mydomain.tld
2022-02-03 03:03:27 1nFQX1-0007ca-8z == [email protected] R=dnslookup defer (-1): remote host address is the local host
2022-02-03 03:03:27 1nFQX1-0007ca-8z ** [email protected]: retry timeout exceeded
2022-02-03 03:03:27 1nFQX1-0007cg-KQ <= <> R=1nFQX1-0007ca-8z U=Debian-exim P=local S=1662
2022-02-03 03:03:27 1nFQX1-0007ca-8z Completed
2022-02-03 03:03:27 1nFQX1-0007cg-KQ remote host address is the local host: myserver.mydomain.tld
2022-02-03 03:03:27 1nFQX1-0007cg-KQ == [email protected] R=dnslookup defer (-1): remote host address is the local host
2022-02-03 03:03:27 1nFQX1-0007cg-KQ ** [email protected]: retry timeout exceeded
2022-02-03 03:03:27 1nFQX1-0007cg-KQ [email protected]: error ignored
2022-02-03 03:03:27 1nFQX1-0007cg-KQ Completed
2022-02-03 03:08:06 Start queue run: pid=29660
2022-02-03 03:08:06 End queue run: pid=29660

Hmm, I think this comment might be related:

in the default installation of Hestia, the server’s Mail Domain is not created, so the notifications will be dropped/ignored like

from:

Also this seems relevant:

Deliver mail addressed to root to /var/mail/mail as user mail:mail if it was not redirected in /etc/aliases or by other means Exim cannot deliver as root since 4.24 (FIXED_NEVER_USERS)
Exim - Router Configuration

Easiest fix is create

hostname.domain.com and add a root account

Does it make sense to automatically create that upon install?