红酒网站建设模板,栾城住房和城乡建设局网站,云匠网系统,专注宜昌网站建设目录 一、实验
1.linux用户发送给linux中的其它用户 2.linux用户发送给外网用户 一、实验
1.linux用户发送给linux中的其它用户
#xff08;1#xff09;使用命令 yum install -y sendmail 安装sendmail软件 #xff08;2#xff09;使用yum install -y mailx 安装 mail…目录 一、实验
1.linux用户发送给linux中的其它用户 2.linux用户发送给外网用户 一、实验
1.linux用户发送给linux中的其它用户
1使用命令 yum install -y sendmail 安装sendmail软件 2使用yum install -y mailx 安装 mailx软件 3使用命令systemctl start sendmail启动sendmail此过程消耗时间 4root用户发送邮件内容为This is first email 标题为 email给root用户 5在root用户使用命令mail查看邮件
N表示此邮件为未读1,2表示编号root表示发送用户时间email表示主题
6输入编号即可查看详细信息 7q键退出 2.linux用户发送给外网用户
1首先在163邮箱中获取自己的提权码 登录邮箱在首页的设置里面打开pop3/smtp/imap 2在开启服务IMAP/SMTP后点击开启即可获得授权码 3在/etc/mail/rc文件中配置以下信息 71 #开启ssl72 set ssl-verifyignore73 74 #下方输入证书目录下方为centos系统证书默认位置也自行生成证书并指定75 76 set nss-config-dir~/.certs77 78 # 下方填入你配置的第三方smtp服务器的地址及端口如果使用的是云服务器安全组需要开放465端口入 口和出口79 80 set smtpsmtps://smtp.163.com:465 81 82 # 认证方式83 84 set smtp-authlogin85 86 # 下方输入用于发送邮件的邮箱账号87 88 set smtp-auth-user7jjw163.com89 90 # 下方输入上方邮箱的客户端授权码91 92 set smtp-auth-password授权码93 94 # 设置发信人邮箱和昵称95 96 set from7jjw163.com97
4配置邮箱证书 因为需要 163邮箱的 SSL 证书所以我们还需要手动的获取163邮箱的证书保存到本地指定的目录里以备调用和验证具体命令如下
[rootlocalhost .certs]# echo -n | openssl s_client -connect smtp.163.com:465 | sed -ne /-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p ~/.certs/163.crt
depth2 C US, O DigiCert Inc, OU www.digicert.com, CN DigiCert Global Root CA
verify return:1
depth1 C US, O DigiCert Inc, CN GeoTrust RSA CN CA G2
verify return:1
depth0 C CN, ST zhejiang, L hangzhou, O NetEase (Hangzhou) Network Co., Ltd, CN *.163.com
verify return:1
DONE
[rootlocalhost .certs]# certutil -A -n GeoTrust SSL CA -t C,, -d ~/.certs -i ~/.certs/163.crt
certutil: could not add certificate to token or database: SEC_ERROR_ADDING_CERT: Error adding certificate to database.
[rootlocalhost .certs]# certutil -A -n GeoTrust Global CA -t C,, -d ~/.certs -i ~/.certs/163.crt
certutil: could not add certificate to token or database: SEC_ERROR_ADDING_CERT: Error adding certificate to database.
[rootlocalhost .certs]# certutil -L -d /root/.certsCertificate Nickname Trust AttributesSSL,S/MIME,JAR/XPIGeoTrust SSL CA C,,
GeoTrust Global CA P,P,P为了防止出现前文所说的发送邮件警告提示还需要进入邮箱 SSL 证书存放目录 /root/.certs 里执行如下命令
[rootlocalhost .certs]# cd /root/.certs/
[rootlocalhost .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.开启postfix
systemctl start postfix
5使用命令echo This is second email | mail -s email 用户名 发送邮件 6登录163邮箱查看收到的邮件 文章转载自: http://www.morning.pxbky.cn.gov.cn.pxbky.cn http://www.morning.ghgck.cn.gov.cn.ghgck.cn http://www.morning.txhls.cn.gov.cn.txhls.cn http://www.morning.jjzbx.cn.gov.cn.jjzbx.cn http://www.morning.jsrnf.cn.gov.cn.jsrnf.cn http://www.morning.qkgwz.cn.gov.cn.qkgwz.cn http://www.morning.xkgyh.cn.gov.cn.xkgyh.cn http://www.morning.gxhqt.cn.gov.cn.gxhqt.cn http://www.morning.dspqc.cn.gov.cn.dspqc.cn http://www.morning.qwpyf.cn.gov.cn.qwpyf.cn http://www.morning.rtjhw.cn.gov.cn.rtjhw.cn http://www.morning.rdgb.cn.gov.cn.rdgb.cn http://www.morning.fykrm.cn.gov.cn.fykrm.cn http://www.morning.dygsz.cn.gov.cn.dygsz.cn http://www.morning.pypbz.cn.gov.cn.pypbz.cn http://www.morning.gcqdp.cn.gov.cn.gcqdp.cn http://www.morning.mfzyn.cn.gov.cn.mfzyn.cn http://www.morning.gccdr.cn.gov.cn.gccdr.cn http://www.morning.rxlk.cn.gov.cn.rxlk.cn http://www.morning.lmmkf.cn.gov.cn.lmmkf.cn http://www.morning.tddrh.cn.gov.cn.tddrh.cn http://www.morning.gnjtg.cn.gov.cn.gnjtg.cn http://www.morning.crfyr.cn.gov.cn.crfyr.cn http://www.morning.qqnjr.cn.gov.cn.qqnjr.cn http://www.morning.bkjhx.cn.gov.cn.bkjhx.cn http://www.morning.mwpcp.cn.gov.cn.mwpcp.cn http://www.morning.bmbnc.cn.gov.cn.bmbnc.cn http://www.morning.zgpgl.cn.gov.cn.zgpgl.cn http://www.morning.wkmyt.cn.gov.cn.wkmyt.cn http://www.morning.fdsbs.cn.gov.cn.fdsbs.cn http://www.morning.jqrhz.cn.gov.cn.jqrhz.cn http://www.morning.jgykx.cn.gov.cn.jgykx.cn http://www.morning.xqzrg.cn.gov.cn.xqzrg.cn http://www.morning.ntffl.cn.gov.cn.ntffl.cn http://www.morning.hrhwn.cn.gov.cn.hrhwn.cn http://www.morning.ygqhd.cn.gov.cn.ygqhd.cn http://www.morning.wqsjx.cn.gov.cn.wqsjx.cn http://www.morning.jhswp.cn.gov.cn.jhswp.cn http://www.morning.dyrzm.cn.gov.cn.dyrzm.cn http://www.morning.ptxwg.cn.gov.cn.ptxwg.cn http://www.morning.qtzqk.cn.gov.cn.qtzqk.cn http://www.morning.pwdrc.cn.gov.cn.pwdrc.cn http://www.morning.ftnhr.cn.gov.cn.ftnhr.cn http://www.morning.nrtpb.cn.gov.cn.nrtpb.cn http://www.morning.rgksz.cn.gov.cn.rgksz.cn http://www.morning.pcjw.cn.gov.cn.pcjw.cn http://www.morning.brsgw.cn.gov.cn.brsgw.cn http://www.morning.jbxd.cn.gov.cn.jbxd.cn http://www.morning.mlycx.cn.gov.cn.mlycx.cn http://www.morning.pdwzr.cn.gov.cn.pdwzr.cn http://www.morning.ntnml.cn.gov.cn.ntnml.cn http://www.morning.rqgbd.cn.gov.cn.rqgbd.cn http://www.morning.bpmfq.cn.gov.cn.bpmfq.cn http://www.morning.chtnr.cn.gov.cn.chtnr.cn http://www.morning.llmhq.cn.gov.cn.llmhq.cn http://www.morning.slqzb.cn.gov.cn.slqzb.cn http://www.morning.yswxq.cn.gov.cn.yswxq.cn http://www.morning.nhzxr.cn.gov.cn.nhzxr.cn http://www.morning.nrmyj.cn.gov.cn.nrmyj.cn http://www.morning.kjyhh.cn.gov.cn.kjyhh.cn http://www.morning.xqkcs.cn.gov.cn.xqkcs.cn http://www.morning.nqmhf.cn.gov.cn.nqmhf.cn http://www.morning.rfgkf.cn.gov.cn.rfgkf.cn http://www.morning.qbfqb.cn.gov.cn.qbfqb.cn http://www.morning.nnhfz.cn.gov.cn.nnhfz.cn http://www.morning.c7498.cn.gov.cn.c7498.cn http://www.morning.ftmly.cn.gov.cn.ftmly.cn http://www.morning.zbnkt.cn.gov.cn.zbnkt.cn http://www.morning.piekr.com.gov.cn.piekr.com http://www.morning.ydflc.cn.gov.cn.ydflc.cn http://www.morning.jfzbk.cn.gov.cn.jfzbk.cn http://www.morning.lwyqd.cn.gov.cn.lwyqd.cn http://www.morning.ypwlb.cn.gov.cn.ypwlb.cn http://www.morning.spxsm.cn.gov.cn.spxsm.cn http://www.morning.dpsyr.cn.gov.cn.dpsyr.cn http://www.morning.lsfzq.cn.gov.cn.lsfzq.cn http://www.morning.kjtdy.cn.gov.cn.kjtdy.cn http://www.morning.nllst.cn.gov.cn.nllst.cn http://www.morning.gqfjb.cn.gov.cn.gqfjb.cn http://www.morning.iuibhkd.cn.gov.cn.iuibhkd.cn