LDAP 设置指南(转)

一.概述

本指南用于说明如何使用LDAP 服务器保存邮件系统用户信息。邮件服务器用户验证结构如下:

验证服务器用于跨数据库,LDAP服务器的验证中心。邮件服务器把验证请求发送到验证服务器,验证服务器再根据具体的后台用户信息保存类型进行相应的用户信息读取,验证。

二.LDAP 服务器设置

本指南以OpenLDAP 做为例子LDAP 服务器。配置步骤如下:

1)  把以下schema 文件(turbomail.schema)加入 openldap/etc/schema.

   attributetype ( 5.1.1.1 NAME  'domain'

       DESC 'domain name'

       EQUALITY caseIgnoreMatch

       SUBSTR caseIgnoreSubstringsMatch

       SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{128} )

attributetype ( 5.1.1.2 NAME  'enable'

       DESC 'enable'

       EQUALITY caseIgnoreMatch

       SUBSTR caseIgnoreSubstringsMatch

       SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{5} )

attributetype ( 5.1.1.3 NAME  'enablesmtp'

       DESC 'enable_smtp'

       EQUALITY caseIgnoreMatch

       SUBSTR caseIgnoreSubstringsMatch

       SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{5} )

attributetype ( 5.1.1.4 NAME  'enableimap4'

       DESC 'enable_imap4'

       EQUALITY caseIgnoreMatch

       SUBSTR caseIgnoreSubstringsMatch

       SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{5} )

attributetype ( 5.1.1.5 NAME  'enablepop3'

       DESC 'enable_pop3'

       EQUALITY caseIgnoreMatch

       SUBSTR caseIgnoreSubstringsMatch

       SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{5} )    

attributetype ( 5.1.1.6 NAME  'enablewebaccess'

       DESC 'enable_webaccess'

       EQUALITY caseIgnoreMatch

       SUBSTR caseIgnoreSubstringsMatch

       SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{5} )    

attributetype ( 5.1.1.7 NAME  'enablelocaldomain'

       DESC 'enable_webaccess'

       EQUALITY caseIgnoreMatch

       SUBSTR caseIgnoreSubstringsMatch

       SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{5} )    

attributetype ( 5.1.1.8 NAME  'enablesms'

       DESC 'enable_sms'

       EQUALITY caseIgnoreMatch

       SUBSTR caseIgnoreSubstringsMatch

       SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{5} )

attributetype ( 5.1.1.9 NAME  'maxmailboxsize'

       DESC 'max_mailbox_size'

       EQUALITY caseIgnoreMatch

       SUBSTR caseIgnoreSubstringsMatch

       SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64} )  

attributetype ( 5.1.1.10 NAME  'maxmailboxmsgs'

       DESC 'max_mailbox_msgs'

       EQUALITY caseIgnoreMatch

       SUBSTR caseIgnoreSubstringsMatch

       SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64} )  

attributetype ( 5.1.1.11 NAME  'usertype'

       DESC 'usertype'    

       EQUALITY caseIgnoreMatch

       SUBSTR caseIgnoreSubstringsMatch

       SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{5} )    

attributetype ( 5.1.1.12 NAME  'tpassword'

       DESC 'tpassword'

       EQUALITY caseIgnoreMatch

       SUBSTR caseIgnoreSubstringsMatch

       SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{128} )

attributetype ( 5.1.1.13 NAME  'modifytime'

       DESC 'modifytime'

       EQUALITY caseIgnoreMatch

       SUBSTR caseIgnoreSubstringsMatch

       SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{128} )

attributetype ( 5.1.1.14 NAME  'firstname'

       DESC 'firstname'

       EQUALITY caseIgnoreMatch

       SUBSTR caseIgnoreSubstringsMatch

       SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{128} )

attributetype ( 5.1.1.15 NAME  'organiztion'

       DESC 'organiztion'

       EQUALITY caseIgnoreMatch

       SUBSTR caseIgnoreSubstringsMatch

       SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{128} )

