Proxmox alert emails - can you automatically CC people

victorhooi

Well-Known Member
Apr 3, 2018
251
20
58
38
Hi,

Proxmox sends alert emails by default to root, for things like smartctl warnings (disk failures), and HA failover etc.

Is it possible to setup a CC list for these alerts, so that it can email multiple people?

Thanks,
Victor
 
Is it possible to setup a CC list for these alerts, so that it can email multiple people?
Not by default, either configure postfix on the local node to do this for you or by sending alerts to a distribution list.
 
Hmm, OK, will see if I can setup some kind of auto-forward rule.

One other question - I do currently seem to be getting alerts, but not sure how this is, as I don't recall setting up a SMTP server on my Proxmox node - I assume it just tries to send it from itself?

It is possible to configure an external SMTP service to use to send alert emails?
 
You can always just add to root's .forward file, it includes our forwarder command which sends it to the root@pam configured email address, but additional "aliases" can added just fine.

It could look somewhat like this.
Code:
# cat /root/.forward
|/usr/bin/pvemailforward
foo@company.com, bar@company.com, ...

This isn't CCed but you get a mail. If you need to changes this often and have a lot of cluster hosts you could also place a file with the list of address into /etc/pve (synced over cluster-nodes) and use the ":include:/file/name" directive, see
Code:
man 5 aliases
for some more info.

But IMO, it could be a valid feature to allow marking some users (admins) as email recipients for all mails send to the nodes root@localhost adress...
 
Great - thanks for the tip. I have added emails to /root/.forward, and will see how it goes.

Is there a way to test the .forward file?

(From this earlier post, I found out you can use "sendmail" to test mail delivery itself - however, is there a way to also test this .forward file?)

Also - is it worth documenting all of this in either the Proxmox documentation or the wiki? (I've asked here about how to get a wiki account)

And yes - agreed, it might be nice to make this a feature request for the Web UI somewhere - just a text field that lets you put in CC addresses. How do we file those?

I see that Proxmox mail works out of the box - I assume just using SMTP on the localhost. However, it might be nice to use something like Sendgrid or Mailgun for more guranteed delivery. (Some hosting providers block outgoing mail, or your mail may get flagged as spam).

Could a second feature request be for an easy way to configure our own SMTP server, with username/password, and ports etc?
 
(From this earlier post, I found out you can use "sendmail" to test mail delivery itself - however, is there a way to also test this .forward file?)

something like:
Code:
echo -e "Subject: This is a test\r\nA test message to see if forwarding works to all specified addresses.." | sendmail root@localhost

This is, in principle, the same thing we do when we want to notice the root admin, we send a mail to root@localhost, which then gets handled by our mailforwarder (it pulls the current user-configured mail, adds a To: and From: part and sends it really out with sendmail)

But, this simple test will highly probably land in your spam queue, it misses a From: and To: header, and depending on your domain/postfix is send out in a bit of an "sketchy way".
So check those spam folders if you do not see it in your inbox..
 

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!