Centos邮件发送sendmail

1.安装

yum -y install sendmail
systemctl start sendmail
yum install -y mailx

2.修改配置文件

#set smtp-use-starttls
set ssl-verify=ignore
set nss-config-dir=/etc/pki/nssdb
set from='x385xxxxx@qq.com'
set smtp='smtps://smtp.qq.com:465'
set smtp-auth-user='x385xxxxxx'
set smtp-auth-password='gpoawmbousoxxx'
set smtp-auth=login

3.生成SSL 证书

mkdir -p /etc/pki/nssdb
echo -n | openssl s_client -connect smtp.qq.com:465 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > /etc/pki/nssdb/qq.crt
cd /etc/pki/nssdb && certutil -A -n "GeoTrust SSL CA - G3" -t "Pu,Pu,Pu" -d ./ -i qq.crt

4.发送测试

[root@iZbp13 nssdb]# 
[root@iZbp13 nssdb]# echo "aaaaa"|mail -s "test001" 494865597@qq.com
[root@iZbp13 nssdb]# 
[root@iZbp13 nssdb]# 

 

posted on 2019-06-21 14:30  vijayfly  阅读(138)  评论(0)    收藏  举报

导航