邮箱一键配置脚本,只需要改自己的信息就可以啦,特别方便,实用!
#!/bin/bash # @Author: HanWei # @Date: 2019-12-05 09:27:36 # @Last Modified by: HanWei # @Last Modified time: 2019-12-06 10:49:45 # @E-mail: han_wei_95@163.com #安装对应的数字证书:这里请求安装网易163邮箱数字证书 mkdir -p /root/.certs/ #向163请求证书 echo -n | openssl s_client -connect smtp.163.com:465 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > ~/.certs/163.crt #增加一个证书到证书数据库中 certutil -A -n "GeoTrust SSL CA" -t "C,," -d ~/.certs -i ~/.certs/163.crt #再增加一个证书到证书数据库中 certutil -A -n "GeoTrust Global CA" -t "C,," -d ~/.certs -i ~/.certs/163.crt certutil -L -d /root/.certs cd /root/.certs/ certutil -A -n "GeoTrust SSL CA - G3" -t "Pu,Pu,Pu" -d ./ -i 163.crt #配置客户端信息 echo " set from=han_@163.com #开启SMTP服务的邮箱 set smtp=smtps://smtp.163.com:465 set smtp-auth-user=ei_95@163.com set smtp-auth-password=hcom #邮箱的授权码 set smtp-auth=login set ssl-verify=ignore set nss-config-dir=/root/.certs #证书所在目录 " >> /etc/mail.rc #测试成功信息 echo "恭喜您!您已成功配置邮箱,现在可以正常收件!" | mail -s "平台邮箱配置通知" 5@163.com