zoukankan      html  css  js  c++  java
  • 阿里云ECS搭建邮件服务

    安装mailx

    [root@db ~]# yum install -y mailx
    
    [root@db ~]# vim /etc/mail.rc
    
    设置发件人信息
    
    .....
    
    set from=yunwei@163.com
    
    set smtp=smtps://smtp.163.com:465
    
    set smtp-auth-user=yunwei@163.com
    
    set smtp-auth-password=***
    
    set smtp-auth=login
    
    set ssl-verify=ignore
    
    set nss-config-dir=/root/.certs
    
    set smtp=smtps:设置发送邮件的服务器端口,如果是企业邮箱加上exmail
    
    set smtp-auth-password:设置网易邮箱授权密码
    
    set ssl-verify:忽略ssl检查
    
    set nss-config-dir:指定证书所在的目录

    申请证书

    [root@db ~]# mkdir .certs
    
    向163邮箱申请证书
    
    [root@db ~]# echo -n | openssl s_client -connect smtp.163.com:465 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > .certs/163.crt
    [root@db ~]# certutil -A -n "GeoTrust SSL CA" -t "C,," -d ~/.certs -i ~/.certs/163.crt
    
    [root@db ~]# certutil -A -n "GeoTrust Global CA" -t "C,," -d ~/.certs -i ~/.certs/163.crt
    
    列出目录下的证书
    
    [root@db ~]# certutil -L -d ~/.certs/
    
    [root@db ~]# cd .certs/
    
    标记证书
    
    [root@db .certs]# certutil -A -n "GeoTrust SSL CA - G3" -t "Pu,Pu,Pu" -d ./ -i 163.crt

    发送邮件

    [root@db ~]# echo "test" | mail -s 'test' yunwei@163.com
  • 相关阅读:
    python https请求报错:SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED]
    python打包为exe文件
    文件自定义扫描工具
    pandas 的常用方法
    cisco应用
    Cisco 模拟配置
    python 识别图片上的数字
    OpenSSL
    OpenSSL
    OpenSSL
  • 原文地址:https://www.cnblogs.com/FireLL/p/11608049.html
Copyright © 2011-2022 走看看