#sendmial service sendmail stop chkconfig sendmail off #postfix service postfix stop chkconfig postfix off
yum -y install mailx ln -s /bin/mailx /bin/mail chown -R zabbix.zabbix /bin/mail
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
安装步骤操做,发送完邮件会生成一个受权码,复制保存稍后使用html
vim /etc/mail.rc
在文本最后插入vim
set nss-config-dir=/etc/pki/nssdb/ set smtp-user-starttls set ssl-verify=ignore set from=123456@qq.com #使用本身的QQ邮箱,这个是发件箱 set smtp=smtps://smtp.qq.com:465 set smtp-auth-user=123456@qq.com #外部smtp服务器认证的用户名,也是QQ邮箱 set smtp-auth-password=受权码 set smtp-auth=login
echo test | mail -v -s " test" test@qq.com #此邮箱为收件箱,使用其余邮箱做为收件箱
测试成功
测试失败(这是多半是证书问题)
centos
Linux 使用命令发送邮件
Linux CentOS7 Zabbix邮件报警 经过QQ企业邮箱发送邮件的问题解决方案服务器