Mail to root (ZFS ZED)

kopsfd

Renowned Member
May 28, 2013
20
1
68
Dear all,

I installed a vanilla Proxmox 8.4 for test purposes. As documented in your manuals, for ZFS the ZED daemon will send notifications to root and all root mails should be forwarded to the root users emails as configured during setup-process.

Configure E-Mail Notification​

ZFS comes with an event daemon ZED, which monitors events generated by the ZFSkernel module. The daemon can also send emails on ZFS events like pool errors.Newer ZFS packages ship the daemon in a separate zfs-zed package, which shouldalready be installed by default in Proxmox VE.
You can configure the daemon via the file /etc/zfs/zed.d/zed.rc with yourfavorite editor. The required setting for email notification isZED_EMAIL_ADDR, which is set to root by default.
ZED_EMAIL_ADDR="root"
Please note Proxmox VE forwards mails to root to the email address configured for the root user.

Here I have a problem. I don't get mails from ZED and when trying to send an mail via cli (mail -s "Test" root) it won't be delivered anywhere.

(when configuring ZED to send directly to my mail-address it works as expected)

So here I have 2 problems:
- the documentation should be corrected, so that the user has to type in his own email-address into the config-files of ZED
- the internal forwarding process of root's mail should be corrected (I don't know whether other processes uses this for problem reports which can't be delivered)

If I can provide necessary log-files to inspect the failure, please tell me which files you need.

Just to be clear - other Proxmox mails will be delivered correctly (for example vzdump backup or replication error emails)

Thanks a lot.
 
As a general sidenote:

So here I have 2 problems:
- the documentation should be corrected, so that the user has to type in his own email-address into the config-files of ZED
- the internal forwarding process of root's mail should be corrected (I don't know whether other processes uses this for problem reports which can't be delivered)

Only because you have (a) problem(s), does not mean that all others have it/them too.
So, why should something in general be changed, if it works for all others?
The task is to find out, why it does not work for you and not to change things that work for everybody else.

I am not saying, that there might indeed be a general problem/bug (maybe only in edge cases); but, imo, your demand to change things in general for all, only (as it stands currently) based on your single case and without further investigation, again imo, makes no sense...

Maybe your other problem is related...:
 
Hello Neobin,

Unfortunately, I find the answer a little strange. If I may ask the other way around, how do you know that it works for everyone else except me? I could have kept my mouth shut and simply entered my email address in the ZED config - that would seem to solve the “problem” for me, but it wouldn't help anyone else!

But to go into it briefly, again in short form:
- Installing Proxmox 8.4 from the official ISO
- Entering my email address during the setup
- in this state no error mails from ZED arrive and also manually triggered mails (linux native to root) via “mail -s ‘subject’ root” are not delivered
--> this contradicts the documentation of Proxmox and seems to be a bug or something similar

--> just to clear out everything “foreign”, if I enter my gmx address (i.e. omit all own servers) it does not work either

--> as soon as I enter my native email address at ZED, the delivery works immediately (omit linux root mail)

--> Assumption: The proxmox routing of root mails does not work -> I can hardly imagine that this only affects me. What does it look like for other users who installed Proxmox 8.4 fresh from the ISO?

Thanks for the help and please no more user-bashing.

What happens, when you enter in root shell "mail -s "Test" root" plus some Text followed by Ctrl+D? Will you get an email and have you installed a fresh 8.3 or 8.4 Proxmox from official iso?

Translated with DeepL.com (free version)
 
Last edited:
If I may ask the other way around, how do you know that it works for everyone else except me? I could have kept my mouth shut and simply entered my email address in the ZED config - that would seem to solve the “problem” for me, but it wouldn't help anyone else!

Mainly: If it would be a general problem/bug affecting all installations, one would read/find ((way) more) reports about it here in the forum and on Bugzilla, for sure!
Additionally: It works for me on all my existing systems, as well as on a freshly installed PVE-VM with the 8.4 ISO.

- Installing Proxmox 8.4 from the official ISO
- Entering my email address during the setup
- in this state no error mails from ZED arrive and also manually triggered mails (linux native to root) via “mail -s ‘subject’ root” are not delivered

I do not know how it works with an local mail server (if you are having/using one) respectively with the default mail-to-root sendmail notification target, but since I do not have one, I need to add an SMTP notification target and change (for a quick test) the default-matcher to it. After that, I get all mails, e.g.: ZFS, apt-listchanges, manually invoked mail to root.

[...] please no more user-bashing.

Mh?

What happens, when you enter in root shell "mail -s "Test" root" plus some Text followed by Ctrl+D? Will you get an email and have you installed a fresh 8.3 or 8.4 Proxmox from official iso?

Yes and yes.

[0] https://pve.proxmox.com/pve-docs/chapter-notifications.html
[0] https://pve.proxmox.com/pve-docs/pve-admin-guide.html#datacenter_configuration_file -> email_from might be relevant for your setup?
 
... thanks a lot - this post is lot of better than the first one.

I'll try to answer:

--> The strange behavior is, that emails from pve will be delivered and mails from the "root" mail aren't delivered to me. Therefor I didn't think that "notifications" are wrong configured - in the first try it was the standard from installation media.

According to your thoughts and my second post, I setup a smtp routine (which works now). The Test Email is delivered without problems. But still root-mails won't get delivered to me.

I just checked journalctl and found an error from postfix which claims, that alias-database isn't found. After checking, it seems that all of my root-mails stuck in postfix's mailq.

What is wrong in this point? I never read, that I also have to configure postfix as well. I hoped, that proxmox is shipped with a working email-directive.

What should I do, that it will work?
 
Following post did the change:


After typing "newaliases" and cleaning the mailq -> all new mails via root-matcher seems to work now.

Now my question: Could it be a bug, that proxmox is deliverd without a alias db for postfix?