CentOS sendmail 模块配置
安装: yum -y install sendmail
启动:systemctl start sendmail.service
查看状态: systemctl status sendmail.service
发现有一个错误,提示无法识别hostname 对应的 domainname,因为我们的domain name不是一个域名格式。
Dec 28 21:46:48 VM-0-14-centos systemd[1]: Starting Sendmail Mail Transport Agent…
Dec 28 21:46:48 VM-0-14-centos sendmail[9384]: My unqualified host name (VM-0-14-centos) unknown; slee…etry
Dec 28 21:47:48 VM-0-14-centos sendmail[9384]: unable to qualify my own domain name (VM-0-14-centos) -…name
Dec 28 21:47:48 VM-0-14-centos sendmail[9593]: starting daemon (8.14.7): SMTP+queueing@01:00:00
Dec 28 21:47:48 VM-0-14-centos systemd[1]: Started Sendmail Mail Transport Agent.
Hint: Some lines were ellipsized, use -l to show in full.
编辑host文件:nano /etc/hosts 修改localhost的映射为一个域名格式
请输入图片描述
重启sendmail: systemctl restart sendmail.service
开启25端口: https://cloud.tencent.com/document/product/213/40436
在/etc/mail.rc 文件中配置stmp:
set from=ihewro@163.com
set smtp=smtp.163.com
set smtp-auth-user=ihewro@163.com
set smtp-auth-password=******(此处改成你自己的客户端授权码)
set smtp-auth=login
注意这里的密码是授权码不是账号的登录密码
image.png
- 点赞
- 收藏
- 关注作者
评论(0)