### Adding ldap-mailcow Container to docker-compose (YAML) Source: https://github.com/programmierus/ldap-mailcow/blob/master/README.md Defines a new service `ldap-mailcow` in `docker-compose.override.yml` to integrate the LDAP sync tool. It configures the image, network mode, container name, dependencies, volume mounts for database and configuration files, and essential environment variables for LDAP and mailcow API connectivity and sync settings. ```yaml ldap-mailcow: image: programmierus/ldap-mailcow network_mode: host container_name: mailcowcustomized_ldap-mailcow depends_on: - nginx-mailcow volumes: - ./data/ldap:/db:rw - ./data/conf/dovecot:/conf/dovecot:rw - ./data/conf/sogo:/conf/sogo:rw environment: - LDAP-MAILCOW_LDAP_URI=ldap(s)://dc.example.local - LDAP-MAILCOW_LDAP_BASE_DN=OU=Mail Users,DC=example,DC=local - LDAP-MAILCOW_LDAP_BIND_DN=CN=Bind DN,CN=Users,DC=example,DC=local - LDAP-MAILCOW_LDAP_BIND_DN_PASSWORD=BindPassword - LDAP-MAILCOW_API_HOST=https://mailcow.example.local - LDAP-MAILCOW_API_KEY=XXXXXX-XXXXXX-XXXXXX-XXXXXX-XXXXXX - LDAP-MAILCOW_SYNC_INTERVAL=300 - LDAP-MAILCOW_LDAP_FILTER=(&(objectClass=user)(objectCategory=person)(memberOf:1.2.840.113556.1.4.1941:=CN=Group,CN=Users,DC=example DC=local)) - LDAP-MAILCOW_SOGO_LDAP_FILTER=objectClass='user' AND objectCategory='person' AND memberOf:1.2.840.113556.1.4.1941:='CN=Group,CN=Users,DC=example DC=local' ``` -------------------------------- ### PHP Workaround for WebUI/EAS Authentication (PHP) Source: https://github.com/programmierus/ldap-mailcow/blob/master/README.md Provides a PHP code snippet to be inserted into the mailcow WebUI's `functions.inc.php` file. This code attempts IMAP authentication against Dovecot using the provided user credentials as a workaround to enable logging into the mailcow UI (and potentially EAS via app passwords) with LDAP credentials, bypassing the default mailcow UI authentication mechanism. It is noted as an unsupported and risky solution. ```php $mbox = imap_open ("{dovecot:993/imap/ssl/novalidate-cert}INBOX", $user, $pass); if ($mbox != false) { imap_close($mbox); return "user"; } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.