时间: 2021-07-31 作者:daque
但这个只是表白e-mail效劳器只接受你本机的邮件.为领会决这个题目,你必需窜改摆设,报告sendmail去监听你对外的网卡地方.假如你的效劳器上只安置了一块网卡(eth0),并用ifconfig摆设好你的ip地方.这个地方不妨和dns领会的地方不一律,但你要保护dns不妨精确地领会邮件效劳器的地方.这边咱们运用的地方是一律的(引荐): [root@testmail /root]# ifconfig eth0 link encap:ethernet hwaddr 00:60:97:de:e9:99 inet addr:192.168.100.134 bcast:192.168.100.255 mask:255.255.255.0 up broadcast running multicast mtu:1500 metric:1 rx packets:12421 errors:0 dropped:0 overruns:0 frame:0 tx packets:5 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:100 interrupt:10 base address:0xe000
lo link encap:local loopback inet addr:127.0.0.1 mask:255.0.0.0 up loopback running mtu:16436 metric:1 rx packets:6 errors:0 dropped:0 overruns:0 frame:0 tx packets:6 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0
不妨看到这台长机的eth0的ip地方是192.168.100.134.此刻窜改/etc/sendmail.cf文献来摆设sendmail的监听端口: # smtp daemon options o daemonportoptions=port=smtp,addr=127.0.0.1, name=mta 变动为 o daemonportoptions=port=smtp,addr=192.168.100.134, name=mta 改完后生存退出,而且从新启用sendmail效劳: [root@testmail /root]# /etc/init.d/sendmail restart shutting down sendmail: [ ok ] starting sendmail: [ ok ] [root@testmail /root]# 此刻不妨用netstat -nl来察看是否仍旧变动了.如你所看到的,sendmail的监听端口此刻是eth0的ip地方:192.168.100.134了. [root@testmail /root]# netstat -nl active internet connections (only servers) proto recv-q send-q local address foreign address state tcp 0 0 0.0.0.0:32768 0.0.0.0:* listen tcp 0 0 0.0.0.0:111 0.0.0.0:* listen tcp 0 0 0.0.0.0:22 0.0.0.0:* listen tcp 0 0 192.168.100.134:25 0.0.0.0:* listen udp 0 0 0.0.0.0:32768 0.0.0.0:* udp 0 0 0.0.0.0:667 0.0.0.0:* udp 0 0 0.0.0.0:111 0.0.0.0:* active unix domain sockets (only servers) proto refcnt flags type state i-node path unix 2 [ acc ] stream listening 1119 /dev/gpmctl unix 2 [ acc ] stream listening 1172 /tmp/.font-unix/fs7100 [root@testmail /root]# ///////////////////////////////////////////////////////////////
此刻sendmail仍旧不妨接受来自外部的贯穿了.咱们还须要设定sendmail承诺接受的域名.这个不妨在/etc/mail/local-host-names文献中设定.就把域名输出进去就不妨了: # local-host-names - include all aliases for your machine here. blank.com
生存退出后从新启用sendmail效劳:/etc/init.d/sendmail restart .如许sendmail就不妨接受来自多个域的函件了. 即使你须要再减少新的域,惟有窜改这个文献就不妨了.