mail報(bào)錯(cuò)

報(bào)錯(cuò):

[root@web01 ~]# echo 222 | mail -s "test" 996.....78@qq.com

[root@web01 ~]# Error initializing NSS: Unknown error -8015.

"/root/dead.letter" 11/290

. . . message not sent.


解決思路:查看證書


全教程如下

1,下載

[root@web01 ~]#?yum -y install mailx


2,配置mail

[root@web01 ~]#?vim /etc/mail.rc

set from=xxxxxx@qq.com

set smtp=smtps://smtp.qq.com:465

set smtp-auth-user=xxxxxx@qq.com

set smtp-auth-password=你的 QQ 郵箱授權(quán)碼

set smtp-auth=login

set ssl-verify=ignore

set ssl-verify=ignoreset nss-config-dir=/root/.certs


3,配置QQ郵箱的SSL證書

[root@web01 ~]#?mkdir -p /root/.certs/

echo -n | openssl s_client -connect smtp.qq.com:465 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > ~/.certs/qq.crt

certutil -A -n "GeoTrust SSL CA" -t "C,," -d ~/.certs -i ~/.certs/qq.crt

certutil -A -n "GeoTrust Global CA" -t "C,," -d ~/.certs -i ~/.certs/qq.crt

certutil -L -d /root/.certs

為了防止出現(xiàn)前文所說(shuō)的發(fā)送郵件警告提示,還需要進(jìn)入郵箱 SSL 證書存放目錄 /root/.certs 里執(zhí)行如下命令:

[root@web01 ~]# cd /root/.certs

[root@web01 .certs]# certutil -A -n "GeoTrust SSL CA - G3" -t "Pu,Pu,Pu" -d ./ -i qq.crt

Notice: Trust flag u is set automatically if the private key is present.出現(xiàn)這句就可以


4.通過(guò)命令行發(fā)送測(cè)試郵件

[root@web01 ~]# echo 222 | mail -s "test" 99...78@qq.com

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

友情鏈接更多精彩內(nèi)容