linux学习 您所在的位置:网站首页 邮件为何发送不了 linux学习

linux学习

2024-06-28 09:09| 来源: 网络整理| 查看: 265

主机:centos 7 ,

安装sendmail,启动sendmail,一般就可以了,但是有些同学为什么不行,就是启不动出现如下的情况!那现在如何解决。

yum install sendmail systemctl start sendmail.service systemctl status sendmail.service ● sendmail.service - Sendmail Mail Transport Agent Loaded: loaded (/usr/lib/systemd/system/sendmail.service; enabled; vendor preset: disabled) Active: active (running) since Sun 2016-05-08 12:22:58 CST; 1min 33s ago Process: 9727 ExecStart=/usr/sbin/sendmail -bd $SENDMAIL_OPTS $SENDMAIL_OPTARG (code=exited, status=0/SUCCESS) Process: 9722 ExecStartPre=/etc/mail/make aliases (code=exited, status=0/SUCCESS) Process: 9720 ExecStartPre=/etc/mail/make (code=exited, status=0/SUCCESS) Main PID: 9730 (sendmail) CGroup: /system.slice/sendmail.service └─9730 sendmail: accepting connection May 08 12:21:58 iZ28xev9g2sZ systemd[1]: Starting Sendmail Mail Transport Agent... May 08 12:21:58 iZ28xev9g2sZ sendmail[9727]: My unqualified host name (iZ28xev9g2sZ) unknown; sleeping for retry May 08 12:22:58 iZ28xev9g2sZ sendmail[9727]: unable to qualify my own domain name (iZ28xev9g2sZ) -- using short name May 08 12:22:58 iZ28xev9g2sZ systemd[1]: PID file /run/sendmail.pid not readable (yet?) after start. May 08 12:22:58 iZ28xev9g2sZ sendmail[9730]: starting daemon (8.14.7): SMTP+queueing@01:00:00 May 08 12:22:58 iZ28xev9g2sZ systemd[1]: Started Sendmail Mail Transport Agent.解决方法:其实就是你的主机没有设置hostname

mail发送邮件,默认调用的是sendmail,sendmail发送邮件,必须设置hostname,而hostname不能是一串字符串,而必须是格式正确的域名,例如mail.tome178.com

所以我们的解决方法是修改hostname,一种是临时的,一种是永久的

一般我们可以设置临时的

hostname mail.tome178.com

永久的修改/etc/sysconfig/network

hostname=mail.tome178.com //主机名(没有这行?那就添加这一行吧) 然后运行

hostname mail.tome178.com

然后重启sendmail就可以发送邮件了

● sendmail.service - Sendmail Mail Transport Agent Loaded: loaded (/usr/lib/systemd/system/sendmail.service; enabled; vendor preset: disabled) Active: active (running) since Sun 2016-05-08 12:39:48 CST; 16min ago Process: 9939 ExecStart=/usr/sbin/sendmail -bd $SENDMAIL_OPTS $SENDMAIL_OPTARG (code=exited, status=0/SUCCESS) Process: 9933 ExecStartPre=/etc/mail/make aliases (code=exited, status=0/SUCCESS) Process: 9932 ExecStartPre=/etc/mail/make (code=exited, status=0/SUCCESS) Main PID: 9942 (sendmail) CGroup: /system.slice/sendmail.service └─9942 sendmail: accepting connections May 08 12:41:12 mail.tome178.com sendmail[9965]: u484fBCq009965: from=, si....1] May 08 12:41:13 mail.tome178.com sendmail[9967]: STARTTLS=client, relay=163mx01.mxmail.netease.co...256 May 08 12:41:14 mail.tome178.com sendmail[9967]: STARTTLS=client, relay=163mx03.mxmail.netease.co...256 May 08 12:41:14 mail.tome178.com sendmail[9967]: u484fBCq009965: to=, ctladdr=


【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

    专题文章
      CopyRight 2018-2019 实验室设备网 版权所有