1,阿里云为什么封掉25端口,自己百度。
2,两种解决方法:
第一,申请解封25端口,至少一个工作日审核,等不及了。
第二,配置465端口。
3,配置465端口,我用的是qq邮箱
1)打开自己的qq邮箱-----设置-----账户,找到下图位置
因为我的已经开启了,所以显示关闭。点击开启,按操作获取一个授权码,自己保存下来。
2)安装sendmail mailx
yum -y install sendmail
yum -y install mailx
3)配置/etc/mail.rc
vi/etc/mail.rc
把下面的信息改成你自己的,加到最下面
set from=304750@set smtp=smtps://:465set ssl-verify=ignoreset nss-config-dir=/root/.certsset smtp-auth-user=304750@#下面的密码就是刚才通过qq邮箱获取的授权码,回头看看上面写的,替换成自己的set smtp-auth-password=rmolsohupijxbjdeset smtp-auth=login
4)创建证书目录
mkdir /root/.certs
然后,ssl 授权,执行如下命令(4条)
echo
-n | openssl s_client -connect :465 |
sed
-
ne
'/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p'
> ~/.certs
/qq
.crt
certutil -A -n
"GeoTrust Global CA"
-t
"C,,"
-d ~/.certs -i ~/.certs
/qq
.crt
certutil -A -n
"GeoTrust SSL CA"
-t
"C,,"
-d ~/.certs -i ~/.certs
/qq
.crt
certutil -L -d .certs
5)测试:
echo -e `date ` | mail -s "(请勿回复此邮件)" ti@