我正在运行RHEL 6,并且已经做了以下修改:
[root@ark mail]# grep 0.0.0.0 sendmail.mc
DAEMON_OPTIONS(`Port=smtp,Addr=0.0.0.0, Name=MTA')dnl
[root@ark mail]# make sendmail.cf
确保它确实适用:
[root@ark mail]# grep 0.0.0.0 sendmail.cf
O DaemonPortOptions=Port=smtp,Addr=0.0.0.0, Name=MTA
#O ClientPortOptions=Family=inet, Address=0.0.0.0
#O ConnectOnlyTo=0.0.0.0
[root@ark mail]# makemap -v hash access.db < access
key=`connect:localhost.localdomain', val=`RELAY'
key=`connect:localhost', val=`RELAY'
key=`connect:127.0.0.1', val=`RELAY'
key=`connect:[my.remote.ip]', val=`RELAY'
然而,它仍然无法收听127.0.0.1的内容:
[root@ark mail]# netstat -lptun | grep 25
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 1174/master
我已经重新启动了几次sendmail。
发布于 2014-05-02 04:41:07
[root@server mail]# netstat -vatn
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN
在查看了几个文件之后,我发现了如何修复它:
首先,您需要编辑/etc/mail/sendmail.mc,请找到以下部分:
dnl This changes sendmail to only listen on the loopback device 127.0.0.1
dnl and not on any other network devices. Comment this out if you want
dnl to accept email over the network.
DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')
您需要在行开始时使用"dnl“,用DAEMON_OPTIONS注释出类似的内容:
dnl This changes sendmail to only listen on the loopback device 127.0.0.1
dnl and not on any other network devices. Comment this out if you want
dnl to accept email over the network.
dnl DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')
然后,您需要重新构建该文件:
m4 /etc/mail/sendmail.mc > /etc/sendmail.cf
完成此操作后,sendmail将侦听系统上的所有IP地址:
[root@server mail]# netstat -vatn
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN
你可以收到别人的邮件,也可以从你的客户那里发送邮件。
发布于 2014-05-02 04:27:38
看看/etc/sysconfig/mail
。你不能错过遥控器。
https://serverfault.com/questions/592633
复制相似问题