Skip to content

[BUG] SASLAUTHD_LDAP_SSL=1 does not set ldaps:// #1983

@kevin-leong

Description

@kevin-leong

Bug Report

Context

What is affected by this bug?

Setting the environmental variable SASLAUTHD_LDAP_SSL to "1" does not set "ldaps://" in /etc/saslauthd.conf. This is breaking saslauthd from working as the parameter "ldap_servers" is not set to a proper URI.

When does this occur?

When setting the environmental variable SASLAUTHD_LDAP_SSL to "1"

How do we replicate the issue?

Set the environmental variable SASLAUTHD_LDAP_SSL to "1".

Behavior

Actual Behavior

The parameter "ldap_servers" in the file /etc/saslauthd.conf is being set like the below when setting the environmental variable SASLAUTHD_LDAP_SSL to "1".

ldap_servers: 10.10.10.10

I think the problem seems to be with the logic in https://github.com/docker-mailserver/docker-mailserver/blob/master/target/scripts/startup/setup-stack.sh:

if [[ -z ${SASLAUTHD_LDAP_SSL} ]] || [[ ${SASLAUTHD_LDAP_SSL} -eq 0 ]]
then
    SASLAUTHD_LDAP_PROTO='ldap://' || SASLAUTHD_LDAP_PROTO='ldaps://'
fi

When the environmental variable SASLAUTHD_LDAP_SSL to "1", the logic above will set SASLAUTHD_LDAP_PROTO to "" (i.e empty). Later in the code when SASLAUTHD_LDAP_PROTO is used, this parameter will be "" (i.e empty) and so SASLAUTHD_LDAP_SERVER will only be printed.

if [[ ! -f /etc/saslauthd.conf ]]  then
    _notify 'inf' 'Creating /etc/saslauthd.conf'
    cat > /etc/saslauthd.conf << EOF
ldap_servers: ${SASLAUTHD_LDAP_PROTO}${SASLAUTHD_LDAP_SERVER}

If I am not mistaken, I think this logic needs to be updated so that it properly sets SASLAUTHD_LDAP_PROTO='ldaps://' when the environmental variable SASLAUTHD_LDAP_SSL to "1".

Expected Behavior

The parameter "ldap_servers" in the file /etc/saslauthd.conf should be set like the below when setting the environmental variable SASLAUTHD_LDAP_SSL to "1".

ldap_servers: ldaps://10.10.10.10

Your Environment

  • version: v
  • available RAM: GB
  • Docker version: v
  • docker-compose version: v

Environment Variables

SASLAUTHD_LDAP_SSL=1 

Relevant Stack Traces

# BEGIN

# END

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions