码迷,mamicode.com
首页 > 其他好文 > 详细

mailx加163邮箱发邮件

时间:2019-11-10 15:16:35      阅读:103      评论:0      收藏:0      [点我收藏+]

标签:nic   attr   ast   mail -s   sed   html   yum   can   cal   

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邮箱发邮件

标签:nic   attr   ast   mail -s   sed   html   yum   can   cal   

原文地址:https://www.cnblogs.com/uscWIFI/p/11830129.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!