linux mail : 配置腾讯企业邮箱
背景:
企业邮箱从阿里云迁移到腾讯,重新配置linux mail.
-
客服端专用密码
登入腾讯企业邮箱,进入设置-->邮箱绑定
(1) 打开安全登录
(2)生成新密码 ps.只能复制一次,如果忘记了可以重新生成,可删。
1661317117(1).png
-
修改mail 配置文件 /etc/mail.rc ##在root下操作
set from=邮箱
set smtp=smtps://smtp.exmail.qq.com:465
set smtp-auth-user=邮箱
set smtp-auth-password=客户端专用密码 #不是登入密码
set smtp-auth=login
set ssl-verify=ignore
set nss-config-dir=/etc/.certs -
请求数字证书
mkdir /etc/.certs/
echo -n | openssl s_client -connect smtp.exmail.qq.com:465 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > /etc/.certs/qq.crt
certutil -A -n "GeoTrust SSL CA" -t "C,," -d /etc/.certs -i /etc/.certs/qq.crt
certutil -A -n "GeoTrust Global CA" -t "C,," -d /etc/.certs -i /etc/.certs/qq.crt
certutil -A -n "GeoTrust SSL CA - G3" -t "Pu,Pu,Pu" -d /etc/.certs -i /etc/.certs/qq.crt
certutil -L -d /etc/.cert
chmod -R 755 /etc/.cert #一定记得修改权限,不然非root 用户无法使用mail
测试:
echo "hello" |/usr/bin/mail -s test djl@bphealth.com