Remova o arquivo /etc/ssl/certs/ca-certificates.crt
e altere tls_trust_file
para /etc/ssl/cert.pem
.
Existe um erro de certificado:
# echo "hello" | msmtp -a default [email protected]
msmtp: TLS certificate verification failed: unable to get local issuer certificate
msmtp: could not send mail (account default from /root/.msmtprc)
#
No arquivo de configuração:
# cat .msmtprc
# Set default values for all following accounts.
defaults
auth on
tls on
tls_trust_file /etc/ssl/certs/ca-certificates.crt
logfile ~/.msmtp.log
# Gmail
account gmail
host smtp.gmail.com
port 587
from [email protected]
user FOOBAR
password BARFOO
# Set a default account
account default : gmail
#
Mas eu tenho o certificado lá!
# uname -mrs
OpenBSD 6.0 amd64
#
# cksum /etc/ssl/cert.pem /etc/ssl/certs/ca-certificates.crt
1384454833 189049 /etc/ssl/cert.pem
1384454833 189049 /etc/ssl/certs/ca-certificates.crt
#
O log diz apenas:
# cat .msmtp.log
Aug 22 20:43:14 host=smtp.gmail.com tls=on auth=on user=FOOBAR [email protected] [email protected] errormsg='TLS certificate verification failed: unable to get local issuer certificate' exitcode=EX_UNAVAILABLE
#
Por que não conseguiu reconhecer o certificado?
Remova o arquivo /etc/ssl/certs/ca-certificates.crt
e altere tls_trust_file
para /etc/ssl/cert.pem
.