attributetype ( 5.1.1.16 NAME  'department'

       DESC 'department'

       EQUALITY caseIgnoreMatch

       SUBSTR caseIgnoreSubstringsMatch

       SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{128} )

attributetype ( 5.1.1.17 NAME  'address'

       DESC 'address'

       EQUALITY caseIgnoreMatch

       SUBSTR caseIgnoreSubstringsMatch

       SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{128} )

attributetype ( 5.1.1.18 NAME  'city'

       DESC 'city'

       EQUALITY caseIgnoreMatch

       SUBSTR caseIgnoreSubstringsMatch

       SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{128} )

attributetype ( 5.1.1.19 NAME  'tpostalcode'

       DESC 'tpostalcode'

       EQUALITY caseIgnoreMatch

       SUBSTR caseIgnoreSubstringsMatch

       SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{128} )

attributetype ( 5.1.1.20 NAME  'telephone'

       DESC 'telephone'

       EQUALITY caseIgnoreMatch

       SUBSTR caseIgnoreSubstringsMatch

       SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{128} )

attributetype ( 5.1.1.21 NAME  'stateprovince'

       DESC 'stateprovince'

       EQUALITY caseIgnoreMatch

       SUBSTR caseIgnoreSubstringsMatch

       SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{128} )

attributetype ( 5.1.1.22 NAME  'country'

       DESC 'country'

       EQUALITY caseIgnoreMatch

       SUBSTR caseIgnoreSubstringsMatch

       SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{128} )

attributetype ( 5.1.1.23 NAME  'items'

       DESC 'items'

       EQUALITY caseIgnoreMatch

       SUBSTR caseIgnoreSubstringsMatch

       SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64} )  

attributetype ( 5.1.1.24 NAME  'mobile'

       DESC 'mobile'

       EQUALITY caseIgnoreMatch

       SUBSTR caseIgnoreSubstringsMatch

       SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{128} )

attributetype ( 5.1.1.25 NAME  'realname'

       DESC 'realname'

       EQUALITY caseIgnoreMatch

       SUBSTR caseIgnoreSubstringsMatch

       SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{128} )     

attributetype ( 5.1.1.26 NAME  'receivecond'

       DESC 'receivecond'

       EQUALITY caseIgnoreMatch

       SUBSTR caseIgnoreSubstringsMatch

       SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{128} )

attributetype ( 5.1.1.27 NAME  'remaincopy'

       DESC 'remaincopy'

       EQUALITY caseIgnoreMatch

       SUBSTR caseIgnoreSubstringsMatch

       SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{128} )

attributetype ( 5.1.1.28 NAME  'replacercpt'

       DESC 'replacercpt'

       EQUALITY caseIgnoreMatch

       SUBSTR caseIgnoreSubstringsMatch

       SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64} )

attributetype ( 5.1.1.29 NAME  'users'

       DESC 'users'

       EQUALITY caseIgnoreMatch

       SUBSTR caseIgnoreSubstringsMatch

       SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{2046} )

attributetype ( 5.1.1.30 NAME  'helodomain'

       DESC 'helodomain'

       EQUALITY caseIgnoreMatch

       SUBSTR caseIgnoreSubstringsMatch

       SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{2046} )

attributetype ( 5.1.1.31 NAME  'bdefault'

       DESC 'bdefault'

       EQUALITY caseIgnoreMatch

       SUBSTR caseIgnoreSubstringsMatch

       SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{6} )

attributetype ( 5.1.1.32 NAME  'enablereg'

       DESC 'enablereg'

       EQUALITY caseIgnoreMatch

       SUBSTR caseIgnoreSubstringsMatch

       SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{6} )

attributetype ( 5.1.1.33 NAME  'domainusers'

       DESC 'domainusers'

       EQUALITY caseIgnoreMatch

       SUBSTR caseIgnoreSubstringsMatch

       SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64} )  

attributetype ( 5.1.1.34 NAME  'license'

       DESC 'license'

       EQUALITY caseIgnoreMatch

       SUBSTR caseIgnoreSubstringsMatch

       SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{128} )

