目录
6.每天9点定时给自己发送邮件提醒自己,I'm the best
1安装s-nail
挂载
[root@localhost ~]# mount /dev/sr0 /mnt
mount: /mnt: WARNING: source write-protected, mounted read-only.
配置源
[root@localhost ~]# vim /etc/yum.repos.d/base.repo
[BaseOS]
name=BaseOS
baseurl=file:///mnt/BaseOS
gpgcheck=0
[AppStream]
name=AppStream
baseurl=file:///mnt/AppStream
gpgcheck=0
安装
[root@localhost ~]# dnf install s-nail -y
2.获取授权码
QQ邮箱->设置->账户
3.s-nail验证登录
vim /etc/s-nail.rc
最底部输入:
set from=XXXXXXXX@qq.com
set smtp=smtps://smtp.qq.com:465
set smtp-auth-user=XXXXXXXXXXXX@qq.com
set smtp-auth-password=XXXXXXXXXXXX #授权码
set smtp-auth=login
set ssl-verify=ignore
set nss-config-dir=/root/.certs
4.nss-tools配置
需要 QQ 邮箱的 SSL 证书,手动的获取QQ 邮箱的证书保存到本地指定的目录 里以备调用和验证
#下载证书管理系统
dnf install nss-tools
#创建文件夹
mkdir -p /root/.certs/
#写入
获取到的证书文件qq.crt可以在配置本地应用程序时使用
echo -n | openssl s_client -connect smtp.qq.com:465 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > ~/.certs/qq.crt
将~/.certs/qq.crt证书文件添加到 ~/.certs 目录下的 NSS 证书数据库中,并为该证书设置昵称为"GeoTrust SSL CA",同时指定其信任属性为仅用于 SSL 客户端身份验证。
certutil -A -n "GeoTrust SSL CA" -t "C,," -d ~/.certs -i ~/.certs/qq.crt
使用certutil工具向 NSS证书数据库中添加证书
certutil -A -n "GeoTrust Global CA" -t "C,," -d ~/.certs -i ~/.certs/qq.crt
列出 /root/.certs 目录下的 NSS 证书数据库中的所有证书信息
certutil -L -d /root/.certs
防止出现发送邮件警告提示
cd /root/.certs
certutil -A -n "GeoTrust SSL CA - G3" -t "Pu,Pu,Pu" -d ./ -i qq.crt
5.测试
echo 123 | mail -s test XXXXXXXXXX@qq.com
6.每天9点定时给自己发送邮件提醒自己,I'm the best
查看服务
Crontab -e