mailx加163邮箱发邮件
Posted uscwifi
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了mailx加163邮箱发邮件相关的知识,希望对你有一定的参考价值。
mailx加163邮箱发邮件
参考:https://www.cnblogs.com/myvic/p/9579954.html
配置
$ yum install mailx -y
$ vim /etc/mail.rc
set from=m17114517139_2@163.com
set smtp=smtps://smtp.163.com:465
set smtp-auth-user=m17114517139_2@163.com
set smtp-auth-password=zhj6b266
set smtp-auth=login
set nss-config-dir=/root/.certs
set ssl-verify=ignore
$ mkdir -p /root/.certs/
$ echo -n | openssl s_client -connect smtp.163.com:465 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > ~/.certs/163.crt
depth=2 C = US, O = DigiCert Inc, OU = www.digicert.com, CN = DigiCert Global Root CA
verify return:1
depth=1 C = US, O = DigiCert Inc, OU = www.digicert.com, CN = GeoTrust RSA CA 2018
verify return:1
depth=0 C = CN, ST = Zhejiang, L = Hangzhou, O = "NetEase (Hangzhou) Network Co.,Ltd", OU = Game Dep., CN = *.163.com
verify return:1
DONE
$ 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
Certificate Nickname Trust Attributes
SSL,S/MIME,JAR/XPI
GeoTrust SSL CA C,,
$ cd /root/.certs/
$ certutil -A -n "GeoTrust SSL CA - G3" -t "Pu,Pu,Pu" -d ./ -i 163.crt
Notice: Trust flag u is set automatically if the private key is present.
测试
$ cat test.txt
If we can only encounter each other rather than stay with each other,then I wish we had never encountered.
No man or woman is worth your tears, and the one who is, won’t make you cry.
$ cat test.txt | mail -s 'test email' haha@spam4.me
以上是关于mailx加163邮箱发邮件的主要内容,如果未能解决你的问题,请参考以下文章