快速业务通道

linux4.0 sendmail server relevant config

作者 佚名技术 来源 Linux系统 浏览 发布时间 2012-04-01

一.Sendmail server config SMTP

1. [root@michael ~]# vi /var/named/fung.com.zone

$TTL 86400

@ IN SOA michael.fung.com. root.fung.com. (

2009080301

28800

14400

3600000

86400 )

@ IN NS michael.fung.com.

michael IN A 192.168.5.1

www IN A 192.168.5.1

mail IN A 192.168.5.1

ftp IN CNAME michael

@ IN MX 10 mail.fung.com. (确定MX 记录)

~

~

~

"/var/named/fung.com.zone" 20L, 433C written

[root@michael ~]# service named restart

Stopping named: [ OK ]

Starting named: [ OK ]

2. [root@michael ~]# nslookup

> server 192.168.5.1

Default server: 192.168.5.1

Address: 192.168.5.1#53

> set type=mx

> fung.com

Server: 192.168.5.1

Address: 192.168.5.1#53

fung.com mail exchanger = 10 mail.fung.com.

>

3. [root@michael ~]# rpm -qa | grep sendmail

sendmail-8.13.1-3.RHEL4.5 (sendmail server 程序 file)

sendmail-cf-8.13.1-3.RHEL4.5 (sendmail server 重新配置要的file)

[root@michael ~]# rpm -qa | grep m4

m4-1.4.1-16 (sendmail server config 不可少的 tools)

4 . [root@michael ~]# chkconfig --list sendmail

sendmail 0:off 1:off 2:on 3:off 4:on 5:on 6:off

[root@michael ~]# chkconfig --level 35 sendmail on

[root@michael ~]# chkconfig --list sendmail

sendmail 0:off 1:off 2:on 3:on 4:on 5:on 6:off

5. [root@michael ~]# service sendmail restart

Shutting down sendmail: [FAILED]

Starting sendmail: [ OK ]

Starting sm-client: [ OK ]

[root@michael ~]# service sendmail status

sendmail (pid 3785 3777) is running...

6. [root@michael ~]# vi /etc/mail/local-host-names

# local-host-names - include all aliases for your machine here.

fung.com (表明sendmail server 将对 “fung.com “domain 提供mail service).

7. [root@michael ~]# vi /etc/mail/sendmail.mc

DAEMON_OPTIONS(`Port=smtp,Addr=0.0.0.0, Name=MTA'')dnl (start sendmail server the network interface,Addr=127.0.0.1 改为 Addr=0.0.0.0)

"/etc/mail/sendmail.mc" 164L, 6743C written

8. [root@michael mail]# m4 sendmail.mc> sendmail.cf

[root@michael mail]# service sendmail restart

Shutting down sendmail: [ OK ]

Shutting down sm-client: [ OK ]

Starting sendmail: [ OK ]

Starting sm-client: [ OK ]

注意:sendmail.cf is sendmail the lord config file ,sendmail.mc is sendmail lord config the 辅助 file , sendmail.cf config file 相对来说比较难懂.,use sendmail.mc file config sendmail server ,use m4 sendmail.mc.> sendmail.cf 生成 sendmail.cf. m4 use in “/etc/mail/” file in 执行. 转换完之后才能 restart sendmail server.

9. [root@michael mail]# vi /etc/mail/access

# Check the /usr/share/doc/sendmail/README.cf file for a description

# of the format of this file. (search for access_db in that file)

# The /usr/share/doc/sendmail/README.cf is part of the sendmail-doc

# package.

#

# by default we allow relaying from localhost...

localhost.localdomain RELAY

localhost RELAY

127.0.0.1 RELAY (default)

192.168.5.0 RELAY (allow 192.168.5.0 发 mail)

~

~"access" 10L

凌众科技专业提供服务器租用、服务器托管、企业邮局、虚拟主机等服务,公司网站:http://www.lingzhong.cn 为了给广大客户了解更多的技术信息,本技术文章收集来源于网络,凌众科技尊重文章作者的版权,如果有涉及你的版权有必要删除你的文章,请和我们联系。以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢!

分享到: 更多

Copyright ©1999-2011 厦门凌众科技有限公司 厦门优通互联科技开发有限公司 All rights reserved

地址(ADD):厦门软件园二期望海路63号701E(东南融通旁) 邮编(ZIP):361008

电话:0592-5908028 传真:0592-5908039 咨询信箱:web@lingzhong.cn 咨询OICQ:173723134

《中华人民共和国增值电信业务经营许可证》闽B2-20100024  ICP备案:闽ICP备05037997号