linux sendmail 发送缓慢的问题

这个问题关键就是hosts里面对于本机host的设置有问题,你可以看下/var/log/mail.log

linux sendmail 发送缓慢的问题

retry 和 sleeping,再加上其他时间,用sendmail发送邮件等这么久,太累了吧,说说上面的错误:

My unqualified host name (justswitch-64) unknown; sleeping for retry

我的hostname是justswitch-64,我在hosts里面已经制定了本机的ip地址,为什么还是不行,还是找不到,继续

执行sendmail –v

提示:

WARNING: local host name (testdb) is not qualified; see cf/README: WHO AM I?
Recipient names must be specified

vim /usr/share/doc/sendmail/README.cf
+-----------+
| WHO AM I? |
+-----------+
Normally, the $j macro is automatically defined to be your fully
qualified domain name (FQDN).  Sendmail does this by getting your
host name using gethostname and then calling gethostbyname on the
result.  For example, in some environments gethostname returns
only the root of the host name (such as "foo"); gethostbyname is
supposed to return the FQDN ("foo.bar.com").  In some (fairly rare)
cases, gethostbyname may fail to return the FQDN.  In this case
you MUST define confDOMAIN_NAME to be your fully qualified domain
name.  This is usually done using:
Dmbar.com
define(`confDOMAIN_NAME', `$w.$m')dnl

都是一个点惹的祸,在hosts里面添加

127.0.0.1 justswitch-64 justswitch-64

解决问题,重启sendmail

service sendmail restart

然后测试下,速度快很多了。而且还把重启 sendmail 的速度也提升了,基本上是秒启。

看过该博主的帖子解决了该问题,感谢!

连接:http://www.enjoydiy.com/1472.html

上一篇:ID3和C4.5分类决策树算法 - 数据挖掘算法(7)


下一篇:网易云复盘:云计算前端这一年(AngularJS粉慎入)