温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

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

发布时间:2020-08-25 06:14:38 来源:网络 阅读:383 作者:Mart_sea 栏目:系统运维

一、安装mailx
yum -y install mailx

二、配制

[root@sea~]# vim /etc/mail.rc
set from=sea_xyz@163.com                           # 发送邮件后显示的邮件发送方
set smtp.163.com                                            # 163 smtp邮件服务器
set smtp-auth-user=youremail@163.com       # 你的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 othermail@126.com,yourqq@qq.com

注:echo 的为邮件内容,-s 是邮件主题,-a 为添加附件,逗号分隔多个邮箱地址。

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI