阿里云由于安全问题,禁用了25端口,无法对外发送邮件
登录QQ邮箱
设置–》账号–》POP3/IMAP/SMTP/Exchange/CardDAV/CalDAV服务中IMAP/SMTP服务–》开启–》获得第三方登录密码
安装邮件服务
yum install -y mailx sendmail
创建证书
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 ~/.certs
certutil -A -n "GeoTrust SSL CA - G3" -t "Pu,Pu,Pu" -d ./ -i qq.crt
配置/etc/mail.rc
vi /etc/mail.rc
修改值
set smtp="smtps://smtp.qq.com:465"
set smtp-auth=login
set smtp-auth-user="shuaiwang314@qq.com"
set smtp-auth-password="xxxxxxxxxxxxxxx"
set ssl-verify=ignore
set nss-config-dir=/root/.certs
不需要重启什么服务,测试发送邮件
echo message | mail -v -r "shuaiwang314@qq.com" -s "hello world" shuai.wang@ikerry.cn
网友评论