diff --git a/ldap/Dockerfile b/ldap/Dockerfile new file mode 100644 index 0000000..8e32766 --- /dev/null +++ b/ldap/Dockerfile @@ -0,0 +1,5 @@ +FROM osixia/openldap:1.1.6 +MAINTAINER Dennis Stumm + +ADD bootstrap /container/service/slapd/assets/config/bootstrap +RUN rm /container/service/slapd/assets/config/bootstrap/schema/mmc/mail.schema diff --git a/ldap/bootstrap/ldif/01_mail-tree.ldif b/ldap/bootstrap/ldif/01_mail-tree.ldif new file mode 100644 index 0000000..940fef2 --- /dev/null +++ b/ldap/bootstrap/ldif/01_mail-tree.ldif @@ -0,0 +1,5 @@ +dn: ou=people,dc=localhost,dc=localdomain +changetype: add +objectClass: organizationalUnit +objectClass: top +ou: people diff --git a/ldap/bootstrap/ldif/02_user-email.ldif b/ldap/bootstrap/ldif/02_user-email.ldif new file mode 100644 index 0000000..3528f49 --- /dev/null +++ b/ldap/bootstrap/ldif/02_user-email.ldif @@ -0,0 +1,25 @@ +# -------------------------------------------------------------------- +# Create mail accounts +# -------------------------------------------------------------------- +# Some User +dn: uniqueIdentifier=some.user,ou=people,dc=localhost,dc=localdomain +changetype: add +objectClass: organizationalPerson +objectClass: person +objectClass: top +objectClass: PostfixBookMailAccount +objectClass: extensibleObject +cn: Some User +givenName: User +mail: some.user@localhost.localdomain +mailAlias: postmaster@localhost.localdomain +mailGroupMember: employees@localhost.localdomain +mailEnabled: TRUE +mailGidNumber: 5000 +mailHomeDirectory: /var/mail/localhost.localdomain/some.user/ +mailQuota: 10240 +mailStorageDirectory: maildir:/var/mail/localhost.localdomain/some.user/ +mailUidNumber: 5000 +sn: Some +uniqueIdentifier: some.user +userPassword: {SSHA}eLtqGpid+hkSVhxvsdTPztv4uapRofGx diff --git a/ldap/bootstrap/ldif/03_user-email-other-primary-domain.ldif b/ldap/bootstrap/ldif/03_user-email-other-primary-domain.ldif new file mode 100644 index 0000000..f949349 --- /dev/null +++ b/ldap/bootstrap/ldif/03_user-email-other-primary-domain.ldif @@ -0,0 +1,25 @@ +# -------------------------------------------------------------------- +# Create mail accounts +# -------------------------------------------------------------------- +# Some User +dn: uniqueIdentifier=some.other.user,ou=people,dc=localhost,dc=localdomain +changetype: add +objectClass: organizationalPerson +objectClass: person +objectClass: top +objectClass: PostfixBookMailAccount +objectClass: extensibleObject +cn: Some Other User +givenName: Other User +mail: some.other.user@localhost.otherdomain +mailAlias: postmaster@localhost.otherdomain +mailGroupMember: employees@localhost.otherdomain +mailEnabled: TRUE +mailGidNumber: 5000 +mailHomeDirectory: /var/mail/localhost.localdomain/some.other.user/ +mailQuota: 10240 +mailStorageDirectory: maildir:/var/mail/localhost.localdomain/some.other.user/ +mailUidNumber: 5000 +sn: Some +uniqueIdentifier: some.other.user +userPassword: {SSHA}eLtqGpid+hkSVhxvsdTPztv4uapRofGx diff --git a/ldap/bootstrap/ldif/04_user-email-different-uid.ldif b/ldap/bootstrap/ldif/04_user-email-different-uid.ldif new file mode 100644 index 0000000..b991993 --- /dev/null +++ b/ldap/bootstrap/ldif/04_user-email-different-uid.ldif @@ -0,0 +1,23 @@ +# -------------------------------------------------------------------- +# Create mail accounts +# -------------------------------------------------------------------- +# Some User +dn: uniqueIdentifier=some.user.id,ou=people,dc=localhost,dc=localdomain +changetype: add +objectClass: organizationalPerson +objectClass: person +objectClass: top +objectClass: PostfixBookMailAccount +objectClass: extensibleObject +cn: Some User +givenName: User +mail: some.user.email@localhost.localdomain +mailEnabled: TRUE +mailGidNumber: 5000 +mailHomeDirectory: /var/mail/localhost.localdomain/some.user.id/ +mailQuota: 10240 +mailStorageDirectory: maildir:/var/mail/localhost.localdomain/some.user.id/ +mailUidNumber: 5000 +sn: Some +uniqueIdentifier: some.user.id +userPassword: {SSHA}eLtqGpid+hkSVhxvsdTPztv4uapRofGx diff --git a/ldap/bootstrap/schema/mmc/postfix-book.schema b/ldap/bootstrap/schema/mmc/postfix-book.schema new file mode 100644 index 0000000..8047a24 --- /dev/null +++ b/ldap/bootstrap/schema/mmc/postfix-book.schema @@ -0,0 +1,70 @@ +# $Id$ +# +# State of Mind +# Private Enterprise Number: 29426 +# +# OID prefix: 1.3.6.1.4.1.29426 +# +# Attributes: 1.3.6.1.4.1.29426.1.10.x +# + + +attributetype ( 1.3.6.1.4.1.29426.1.10.1 NAME 'mailHomeDirectory' + DESC 'The absolute path to the mail user home directory' + EQUALITY caseExactIA5Match + SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) + +attributetype ( 1.3.6.1.4.1.29426.1.10.2 NAME 'mailAlias' + DESC 'RFC822 Mailbox - mail alias' + EQUALITY caseIgnoreIA5Match + SUBSTR caseIgnoreIA5SubstringsMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{256} ) + +attributetype ( 1.3.6.1.4.1.29426.1.10.3 NAME 'mailUidNumber' + DESC 'UID required to access the mailbox' + EQUALITY integerMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE ) + +attributetype ( 1.3.6.1.4.1.29426.1.10.4 NAME 'mailGidNumber' + DESC 'GID required to access the mailbox' + EQUALITY integerMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE ) + +attributetype ( 1.3.6.1.4.1.29426.1.10.5 NAME 'mailEnabled' + DESC 'TRUE to enable, FALSE to disable account' + EQUALITY booleanMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE ) + +attributetype ( 1.3.6.1.4.1.29426.1.10.6 NAME 'mailGroupMember' + DESC 'Name of a mail distribution list' + EQUALITY caseExactIA5Match + SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) + +attributetype ( 1.3.6.1.4.1.29426.1.10.7 NAME 'mailQuota' + DESC 'Mail quota limit in kilobytes' + EQUALITY caseExactIA5Match + SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) + +attributetype ( 1.3.6.1.4.1.29426.1.10.8 NAME 'mailStorageDirectory' + DESC 'The absolute path to the mail users mailbox' + EQUALITY caseExactIA5Match + SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) + + +# +# Objects: 1.3.6.1.4.1.29426.1.2.2.x +# + +objectclass ( 1.3.6.1.4.1.29426.1.2.2.1 NAME 'PostfixBookMailAccount' + SUP top AUXILIARY + DESC 'Mail account used in Postfix Book' + MUST ( mail ) + MAY ( mailHomeDirectory $ mailAlias $ mailGroupMember + $ mailUidNumber $ mailGidNumber $ mailEnabled + $ mailQuota $mailStorageDirectory ) ) + +objectclass ( 1.3.6.1.4.1.29426.1.2.2.2 NAME 'PostfixBookMailForward' + SUP top AUXILIARY + DESC 'Mail forward used in Postfix Book' + MUST ( mail $ mailAlias )) +