RHEL5安装Postfix+CyrusSASL+dovecot

默认方式安装RHEL5,不选中任何类型服务器(如WEB服务器,开发服务器,虚拟服务器等)

安装postfix

[root@rhel5 ~]# /etc/rc.d/init.d/sendmail stop

关闭 sm-client: [确定]

关闭 sendmail: [确定]

[root@rhel5 ~]# chkconfig sendmail off

[root@rhel5 Server]# rpm -ivh postfix-2.3.3-2.i386.rpm

[root@rhel5 Server]# vi /etc/postfix/main.cf

myhostname = mail.mailidc.cn #设置运行postfix服务的邮件主机的主机名、域名

mydomain = mailidc.cn

myorigin = $mydomain #设置由本机寄出的邮件所使用的域名或主机名称

inet_interfaces = all #设置postfix服务监听的网络接口

mydestination = $myhostname, $mydomain, localhost.$mydomain, localhost #设置可接收邮件的主机名称或域名

mynetworks = 127.0.0.1 #设置可转发哪些网络的邮件

relay_domains = $mydestination #设置可转发哪些网域的邮件

保存文件。

检查postfix的配置:

[root@rhel5 Server]# postconf –n

[root@rhel5 ~]# chkconfig postfix on

將postfix加入到root的组:

# usermod -G root postfix

SMTP认证的配置

安装cyrus-sasl

1、确认cyrus-sasl是否安装了

[root@rhel5 Server]# rpm -qa|grep cyrus

cyrus-sasl-plain-2.1.22-4

cyrus-sasl-lib-2.1.22-4

cyrus-sasl-2.1.22-4

Cyrus-SASL V2的密码验证机制

[root@rhel5 ~]# saslauthd -v

saslauthd 2.1.22

authentication mechanisms: getpwent kerberos5 pam rimap shadow ldap

我们准备用的是shadow的密码验证机制。

vi /etc/sysconfig/saslauthd

MECH=shadow

启动sasl的daemon并测试:

# service saslauthd start

# /usr/sbin/testsaslauthd -u 帐号 -p ‘密码’

0: OK “Success.” =>帐号验证成功了

[root@rhel5 ~]# chkconfig saslauthd on

设置postfix启用SMTP认证

[root@rhel5 Server]# vi /etc/postfix/main.cf

smtpd_sasl_auth_enable = yes

smtpd_sasl_local_domain= ”

smtpd_recipient_restrictions = permit_mynetworks,permit_sasl_authenticated,

reject_unauth_destination

broken_sasl_auth_clients = yes

smtpd_client_restrictions = permit_sasl_authenticated

smtpd_sasl_security_options = noanonymous

wq!保存

此外,由于当postfix要使用SMTP认证时,会读取/usr/lib/sasl2/smtpd.conf文件的内容以确定所采用的认证方式,所以必须保证/usr/lib/sasl2/smtpd.conf文件的内容是:

pwcheck_method: saslauthd

安装设定dovecot(imap、pop3):

1、确认dovecot是否有安装:

[root@rhel5 ~]# rpm -qa|grep dovecot

dovecot-1.0-1.2.rc15.el5

2、设定用pop3来收取信件:

#vi /etc/dovecot.conf

protocols = pop3 # imap imaps pop3 pop3s 支持的功能

3、启动并测试:

#service dovecot start

# telnet localhost 110

Trying 127.0.0.1…

Connected to localhost.

Escape character is ‘^]’.

+OK dovecot ready.

 

下文链接:

http://blog.sina.com.cn/s/blog_62c4ea990102wbp4.html

posted @ 2016-06-23 17:28  w3391826735  阅读(153)  评论(0编辑  收藏  举报