mai.rc 配置騰訊企業郵箱服務器地址來發送郵件

/etc/mail.rc 配置文件內容以下:html

[root@tidb06 nssdb]# tail -10 /etc/mail.rc 
#For Linux and BSD, this should be set.
set bsdcompat

set smtp=smtps://smtp.exmail.qq.com:465
set smtp-auth=login
set smtp-auth-user=test@edianhua.com
set smtp-auth-password=Wjw#edianhua6
set ssl-verify=ignore
set nss-config-dir=/etc/pki/nssdb
set from=test@edianhua.com

測試發送出現告警:可是測試是能夠正常發送郵件的,可是看着就是不爽 ide

[root@tidb06 nssdb]# echo 'test' | mail -s 'test'  test@edianhua.com
[root@tidb06 nssdb]# Error in certificate: Peer's certificate issuer is not recognized.

解決過程以下:測試

[root@tidb06 nssdb]# certutil -A -n 'exmailqq' -t "P,P,P" -d ./ -i exmail.qq.crt 
certutil:  unable to open "exmail.qq.crt" for reading (-5950, 2).
[root@tidb06 nssdb]# touch exmail.qq.crt 
[root@tidb06 nssdb]# certutil -A -n 'exmailqq' -t "P,P,P" -d ./ -i exmail.qq.crt 
certutil: could not decode certificate: SEC_ERROR_INVALID_ARGS: security library: invalid arguments.

一直報錯
參考下面文章解決
https://blog.csdn.net/yongren_z/article/details/85119088
https://www.cnblogs.com/xuziyu/p/10708015.htmlthis

具體解決辦法以下:.net

[root@tidb06 nssdb]#  echo -n "" | openssl s_client -connect smtp.exmail.qq.com:465 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > qq.crt
depth=2 C = US, O = DigiCert Inc, OU = www.digicert.com, CN = DigiCert Global Root CA
verify return:1
depth=1 C = US, O = DigiCert Inc, OU = www.digicert.com, CN = Secure Site CA G2
verify return:1
depth=0 C = CN, ST = Guangdong Province, L = Shenzhen, O = Tencent Technology (Shenzhen) Company Limited, OU = R&D, CN = exmail.qq.com
verify return:1
DONE

下面纔是正確的輸出:code

[root@tidb06 nssdb]# certutil -A -n 'qq' -t "P,P,P" -d . -i ./qq.crt
Notice: Trust flag u is set automatically if the private key is present.

到此時不在出現警告:
[root@tidb06 nssdb]# echo 'test' | mail -s 'test' test@edianhua.com
[root@tidb06 nssdb]# htm

相關文章
相關標籤/搜索