When I run the following command to send email through an SMTP server, it works fine as root but does not as any other user. Domains, emails and password have been redacted.
curl -v -u noreply@XXXXXX.com:PASSWORD --url 'smtp://SMPT.SERVER.COM:587' --ssl-reqd \
--mail-from 'noreply@XXXXXX.com:PASSWORD' \
--mail-rcpt 'user@example.com' \
--upload-file email.txt
The output I'm seeing from the failed request is:
> STARTTLS
< 220 TLS go ahead
* Initializing NSS with certpath: sql:/etc/pki/nssdb
* CAfile: /etc/pki/tls/certs/ca-bundle.crt
CApath: none
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* Server certificate:
* subject: CN=server.MYSERVERDOMAIN.com,OU=PositiveSSL,OU=Domain Control Validated
* start date: Oct 11 00:00:00 2019 GMT
* expire date: Oct 10 23:59:59 2020 GMT
* common name: server.MYSERVERDOMAIN.com
* issuer: CN="cPanel, Inc. Certification Authority",O="cPanel, Inc.",L=Houston,ST=TX,C=US
* NSS error -12276 (SSL_ERROR_BAD_CERT_DOMAIN)
* Unable to communicate securely with peer: requested domain name does not match the server's certificate.
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
* Closing connection 0
curl: (51) Unable to communicate securely with peer: requested domain name does not match the server's certificate.
I've tried searching high and low but nothing has worked to fix this. What's going on and how do I fix this?