schema包含五大组件:OID,唯一名称NAME,父对象SUP,MUST属性,MAY属性。
下面是一个schema例子:
#
# xlymail-ldap v3 directory schema
#
# written by hefish@cz8.net
#
# Attribute Type Definitions
attributetype ( 1.3.6.1.4.1.7.1.2.1.1 NAME 'xlyusername'
DESC 'name of the user on the mailsystem'
EQUALITY caseIgnoreIA5Match
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-value )
# xlymail-ldap v3 directory schema
#
# written by hefish@cz8.net
#
# Attribute Type Definitions
attributetype ( 1.3.6.1.4.1.7.1.2.1.1 NAME 'xlyusername'
DESC 'name of the user on the mailsystem'
EQUALITY caseIgnoreIA5Match
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-value )
attributetype ( 1.3.6.1.4.1.7.1.2.1.2 NAME 'xlyvuid'
DESC 'UID of the user on the mailsystem'
EQUALITY integerMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-value )
DESC 'UID of the user on the mailsystem'
EQUALITY integerMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-value )
attributetype ( 1.3.6.1.4.1.7.1.2.1.3 NAME 'xlyvgid'
DESC 'GID of the user on the mailsystem'
EQUALITY integerMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-value )
DESC 'GID of the user on the mailsystem'
EQUALITY integerMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-value )
attributetype ( 1.3.6.1.4.1.7.1.2.1.4 NAME 'xlymaildir'
DESC 'Path to the maildir/mbox on the mail system'
EQUALITY caseExactMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-value )
#1.3.6.1.4.1.1466.115.121.1.15 directory
DESC 'Path to the maildir/mbox on the mail system'
EQUALITY caseExactMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-value )
#1.3.6.1.4.1.1466.115.121.1.15 directory
attributetype ( 1.3.6.1.4.1.7.1.2.1.5 NAME 'xlyforwardAddr'
SUBSTR caseIgnoreSubstringsMatch
DESC 'Forward mail address'
EQUALITY caseIgnoreIA5Match
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )
#Object Class Definitions
SUBSTR caseIgnoreSubstringsMatch
DESC 'Forward mail address'
EQUALITY caseIgnoreIA5Match
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )
#Object Class Definitions
objectclass ( 1.3.6.1.4.1.7.1.2.2.1 NAME 'xlymailUser'
DESC 'xlyMail-LDAP User'
SUP person STRUCTURAL
MUST ( xlyusername $ xlyvuid $ xlyvgid )
MAY ( xlymaildir $ xlyforwardAddr ) )
DESC 'xlyMail-LDAP User'
SUP person STRUCTURAL
MUST ( xlyusername $ xlyvuid $ xlyvgid )
MAY ( xlymaildir $ xlyforwardAddr ) )
属性定义注意事项:
- 唯一标识NAME不能包含下划线‘_’等特殊符号,如果出现会抱错!
- 括号左右必须以空格隔开,如下面的红色部分是是错误的!!!!
objectclass(1.3.6.1.4.1.7.1.2.2.1 NAME 'xlymailUser'
DESC 'xlyMail-LDAP User'
SUP person STRUCTURAL
MUST ( xlyusername $ xlyvuid $ xlyvgid )
MAY ( xlymaildir $ xlyforwardAddr ) )
这将导致找不到自定义的objectClass对象类。