1
0
mirror of https://github.com/docker-mailserver/docker-mailserver.git synced 2025-08-08 23:06:49 +02:00

tests: Revise LDAP config + setup (#3514)

* chore: Use  white-space in query filters to improve readability

* tests: LDAP ENV query filters documented

- These filters remain roughly the same as they were before. The conditions are the same, but restructured to make the complimentary constraints more separated from the actual target attribtues.
- The DOMAIN query additionally includes the `mailAlias` from `PostfixBookMailAccount` class as well.
- Heavy inline documentation breaking down how the filters work for any maintainer to reference. This will likely be migrated after revision into our user docs for LDAP. Some quirks have also been noted with advice for future changes.

* tests: LDAP - Support test-case specific containers

A bit more complicated than other test files due to the larger ENV config array that most containers may need to share.

Example introduced with the test-case checking custom config file support.

* tests: Adjust LDAP test configs

- Paths for `.ldif` files used with volumes shortened
- Postfix LDAP `.cf` files adjusted to conventions used in LDAP tests.
This commit is contained in:
Brennan Kinney
2023-08-29 23:52:06 +12:00
committed by GitHub
parent 19b72aead3
commit e025e4c696
9 changed files with 120 additions and 37 deletions

View File

@ -0,0 +1,16 @@
# The root object of the tree, all entries will branch off this one:
dn: dc=example,dc=test
# DN is formed from `example.test` DNS labels:
# NOTE: This is just a common convention (not dependent on hostname or any external config)
objectClass: dcObject
# Must reference left most component:
dc: example
# It's required to use an `objectClass` that implements a "Structural Class":
objectClass: organization
# Value is purely descriptive, not important to tests:
o: DMS Test
# User accounts will belong to this subtree:
dn: ou=users,dc=example,dc=test
objectClass: organizationalUnit
ou: users

View File

@ -0,0 +1,21 @@
# NOTE: A standard user account to test against
dn: uid=some.user,ou=users,dc=example,dc=test
objectClass: inetOrgPerson
objectClass: PostfixBookMailAccount
cn: Some User
givenName: Some
surname: User
userID: some.user
# Password is: secret
userPassword: {SSHA}eLtqGpid+hkSVhxvsdTPztv4uapRofGx
mail: some.user@localhost.localdomain
# postfix-book.schema:
mailAlias: postmaster@localhost.localdomain
mailGroupMember: employees@localhost.localdomain
mailHomeDirectory: /var/mail/localhost.localdomain/some.user/
mailStorageDirectory: maildir:/var/mail/localhost.localdomain/some.user/
# postfix-book.schema generic options:
mailEnabled: TRUE
mailUidNumber: 5000
mailGidNumber: 5000
mailQuota: 10240

View File

@ -0,0 +1,22 @@
# NOTE: This user differs via the domain-part of their mail address
# They also have their mail directory attributes using the primary domain, not their domain-part
dn: uid=some.other.user,ou=users,dc=example,dc=test
objectClass: inetOrgPerson
objectClass: PostfixBookMailAccount
cn: Some Other User
givenName: Some
surname: Other User
userID: some.other.user
# Password is: secret
userPassword: {SSHA}eLtqGpid+hkSVhxvsdTPztv4uapRofGx
mail: some.other.user@localhost.otherdomain
# postfix-book.schema:
mailAlias: postmaster@localhost.otherdomain
mailGroupMember: employees@localhost.otherdomain
mailHomeDirectory: /var/mail/localhost.localdomain/some.other.user/
mailStorageDirectory: maildir:/var/mail/localhost.localdomain/some.other.user/
# postfix-book.schema generic options:
mailEnabled: TRUE
mailUidNumber: 5000
mailGidNumber: 5000
mailQuota: 10240

View File

@ -0,0 +1,20 @@
# NOTE: This user differs by local-part of mail address not matching their uniqueIdentifier attribute
# They also do not have any alias or groups configured
dn: uid=some.user.id,ou=users,dc=example,dc=test
objectClass: inetOrgPerson
objectClass: PostfixBookMailAccount
cn: Some User
givenName: Some
surname: User
userID: some.user.id
# Password is: secret
userPassword: {SSHA}eLtqGpid+hkSVhxvsdTPztv4uapRofGx
mail: some.user.email@localhost.localdomain
# postfix-book.schema:
mailHomeDirectory: /var/mail/localhost.localdomain/some.user.id/
mailStorageDirectory: maildir:/var/mail/localhost.localdomain/some.user.id/
# postfix-book.schema generic options:
mailEnabled: TRUE
mailUidNumber: 5000
mailGidNumber: 5000
mailQuota: 10240