Cron not sending emails

efitol

New Member
Dec 18, 2023
3
0
1
The box (PVE1) was installed on top of Debian and recently upgraded to 8.1. Tried (unsuccessfully) setting up postfix after upgrading before learning about the new SMTP notifications system, which was set up successfully and backup jobs send emails as expected. However, cron jobs are not sending emails. Looks like cron is trying to send using postfix and failing, according to /var/log/mail.log.

Installed 8.1 afresh on another box (PVE2), set it up with the same SMTP notifications and cron jobs send emails as expected. No entries in /var/log/mail.log.

How can cron be configured to use the notifications system for emails instead of postfix on PVE1? How can postfix be disabled altogether so the notifications system can be used universally?
 
In the same boat, did you ever find a solution? If not, would appreciate some help on how to call the smtp service that's available now in 8.1.3
 
In the same boat, did you ever find a solution? If not, would appreciate some help on how to call the smtp service that's available now in 8.1.3
Still no joy. Tried setting up postfix again, /var/log/mail.log reports sending as successful but they’re not received.
 
Proxmox VE ships with the `proxmox-mail-forward` binary, which invoked by the local Postfix instance when a mail for the local root user is received. The binary feeds the mail into the notification system introduced in Proxmox VE 8.1 as a notification of type 'system-mail'.

So what you need to do is: configure the cronjob to send their status mails to 'root' (MAILTO=root). Then configure the notification system so that it forwards the mail to your configured SMTP account - you can do that by creating/updating a notification matcher. If you want to send *ALL* notifications to the SMTP target, then you can simply edit the 'default-matcher' and set its target to the SMTP target.

I hope this helps!
 

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!