Linux中国 Linux中国门户站!
设为主页 设为主页
收藏本站 收藏本站
 
当前位置 :首页 ->Linux技术 ->服务器相关 ->正文

在Linux系统下面架设Sendmail服务器

来源: 作者: 时间:2007-04-11 点击: [收藏] [投稿]

架设sendmail服务器

这次我们来学习Linux系统中的Sendmail服务器的配置。(邮件服务器的IP192.168.1.2 主机域名为mail.ltest.com)

前提:首先我们 把DNS服务器安装OK 能够解析,不明白的看http://www.cublog.cn/u/21675/showart_263507.html

1,首先安装Sendmail所需软件

[root@localhost ~]# rpm -q sendmail m4

sendmail-8.13.1-2

m4-1.4.1-16 已经默认安装了,还需挂载第4张光盘,安装与sendmail相关的软件

[root@localhost RPMS]# rpm -ivh sendmail-*

warning: sendmail-cf-8.13.1-2.i386.rpm: V3 DSA signature: NOKEY, key ID db42a60e

Preparing... ########################################### [100%]

1:sendmail-doc ########################################### [ 33%]

2:sendmail-cf ########################################### [ 67%]

3:sendmail-devel ########################################### [100%]

2.修改/etc/mail/local-hosts-name文件。

增加本地域和主机的FQDN,记住只是本地主机的FQDN和域名FQDN,不要添加其他域的,否则向外域发送邮件的时候会出现user unknown的错误:

[root@localhost named]# cat /etc/mail/local-host-names

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

ltest.com

3, 更改/etc/mail/sendmail.mc文件,修改下列地方:

DaemonPortsOptions=Port=smtp,Addr=127.0.0.1, Name=MTA 更改为:

DaemonPortsOptions=Port=smtp,Addr=yourip或者0.0.0.0, Name=MTA

然后m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf

4, 用户管理

认证的配置:修改/etc/mail/sendmail.mc中的字段,取消“TRUST_AUTH_MECH”一行和下一行“define”处的注释。(于sendmail.mc文件的第48、49)然后m4 /etc/ mail/sendmail.mc>/etc/mail/sendmail.cf。

[root@localhost named]# chkconfig --list saslauthd 开启认证

saslauthd 0:off 1:off 2:off 3:off 4:off 5:off 6:off

[root@localhost named]# chkconfig --level 35 saslauthd on

建立用户帐号

[root@localhost named]# groupadd mailuser

[root@localhost named]# adduser -g mailuser -s /sbin/nologin mike

[root@localhost named]# adduser -g mailuser -s /sbin/nologin john

[root@localhost named]# passwd mike

[root@localhost named]# passwd john 密码都是123

设置邮件别名和邮件群发

修改/etc/aliases文件实现邮件转发和邮件列表:

admin: mike 为邮件用户mike设置别名admin

testgroup: mike,john 实现群发 发给testgroup的邮件发给mike 和 john 以上2个可以分别测试

#newaliases

5,访问控制设置

更改/etc/mail/accesss文件,增加:

[root@localhost named]# cat /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...

 如果您对本文有任何疑问或者建议,请到讨论区发表您的意见: >> 论坛入口 <<



上一篇:Linux系统Apache用户授权和访问控制   下一篇:Linux操作系统下怎么样配置DHCP服务器

文章评论】 【收藏本文】 【推荐好友】 【打印本文】 【我要投稿】 【论坛讨论
更多相关文章
Power by linux-cn.com 粤ICP备05006655号