Unable to send email notifications from pve

LooneyTunes

Active Member
Jun 1, 2019
203
25
38
Hi,

Trying my best to setup email-notifications, and found this great guide which seems to have worked well for others. I have had no luck though.

When issuing
Code:
sudo echo "Test mail from postfix" | mail -v -s "Test Postfix" <my_email>
Mail Delivery Status Report will be mailed to <pve>
Which indicates that mail will be stored in /etc/mail/pve - and sure enough, there they end up. Why eludes me... It says destination is the correct address, why redirected?

My /etc/postfix/main.cf looks like this;
Code:
cat /etc/postfix/main.cf
# See /usr/share/postfix/main.cf.dist for a commented, more complete version

myhostname=<my hostname>

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
mynetworks = 127.0.0.0/8
inet_interfaces = loopback-only
inet_protocols = ipv4
recipient_delimiter = +

compatibility_level = 2

# Google mail configuration
#-------------------------------------------
relayhost = [smtp.gmail.com]:587

smtp_use_tls = yes
smtp_sasl_auth_enable = yes
smtp_sasl_security_options = noanonymous
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_tls_CAfile = /etc/ssl/certs/ca-certificates.crt
smtp_tls_session_cache_database = btree:/var/lib/postfix/smtp_tls_session_cache
smtp_tls_session_cache_timeout = 3600s
smtp_tls_wrappermode = yes
smtp_tls_security_level = encrypt
 
Last edited:
Hey, it's hard to tell what's wrong with your configuration since there are many possible points of failure. However, I can recommend this up to date guide if you'd like to set up e-mail alerts: https://youtu.be/85ME8i4Ry6A
 
Hey, it's hard to tell what's wrong with your configuration since there are many possible points of failure. However, I can recommend this up to date guide if you'd like to set up e-mail alerts: https://youtu.be/85ME8i4Ry6A
Thanks a lot! And yes, I do realize this has much potential for errors. That one was where it all started, I should have mentioned that. I will get it at last, perhaps next Christmas... I'm almost thinking along the lines of setting up https://www.librenms.org/#prettyPhoto instead... Some more reading first tho. Thanks again and Merry Christmas!