标签:.com openssl login ignore end alt mailx cli from
1、安装软件
yum install mailx
yum install sendmail
2、配置
vim /etc/mail.rc在文件最后加上如下内容:
set smtp=smtps://smtp.exmail.qq.com:465 #邮箱服务器地址
set from=xxxx@xxx.com #发送邮件的来源
set smtp-auth-user=xxxx@xxx.com #用户名
set smtp-auth-password=xxxx #密码
set nss-config-dir=/etc/pki/nssdb/ #证书位置
set ssl-verify=ignore
set smtp-auth=login
3、配置证书
mkdir -p /etc/pki/nssdb/
cd /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
certutil -A -n "GeoTrust SSL CA" -t "C,," -d /etc/pki/nssdb/ -i /etc/pki/nssdb/qq.crt
certutil -A -n "GeoTrust Global CA" -t "C,," -d /etc/pki/nssdb/ -i /etc/pki/nssdb/qq.crt
certutil -L -d /etc/pki/nssdb/
certutil -A -n "GeoTrust SSL CA - G3" -t "Pu,Pu,Pu" -d ./ -i qq.crt #认证
4、测试发送邮件
echo "this email come from centos"|mail -v -s "zabbix" xxx@xxx.com
标签:.com openssl login ignore end alt mailx cli from
原文地址:https://www.cnblogs.com/abkn/p/9720143.html