mirror of
https://github.com/docker-mailserver/docker-mailserver.git
synced 2025-08-03 01:24:52 +02:00
Added test to check email delivery for a other domain then the primary of the mailserver.
This commit is contained in:
parent
9e7959fafe
commit
04904e77c4
7 changed files with 89 additions and 3 deletions
|
@ -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
|
|
@ -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
|
|
@ -1051,6 +1051,22 @@ load 'test_helper/bats-assert/load'
|
|||
run docker exec mail_with_ldap /bin/sh -c "postmap -q employees@localhost.localdomain ldap:/etc/postfix/ldap-groups.cf"
|
||||
assert_success
|
||||
assert_output "some.user@localhost.localdomain"
|
||||
|
||||
# Test of the user part of the domain is not the same as the uniqueIdentifier part in the ldap
|
||||
run docker exec mail_with_ldap /bin/sh -c "postmap -q some.user.email@localhost.localdomain ldap:/etc/postfix/ldap-users.cf"
|
||||
assert_success
|
||||
assert_output "some.user.email@localhost.localdomain"
|
||||
|
||||
# Test email receiving from a other domain then the primary domain of the mailserver
|
||||
run docker exec mail_with_ldap /bin/sh -c "postmap -q some.other.user@localhost.otherdomain ldap:/etc/postfix/ldap-users.cf"
|
||||
assert_success
|
||||
assert_output "some.other.user@localhost.otherdomain"
|
||||
run docker exec mail_with_ldap /bin/sh -c "postmap -q postmaster@localhost.otherdomain ldap:/etc/postfix/ldap-aliases.cf"
|
||||
assert_success
|
||||
assert_output "some.other.user@localhost.otherdomain"
|
||||
run docker exec mail_with_ldap /bin/sh -c "postmap -q employees@localhost.otherdomain ldap:/etc/postfix/ldap-groups.cf"
|
||||
assert_success
|
||||
assert_output "some.other.user@localhost.otherdomain"
|
||||
}
|
||||
|
||||
@test "checking postfix: ldap custom config files copied" {
|
||||
|
@ -1099,6 +1115,14 @@ load 'test_helper/bats-assert/load'
|
|||
assert_output 1
|
||||
}
|
||||
|
||||
@test "checking dovecot: ldap mail delivery works for a different domain then the mailserver" {
|
||||
run docker exec mail_with_ldap /bin/sh -c "sendmail -f user@external.tld some.other.user@localhost.otherdomain < /tmp/docker-mailserver-test/email-templates/test-email.txt"
|
||||
sleep 10
|
||||
run docker exec mail_with_ldap /bin/sh -c "ls -A /var/mail/localhost.localdomain/some.other.user/new | wc -l"
|
||||
assert_success
|
||||
assert_output 1
|
||||
}
|
||||
|
||||
@test "checking dovecot: ldap config overwrites success" {
|
||||
run docker exec mail_with_ldap /bin/sh -c "grep 'hosts = ldap' /etc/dovecot/dovecot-ldap.conf.ext"
|
||||
assert_success
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue