zoukankan      html  css  js  c++  java
  • 邮箱邮件

    # yum -y install mailx
    vim /etc/mail.rc
    # 新增
    set from= #邮箱
    set smtp=smtps://smtp.mxhichina.com:465   # 阿里企业邮箱smtp
    set smtp-auth-user=.cn # 邮箱
    set smtp-auth-password=pass  # 密码
    set smtp-auth=login
    set ssl-verify=ignore
    set nss-config-dir=/root/.certs
    
    
    # yum -y install nss-tools 
    
    # echo -n | openssl s_client -connect smtp.mxhichina.com:465 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > /root/.certs/ding.crt
    
    # /usr/bin/certutil -A -n "GeoTrust SSL CA" -t "C,," -d /root/.certs -i /root/.certs/ding.crt
    
    # certutil -A -n "GeoTrust Global CA" -t "C,," -d /root/.certs -i /root/.certs/ding.crt
    
    # certutil -A -n "GeoTrust SSL CA - G3" -t "Pu,Pu,Pu" -d /root/.certs/./ -i /root/.certs/ding.crt
    
    [root@iZbp1hl4uepumhapmjs26nZ certificates]# cat mail.sh 
    #!/bin/bash
    read -p "Please input user name: " name
    read -p "Please input the password of users: " pass
    id $name &> /dev/null
    if [ $? -ne 0 ]
    then
        useradd $name -s /sbin/nologin
        echo "$pass" | passwd --stdin $name
    else
        echo "The user already exists" && exit
    fi
    echo "$name 用户创建成功" | mail -s "linux用户创建"   XXX@qq.com >>/dev/null
    
  • 相关阅读:
    软工实践寒假作业(1/2)
    java判断是否为数字
    前端测试工具Cypress
    StringBuffer&StringBuilder
    IO流
    kafka简介
    Python学习笔记10--unittest参数化
    python学习笔记9--日志模块logging
    Python学习笔记9-多线程和多进程
    python学习笔记9-单元测试unittest
  • 原文地址:https://www.cnblogs.com/Applogize/p/15271944.html
Copyright © 2011-2022 走看看