您的位置 首页 电子

在Linux体系下面架起Sendmail服务器

这次我们来学习Linux系统中的Sendmail服务器的配置。(邮件服务器的IP192.168.1.2 主机域名为mail.ltest.com)前提:首先我们 把DNS服务器安装OK 能够解析,不明

这次咱们来学习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…

localhost.localdomain RELAY

localhost RELAY

127.0.0.1 RELAY

ltest.com RELAY

完成后makemap hash /etc/mail/access.db /etc/mail/access进行数据库更新。

6,#service sendmail restart

[root@localhost named]# service sendmail restart 发动服务

Shutting down sendmail: [FAILED]

Starting sendmail: [ OK ]

Starting sm-client: [ OK ]

[root@localhost named]# telnet localhost 25

Trying 127.0.0.1…

Connected to localhost.localdomain (127.0.0.1).

Escape character is ‘^]’.

220 localhost.localdomain ESMTP Sendmail 8.13.1/8.13.1; Sat, 17 Mar 2007 12:54:47 +0800

ehlo localhost

250-localhost.localdomain Hello localhost.localdomain [127.0.0.1], pleased to meet you

250-ENHANCEDSTATUSCODES

250-PIPELINING

250-8BITMIME

250-SIZE

250-DSN

250-ETRN

250-AUTH DIGEST-MD5 CRAM-MD5 LOGIN PLAIN —认证应该收效

250-DELIVERBY

250 HELP

quit

221 2.0.0 localhost.localdomain closing connection

Connection closed by foreign host.

7,装置邮局服务

[root@localhost RPMS]# rpm -ivh dovecot-0.99.11-2.EL4.1.i386.rpm –aid

warning: dovecot-0.99.11-2.EL4.1.i386.rpm: V3 DSA signature: NOKEY, key ID db42a60e

Preparing… ########################################### [100%]

1:perl-DBI ########################################### [ 20%]

2:postgresql-libs ########################################### [ 40%]

3:mysql ########################################### [ 60%]

4:dovecot ########################################### [ 80%]

5:perl-DBD-MySQL ########################################### [100%]

把1-5这些软件都装置结束才能够继续下去呢,,,,

[root@localhost /]# vi /etc/dovecot.conf在protocols = imap imaps 后增加pop3 pop3s

发动dovecot服务

[root@localhost /]# service dovecot restart

Stopping Dovecot Imap: [FAILED]

Starting Dovecot Imap: [ OK ]

[root@localhost /]# chkconfig –level 35 dovecot on

声明:本文内容来自网络转载或用户投稿,文章版权归原作者和原出处所有。文中观点,不代表本站立场。若有侵权请联系本站删除(kf@86ic.com)https://www.86ic.net/qiche/dianzi/322838.html

为您推荐

联系我们

联系我们

在线咨询: QQ交谈

邮箱: kf@86ic.com

关注微信
微信扫一扫关注我们

微信扫一扫关注我们

返回顶部