163郵箱設置 都要開啓用手機發送短信
開啓服務:
IMAP/SMTP服務 已開啓 | 關閉
POP3/SMTP服務 已開啓 | 關閉
yum -y install mailx
[root@ab ~]# vi /etc/mail.rc
底部寫入
set from="[email protected]"
set smtp.163.com
set [email protected]
set smtp-auth-password=huang1234567890 #這裏是163登錄的實際密碼
set smtp-auth=login
set smtp-use-starttls
set ssl-verify=ignore
set nss-config-dir=/etc/pki/nssdb/
[root@ab ~]# mkdir -p /root/.certs/
[root@ab ~]# echo -n | openssl s_client -connect smtp.163.com:465 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > ~/.certs/163.crt
[root@ab ~]# certutil -A -n "GeoTrust SSL CA" -t "C,," -d ~/.certs -i ~/.certs/163.crt
[root@ab ~]# certutil -A -n "GeoTrust Global CA" -t "C,," -d ~/.certs -i ~/.certs/163.crt
[root@ab ~]# certutil -L -d /root/.certs
[root@ab ~]# cd /root/.certs/
[root@ab ~]# certutil -A -n "GeoTrust SSL CA - G3" -t "Pu,Pu,Pu" -d ./ -i 163.crt
顯示這一行表示正常
Notice: Trust flag u is set automatically if the private key is present.
[root@ab ~]# yum -y install postfix
[root@ab ~]# systemctl start postfix
[root@ab ~]# cd
[root@ab ~]# echo "test" | mailx -s "ec" [email protected]
查看郵件
內容是 test