动网论坛,站长建站首选,国内使用量最多的论坛软件 动网论坛官方技术讨论区 站长工具 申请属于您自己的免费论坛
首页 | 新闻资讯 | 网站运营 | 网络编程 | 数据库 | 服务器 | 网页设计 | 图像媒体 | 网络应用 | 搜索优化 | 资源下载 | 动网主机 | DVBOX
    本站内  互联网 ASP论坛  ASP.Net论坛  PHP论坛
   服务器 → 阅读文章

 配置你的第一台e-mail服务器(2)

作者:Eric Jorn Seneca 来源:neweasier.com  
阅读 数 470 人次 , 2006-2-15 18:02:00 

  但这个仅仅表示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就可以接收来自多个域的信件了.

  如果你需要再增加新的域,只有修改这个文件就可以了.

  
 
 收藏本文  打印本文  论坛讨论  关闭窗口
· 上一篇:配置你的第一台e-mail服务器(1)
· 下一篇:配置你的第一台e-mail服务器(3)
· Windows目录功能揭密大全
· Windows XP操作系统自动安装全攻略
· Webmail攻防实战(4)
· 构建反病毒反垃圾邮件系统(四)
· 优化Apache服务器的重负荷


关于本站 | 联系我们 | 业务合作 | 客户案例 | 诚聘英才 | 广告合作 | 收藏本站
海口动网先锋网络科技有限公司版权所有
Copyright © 2000 - 2006 Cndw.Com
中华人民共和国电信与信息服务业务经营许可证编号 琼 ICP 020077