should root email alias be configure?

Faris Raouf

Well-Known Member
Mar 19, 2018
147
26
58
On a fresh PM 5.2 install, I happened to run "mailq" on a node and saw that there were 8 messages to "root" that were stuck in the queue.

These messages were from smartd, trying to email "root" about some unreadable/pending disk sectors.

The messages could not be delivered because postfix could not read aliases.db, which in fact did not exist.

To fix this I just added an alias root: (my email address) to /etc/aliases and ran the newaliases command.

Should something along these lines not happen automatically during the Proxmox install? Maybe it could use the email address entered during install?
 
The PVE installation generates a /root/.forward file to forward mails to the address entered during install.
 
Well, mail.err contains:
Oct 29 14:13:42 pm2 postfix/local[11580]: error: open database /etc/aliases.db: No such file or directory
And the email is not sent.

Looking at /root/.forward, it contains:
|/usr/bin/pvemailforward

That's a binary, but I can see another file pvemailforward.pl which does what you would expect by looking up the email of the root user and sending to that.
 
The question is, why isn't it working? :)

It is logical to assume that there is an error in the way Proxmox (or postfix) is configured during Proxmox installation, which prevents mail to "root" from being sent.

Although there is a .forward file in /root, this appears to have no effect/is ignored by postfix for some reason.
 
The question is, why isn't it working? :)

It is logical to assume that there is an error in the way Proxmox (or postfix) is configured during Proxmox installation, which prevents mail to "root" from being sent.

Although there is a .forward file in /root, this appears to have no effect/is ignored by postfix for some reason.

the email address can be configure on the Proxmox VE GUI (user management).

if your postfix config is wrong, fix it, e.g. via

> dpkg-reconfigure postix
 
This is the syslog output from BEFORE I edited /etc/aliases and created /etc/aliases.db
Code:
Oct 23 07:03:08 pm2 postfix/qmgr[1555]: 776DD240E35: from=<root@pm2.cymru1.org>, size=1048, nrcpt=1 (queue active)
Oct 23 07:03:08 pm2 postfix/local[20891]: error: open database /etc/aliases.db: No such file or directory
Oct 23 07:03:08 pm2 postfix/local[20891]: warning: hash:/etc/aliases is unavailable. open database /etc/aliases.db: No such file or directory
Oct 23 07:03:08 pm2 postfix/local[20891]: warning: hash:/etc/aliases: lookup of 'root' failed
Oct 23 07:03:08 pm2 postfix/local[20891]: 776DD240E35: to=<root@pm2.cymru1.org>, orig_to=<root>, relay=local, delay=31612, delays=31612/0.01/0/0, dsn=4.3.0, status=deferred (alias database unavailable)
Oct 23 07:03:08 pm2 postfix/local[20891]: using backwards-compatible default setting relay_domains=$mydestination to update fast-flush logfile for domain "pm2.cymru1.org"
Oct 23 07:18:08 pm2 postfix/qmgr[1555]: 71907240E28: from=<root@pm2.cymru1.org>, size=1048, nrcpt=1 (queue active)
Oct 23 07:18:08 pm2 postfix/qmgr[1555]: 67CE4240E19: from=<root@pm2.cymru1.org>, size=968, nrcpt=1 (queue active)
Oct 23 07:18:08 pm2 postfix/local[23894]: error: open database /etc/aliases.db: No such file or directory
Oct 23 07:18:08 pm2 postfix/local[23894]: warning: hash:/etc/aliases is unavailable. open database /etc/aliases.db: No such file or directory
Oct 23 07:18:08 pm2 postfix/local[23894]: warning: hash:/etc/aliases: lookup of 'root' failed
Oct 23 07:18:08 pm2 postfix/local[23895]: error: open database /etc/aliases.db: No such file or directory
Oct 23 07:18:08 pm2 postfix/local[23895]: warning: hash:/etc/aliases is unavailable. open database /etc/aliases.db: No such file or directory
Oct 23 07:18:08 pm2 postfix/local[23895]: warning: hash:/etc/aliases: lookup of 'root' failed

Tom, I don't think there's anything wrong with postfix config as such. Rather, something that the Proxmox installer should have done did not get done, maybe? Or an issue with postfix itself, possible? -- decades ago, there was a version of postfix that had problems if there was no newline after the last line in the .forward file.

I can't see anything wrong in main.cf:

Code:
 See /usr/share/postfix/main.cf.dist for a commented, more complete version
myhostname=[hostname redacted -- correct hostname exists here in main.cf]
smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
biff = no
# appending .domain is the MUA's job.
append_dot_mydomain = no
# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
mydestination = $myhostname, localhost.$mydomain, localhost
relayhost =
mynetworks = 127.0.0.0/8
inet_interfaces = loopback-only
recipient_delimiter = +
 
Hi,

Run from command promt as a root:

newaliasess

- use autocomplete, as I do not have a real pc around

Anyway, if your storage have problems, do not blame Proxmox ;)
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!