yum -y install mailx
下载mailx后配置mail.rc文件
注意我用的是qq邮箱所以一些地方是qq而你们可以根据你的邮箱来替换qq
vi /etc/mail.rc
关于配置linux的mail.rc
set bsdcompat
set [email protected]//添加qq邮箱
set smtp=“smtps://smtp.qq.com:465”
set smtp-auth-user=1136010396
set smtp-auth-password=iyojhzhcxndhfiee//在qq邮箱设置里开通smtp
set smtp-auth=login
set ssl-verify=ignore
#set nss-config-dir=/etc/pki/nssdb
set nss-config-dir=/etc/root/.certs
至此虽然可以发邮件但还是警告下面来消除警告更新证书

配置ssl证书:

mkdir -p /root/.certs/
echo -n | openssl s_client -connect smtp.qq.com:465 | sed -ne ‘/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p’ > ~/.certs/qq.crt
certutil -A -n “GeoTrust SSL CA” -t “C,” -d ~/.certs -i ~/.certs/qq.crt
certutil -A -n “GeoTrust Global CA” -t “C,” -d ~/.certs -i ~/.certs/qq.crt
certutil -A -n “GeoTrust SSL CA - G3” -t “Pu,Pu,Pu” -d ~/.certs/./ -i ~/.certs/qq.crt
certutil -L -d /root/.certs

相关文章:

  • 2022-03-05
  • 2022-12-23
  • 2021-07-05
  • 2021-11-23
  • 2021-10-15
  • 2021-08-15
  • 2021-10-21
  • 2021-11-10
猜你喜欢
  • 2022-12-23
  • 2021-11-10
  • 2021-11-30
  • 2022-01-05
  • 2022-12-23
  • 2021-05-13
  • 2021-08-26
相关资源
相似解决方案