1
1
Fork 0
mirror of https://github.com/docker-mailserver/docker-mailserver synced 2024-05-27 05:36:06 +02:00
docker-mailserver/docs/content/advanced/auth-ldap.md

101 lines
2.6 KiB
Markdown
Raw Normal View History

2017-07-03 13:47:12 +02:00
### Introduction
Getting started with ldap and this mailserver we need to take 3 parts in account:
* POSTFIX
* DOVECOT
* SASLAUTHD (this can also be handled by dovecot above)
2017-07-03 13:47:48 +02:00
### List with the variables to control the container provisioning
2017-07-03 13:47:12 +02:00
__POSTFIX__:
* `LDAP_QUERY_FILTER_USER`
* `LDAP_QUERY_FILTER_GROUP`
* `LDAP_QUERY_FILTER_ALIAS`
2017-08-31 10:32:43 +02:00
* `LDAP_QUERY_FILTER_DOMAIN`
2017-07-03 13:47:12 +02:00
__SASLAUTHD__:
* `SASLAUTHD_LDAP_FILTER`
__DOVECOT__:
* `DOVECOT_USER_FILTER`
* `DOVECOT_PASS_FILTER`
2017-04-19 10:49:26 +02:00
**NOTE**: This page will provide several use cases like recipes to show, how this project can be used with it's LDAP Features.
### Ldap Setup - Kopano/Zarafa
```
---
version: '2'
services:
mail:
2017-04-27 18:01:51 +02:00
image: tvial/docker-mailserver:latest
2017-04-19 10:49:26 +02:00
hostname: mail
domainname: domain.com
container_name: mail
ports:
- "25:25"
- "143:143"
- "587:587"
- "993:993"
volumes:
- maildata:/var/mail
- mailstate:/var/mail-state
- ./config/:/tmp/docker-mailserver/
environment:
2017-07-03 13:52:19 +02:00
# We are not using dovecot here
2017-04-19 10:49:26 +02:00
- SMTP_ONLY=1
- ENABLE_SPAMASSASSIN=1
- ENABLE_CLAMAV=1
- ENABLE_FAIL2BAN=1
- ENABLE_POSTGREY=1
- SASLAUTHD_PASSWD=
2017-07-03 13:52:19 +02:00
2017-04-19 10:49:26 +02:00
# >>> SASL Authentication
- ENABLE_SASLAUTHD=1
- SASLAUTHD_LDAP_SERVER=<yourLdapContainer/yourLdapServer>
- SASLAUTHD_LDAP_PROTO=
- SASLAUTHD_LDAP_BIND_DN=cn=Administrator,cn=Users,dc=mydomain,dc=loc
- SASLAUTHD_LDAP_PASSWORD=mypassword
- SASLAUTHD_LDAP_SEARCH_BASE=dc=mydomain,dc=loc
2017-07-03 13:52:19 +02:00
- SASLAUTHD_LDAP_FILTER="(&(sAMAccountName=%U)(objectClass=person))"
2017-04-19 10:49:26 +02:00
- SASLAUTHD_MECHANISMS=ldap
# <<< SASL Authentication
2017-07-03 13:52:19 +02:00
2017-04-19 10:49:26 +02:00
# >>> Postfix Ldap Integration
- ENABLE_LDAP=1
- LDAP_SERVER_HOST=<yourLdapContainer/yourLdapServer>
- LDAP_SEARCH_BASE=dc=mydomain,dc=loc
- LDAP_BIND_DN=cn=Administrator,cn=Users,dc=mydomain,dc=loc
- LDAP_BIND_PW=mypassword
2017-07-03 13:52:19 +02:00
- LDAP_QUERY_FILTER_USER="(&(objectClass=user)(mail=%s))"
- LDAP_QUERY_FILTER_GROUP="(&(objectclass=group)(mail=%s))"
- LDAP_QUERY_FILTER_ALIAS="(&(objectClass=user)(otherMailbox=%s))"
2017-08-31 10:34:31 +02:00
- LDAP_QUERY_FILTER_DOMAIN="(&(|(mail=*@%s)(mailalias=*@%s)(mailGroupMember=*@%s))(mailEnabled=TRUE))"
2017-04-19 10:49:26 +02:00
# <<< Postfix Ldap Integration
2017-07-03 13:52:19 +02:00
2017-04-19 10:49:26 +02:00
# >>> Kopano Integration
- ENABLE_POSTFIX_VIRTUAL_TRANSPORT=1
- POSTFIX_DAGENT=lmtp:kopano:2003
# <<< Kopano Integration
2017-07-03 13:52:19 +02:00
2017-04-19 10:49:26 +02:00
- ONE_DIR=1
- DMS_DEBUG=0
- SSL_TYPE=letsencrypt
- PERMIT_DOCKER=host
cap_add:
- NET_ADMIN
volumes:
maildata:
driver: local
mailstate:
driver: local
```