gmail notifications over ssl 587 port

tsis

Member
Jan 30, 2016
32
0
6
51
hello all

I read the post in relation to this and none em solve the problem of notifications.

is there any standard settings for gmail and Proxmox?
test telnet port 587 from server proxmox target gmail.smtp.com its ok

regards
 
relayhost = [smtp.gmail.com]:587
smtp_use_tls = yes
smtp_sasl_auth_enable = yes
smtp_sasl_security_options =

you have a correct config?
 
hello all

I read the post in relation to this and none em solve the problem of notifications.

is there any standard settings for gmail and Proxmox?
test telnet port 587 from server proxmox target gmail.smtp.com its ok

regards
1. make sure there are these packages
# dpkg -l | grep sasl
ii libsasl2-2:amd64 2.1.25.dfsg1-6+deb7u1 amd64 Cyrus SASL - authentication abstraction library
ii libsasl2-modules:amd64 2.1.25.dfsg1-6+deb7u1 amd64 Cyrus SASL - pluggable authentication modules

2. add to /etc/postfix/main.cf
Code:
smtp_sender_dependent_authentication = yes
sender_dependent_relayhost_maps = hash:/etc/postfix/sender_relayhost.hash

smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_auth.hash
smtp_sasl_security_options = noplaintext, noanonymous

smtp_use_tls = yes
smtp_tls_CAfile = /etc/ssl/certs/ca-certificates.crt

3.in /etc/postfix/sasl_auth.hash:
Code:
<servername>:587 <login>:<password>
with gmail it's
Code:
smtp.gmai.com:587 yourmail@gmail.com:<password>

in /etc/postfix/sender_relayhost.hash
Code:
<sender email address> <smtp-server>:587
<sender email address> in my case is root@pve.example.com, it's important to be FQDN for certain mail servers to accept mail from.
with gmail, its reasonably to use yourmail@gmail.com, like
Code:
yourmail@gmai.com smtp.gmail.com:587


then
Code:
postmap /etc/postfix/sasl_auth.hash
postmap /etc/postfix/sender_relayhost.hash
postfix reload

4. test it
e.g.
Code:
date | mail -s test yourmail@gmail.com
 
Last edited:
relayhost = [smtp.gmail.com]:587
smtp_use_tls = yes
smtp_sasl_auth_enable = yes
smtp_sasl_security_options =

you have a correct config?
yes, my proxmox send notifications using SASL-authentication to server on 587 port.

probably your problem is with TLS.
try turn it off with
smtp_use_tls = no
to debug prove it.
 
sorry, forgot to mention, I did with
Code:
sender_dependent_relayhost_maps = hash:/etc/postfix/sender_relayhost.hash
with commented out
Code:
#relayhost =
in /etc/postfix/sender_relayhost.hash
Code:
<yourmail>@gmail.com smtp.gmail.com:587
and
Code:
postmap /etc/postfix/sender_relayhost.hash && postfix reload
 
Last edited:
yes, my proxmox send notifications using SASL-authentication to server on 587 port.

probably your problem is with TLS.
try turn it off with
smtp_use_tls = no
to debug prove it.


try test and the same problems
 
notifications backups

when configuring backups thereis popdown menu with options
- always
- on failure only.

in datacenter-options thereis
Email from address

you need to change it to what is in postfix config, i.e. tsistemas@gmail.com
 
manual backups, no sheduled
PVE has an option for email address to sent notifications from.
you need to adjust it to the one configured in postfix sender_relayhost options, that is to yourmail@gmail.com.

otherwise PVE is using its standard root@$hostname, which doesn't fit to postfix config and remains unsent.

btw, check /var/log/mail.log
 
Mar 11 08:00:43 fnuc postfix/smtp[30098]: error: open database /etc/postfix/sasl_auth.hash.db: No such file or directory
 
postmap: fatal: open /etc/postfix/sasl_auth.hash: No such file or directory
yes, it was unattentioned advice, a mistake.

find and comment out the option in postfix main.cf where "/etc/postfix/sasl_auth.hash" is mentioned. it's not necessary now.