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邮箱发邮件的主要内容,如果未能解决你的问题,请参考以下文章

Linux Centos 7环境下的mailx代理163邮箱发送邮箱

CentOS 7 mailx工具使用外部邮箱发邮件

zabbix4.2通过163邮箱发邮件报警

关于mailx邮件发不出去的解决办法

Linux使用mailx通过外部smtp发邮件

linux下使用自带mail发送邮件