hardware / mailserver

:warning: UNMAINTAINED - Simple and full-featured mail server using Docker
https://store.docker.com/community/images/hardware/mailserver
MIT License
1.29k stars 322 forks source link

implement single LDAP_URI instead of separate DB* variables for driver 'ldap' #415

Closed KampfCaspar closed 4 years ago

KampfCaspar commented 5 years ago

Description

LDAP configurations commonly take a single URI instead of separate host and port values. Up until now, mailserver (mis-)uses DBHOST and DBPORT and precludes me from using a ldaps:// connection.

I suggest better splitting the sql and ldap 'modes' by implementing a LDAP_URI configuration variable. For backwards compatability, it can default to 'ldap://DBHOST:DBPORT'.

Type of change

Please delete options that are not relevant.

Status

Todo List

How has this been tested ?

My implementation.

KampfCaspar commented 5 years ago

For added 'comparability', LDAP_BIND_DN should default to DBUSER and LDAP_BIND_PW to DBPASS. IMHO

PeerD commented 5 years ago

The potential problem I am seeing with this PR is that currently the content of DBHOST is written into /etc/hosts. Is that the reason why you default it to localhost (which is already in the hosts file)?

run.sh says

# DATABASES HOSTNAME CHECKING
# We need to set these in the hosts file before Unbound takes over for DNS
# ---------------------------------------------------------------------------------------------

What happens if unbound takes over with the proper hostname not in /etc/hosts?

KampfCaspar commented 5 years ago

Thats exactly why I defaulted to localhost.

The situation is slightly complicated, because an ldap uri does not necessarily contain a host element (ldapi). Short of trying to interpret the uri, there is no simple solution.

With my other PR #416 I try to allow for more dynamic 'host ip prefetching'.

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.