SMTP notifications configured in PVE: no emails to root

p3ter_b

New Member
Mar 20, 2024
20
13
3
Hi everyone! :)

I've configured (and tested) a SMTP notification method in PVE: works perfectly! I get emails.
Now I'd like to also get ZFS notifications from ZED?

I understood reading on proxmox-email-forward that it should automatically forward local mail to root@pam (=root@localhost?), but : I get no emails.

I've read up on several threads on this forum, including the source for most of them:
https://www.thomas-krenn.com/en/wiki/Configure_and_create_mail_notifications_in_Proxmox_VE

PVE email: works.
ZFS email: silence.

Any help/hints greatly appreciated!
Thank you :)
 
Any help/hints greatly appreciated!
No direct help but only a hint: you need to search for "setup Postfix with authentication on Debian" or similar. You will find a zillion articles; I have no specific one to recommend.
 
Thanks @UdoB for your reply! :)

I am able to setup eMail forwarding etc on Debian-based systems, however I was interested to know the "Proxmox-intended, pre-configured way" of things, in order not to cross-interfere with the existing config - and stay compatible.
 
PVE email: works.
ZFS email: silence.

So I assume you are talking about a Proxmox VE system? I'm asking since you opened this thread in the "Proxmox Datacenter Manager" subforum.

On Proxmox VE, the way to go is to ensure that ZED sends emails to the 'root' user, so the ZED config should contain the following line:

Code:
ZED_EMAIL_ADDR="root"

proxmox-mail-forward will intercept any mails sent to the local root user and feed them into the PVE notification stack as a notification event of type 'system-mail'. Make sure that this one is matched by a notification matcher and forwarded to the intended notification target.
I understood reading on proxmox-email-forward that it should automatically forward local mail to root@pam (=root@localhost?), but : I get no emails.

The default notification matcher will (default-matcher) will match on all notification events (including mails sent to the local `root` user) and use the 'mail-to-root' notification target. The 'mail-to-root' target is a target of type 'sendmail' which will send an email to the email-address associated with the root@pam user in PVE. This is the email address entered during PVE installation, it can be seen/changed in the user configuration UI.

Hope this helps!
 
  • Like
Reactions: UdoB
@Lukas Wagner : Thank you so much!
That's quite likely exactly what I was looking for.

I'll check the the notification matching configuration.

PS: And thanks for "assuming absolutely right!" and in my interest and with best intentions. I'm used to Samba mailing list netiquette, which clearly states "please don't state the obvious, and keep the noise down", which I think makes sense?
 
Last edited:
I've added a Notification target "arkthis" type "sendmail" - and configured my SMTP server login.
I presume this is necessary for "mail-to-root" to even leave the localhost's sendmail, right?

I've now also enabled (=check) the "arkthis" smtp-target.
*fingerscrossed*

UPDATE: I don't understand how mail-to-root may resolve "arkthis" on a sendmail-level?
I cannot name the target "admin@arkthis.com" or even "arkthis.com". So it "arkthis" has to suffice
:)
 
Last edited:
I've added a Notification target "arkthis" type "sendmail" - and configured my SMTP server login.
I presume this is necessary for "mail-to-root" to even leave the localhost's sendmail, right?


UPDATE: I don't understand how mail-to-root may resolve "arkthis" on a sendmail-level?
I cannot name the target "admin@arkthis.com" or even "arkthis.com". So it "arkthis" has to suffice

I think there might be some confusing regarding the two mail-based notification targets.

First, there are sendmail targets (such as the default one, mail-to-root). It uses the sendmail CLI tool to send the mail. It assumes that the installed Postfix MTA handles mail delivery, which might need additional setup by an admin, which would involve editing Postfix's configuration files.

Second, there are smtp targets. There Proxmox VE uses the SMTP protocol directly to deliver the mail to some mail server. Postfix is not involved at all. These are also completely independent of the sendmail targets.

So if you want to deliver notifications via some SMTP mail server, you can either configure Postfix to use it as a smart host (and probably set up authentication) and use a sendmail target, or alternatively configure everything in the PVE UI using an smtp target. Whichever option you choose, make sure to select the appropriate notification target in the notification matcher(s).

If you haven't already, make sure to read the chapter on notifications in the PVE documentation; I hope everything should be clearly explained there as well (if not, please let me know).

https://pve.proxmox.com/pve-docs/pve-admin-guide.html#chapter_notifications
 
Roger that!
I get it now. This way it makes sense. Okay, I'll do my homework and read the admin-guide link you've sent me - and finish the Postfix config to handle the SMTP part.

Thank you again!
 
  • Like
Reactions: Lukas Wagner