Linux Centos 7环境下的mailx代理163邮箱发送邮箱
一、安装mailx
yum -y install mailx
yum -y install mailx
二、配制
[~]# vim /etc/mail.rc set # 发送邮件后显示的邮件发送方 set smtp.163.com # 163 smtp邮件服务器 set # 你的163邮箱 set smtp-auth-password=yourpass # 你的163邮箱密码(设置页面加密后的授权码) set smtp-auth=login # 动作、登录 set smtp-use-starttls # 安全连接传输 set ssl-verify=ignore # 忽略ssl验证 set nss-config-dir=/root/.certs # 证书路径
三、生成163的证书
mkdir -p /root/.certs/ echo -n | openssl s_client -connect smtp.163.com:465 | sed -ne ‘/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p‘ > ~/.certs/163.crt 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 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.
四、测试发送邮件
echo " Redhat7 更换yum 源为Centos7的阿里云yum源"|mailx -s "rpm -e yum redhat" -a Centos7_yum_org_aliyun.tar.gz ,
注:echo 的为邮件内容,-s 是邮件主题,-a 为添加附件,逗号分隔多个邮箱地址。
相关推荐
changecan 2020-11-19
ECSHOP专属建设 2020-11-13
88427810 2020-11-02
步知道 2020-10-27
Junzizhiai 2020-10-10
jackalwb 2020-10-05
小网管 2020-09-03
shiwenqiang 2020-09-14
85251846 2020-09-14
summerinsist 2020-08-21
87901735 2020-08-19
PinkBean 2020-08-11
85407718 2020-08-09
MichelinMessi 2020-07-30
suosuo 2020-07-28
CARBON 2020-07-28
lizhengfa 2020-07-27
88427810 2020-07-26