attributetype ( 5.1.1.35 NAME  'totalmailboxsize'

       DESC 'totalmailboxsize'

       EQUALITY caseIgnoreMatch

       SUBSTR caseIgnoreSubstringsMatch

       SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64} )  

attributetype ( 5.1.1.36 NAME  'notetime'

       DESC 'notetime'

       EQUALITY caseIgnoreMatch

       SUBSTR caseIgnoreSubstringsMatch

       SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64} )

attributetype ( 5.1.1.37 NAME  'state'

       DESC 'state'

       EQUALITY caseIgnoreMatch

       SUBSTR caseIgnoreSubstringsMatch

       SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64} )         

attributetype ( 5.1.1.38 NAME  'notesetdisable'

       DESC 'notesetdisable'

       EQUALITY caseIgnoreMatch

       SUBSTR caseIgnoreSubstringsMatch

       SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{5} )

attributetype ( 5.1.1.39 NAME  'lastname'

       DESC 'lastname'

       EQUALITY caseIgnoreMatch

       SUBSTR caseIgnoreSubstringsMatch

       SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{128} )

attributetype ( 5.1.1.40 NAME  'noteaddress'

       DESC 'noteaddress'

       EQUALITY caseIgnoreMatch

       SUBSTR caseIgnoreSubstringsMatch

       SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{128} )

attributetype ( 5.1.1.41 NAME  'username'

       DESC 'username'

       EQUALITY caseIgnoreMatch

       SUBSTR caseIgnoreSubstringsMatch

       SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{128} )

objectclass ( 5.1.1.99 NAME 'mailuser'

       DESC 'mailuser'

       SUP top STRUCTURAL

       MUST ( username )

       MAY ( domain $ enable $ enablesmtp $ enableimap4 $

            enablepop3 $ enablewebaccess $ enablelocaldomain $ enablesms $

            maxmailboxsize $ maxmailboxmsgs $ usertype $ tpassword $

            modifytime $ firstname $ lastname $ organiztion $ department $ address $

            city $ tpostalcode $ telephone $ stateprovince $ country $ items $ mobile $

            realname $ receivecond $ remaincopy $ replacercpt $ users ) )

objectclass ( 5.1.1.98 NAME 'maildomain'

       DESC 'maildomain'

       SUP top STRUCTURAL

       MUST ( domain )

       MAY ( helodomain $ bdefault $ enablereg $ domainusers $ license $ enable $ enablesmtp $ enableimap4 $

            enablepop3 $ enablewebaccess $ enablelocaldomain $ enablesms $

            maxmailboxsize $ maxmailboxmsgs $ totalmailboxsize $ notetime $

            noteaddress $ state $ notesetdisable $ modifytime ) )

2)  配置 ldapd.conf,加入以下指定turbomail.schema 的配置。

    include           C:/openldap/etc/schema/turbomail.schema

3)  启动ldap 服务器,加入以下管理员DN

   dn: cn=Manager,dc=my-domain,dc=com

objectclass: organizationalRole

cn: Manager

三.AuthCenter Server 设置

打开 authcenter/conf/sys.conf 配置文件,加入以下指定ldap 服务器信息:

auth_type=ldap

ldap_server=127.0.0.1

ldap_port=389

ldap_base_dn=dc=my-domain,dc=com

ldap_admin_dn=cn=Manager,dc=my-domain,dc=com

ldap_password=12345678

四.邮件服务器设置

1)  进入邮件系统管理界面,系统设置――》ldap 参数,如图:

2)  配置认证中心,进入 系统设置――》认证中心。

3)  指定系统验证类型为“认证中心(LDAP)” 认证方式,进入系统设置――》一般参数。

    

五.启动步骤

设置完毕,系统启动步骤如下:

1)    启动ldap 服务器

2)    启动 authcenter 服务器 (用startserver.bat  startserver.sh 启动脚本)。

3)    启动 webmail 服务器。

4)    启动 邮件服务器。

转载于:https://my.oschina.net/jccpp/blog/157179

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值