安裝郵件發(fā)送軟件mailx
? ??yum -y install mailx
? ??測(cè)試是否安裝成功? which mailx
編輯配置文件
? ? ?vi /etc/mail.rc 在文件末尾添加如下配置
? ??????set from=*****@qq.com #發(fā)送郵箱豆励,你的郵箱賬號(hào)
????????set smtp=smtp.qq.com? ? ?
????????set smtp-auth-user=*******@qq.com? ? #授權(quán)賬號(hào)兜材,你的郵箱賬號(hào)
? ? ? ? set smtp-auth-password=*********? ? #授權(quán)碼趟庄,詳見(jiàn)下圖
????????set smtp-auth=login
????????set smtp-use-starttls
????????set ssl-verify=ignore
????????set nss-config-dir=/root/.certs? ? ? #ssl授權(quán)文件路徑
? ? qq郵箱smtp開(kāi)啟和授權(quán)碼獲取
? ? ? ?登陸網(wǎng)頁(yè)版qq郵箱
? ? ? ? ? ? ? ? 設(shè)置-賬戶-POP3/IMAP/SMTP/Exchange/CardDAV/CalDAV服務(wù)-開(kāi)啟smtp服務(wù)
配置QQ 郵箱ssl證書
? ??????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
? ? ? ? cd?/root/.certs/
? ??????certutil -A -n "GeoTrust SSL CA - G3" -t "Pu,Pu,Pu" -d ./ -i qq.crt