阿里雲服務器使用465端口發送郵件


 

關閉所有郵件服務

一、生產一系列證書

mkdir  ~/.certs
#生成證書
echo -n | openssl s_client -connect smtp.163.com:465 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > ~/.certs/mail.crt

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

certutil -A -n "GeoTrust SSL CA - G3" -t "Pu,Pu,Pu" -d ~/.certs -i ~/.certs/mail.crt #查看 certutil
-L -d /root/.certs

 

二、配置mail.rc文件

[root@iZhp3a7sejwabcxoz89b1yZ ~]# cat  /etc/mail.rc 
set from=xxxx@163.com  
set smtp=smtps://smtp.163.com:465  
set smtp-auth-user=xxx@163.com
set smtp-auth-password=xxxxxxxxxxxxx  
set smtp-auth=login
set ssl-verify=ignore
set nss-config-dir=/root/.certs

三、測試

yum install -y  exim mailx
systemctl  start exim.service 
 mailx -s 'aa' xxxx@163.com  </etc/hosts

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM