Skip to content

[BUG] SASL Relay is broken when using only postfix-sasl-password.cf #2964

@reneploetz

Description

@reneploetz

Miscellaneous first checks

  • I checked that all ports are open and not blocked by my ISP / hosting provider.
  • I know that SSL errors are likely the result of a wrong setup on the user side and not caused by DMS itself. I'm confident my setup is correct.

Affected Component(s)

Relaying emails

What happened and when does this occur?

Commit fe21fe7 might have broken the relay host support when using only /tmp/docker-mailserver/postfix-sasl-password.cf.

The condition in line 65 of target/scripts/helpers/relay.sh before was:

  if [[ ! -f /tmp/docker-mailserver/postfix-sasl-password.cf ]] \
    && [[ -z ${RELAY_USER} || -z ${RELAY_PASSWORD} ]] \
    && [[ -z ${SASL_PASSWD} ]]

Now the condition is:

  if [[ ! -f /tmp/docker-mailserver/postfix-sasl-password.cf ]] \
    && [[ -z ${RELAY_USER} ]] || [[ -z ${RELAY_PASSWORD} ]]

The problem is that this condition seems to be only non-satisfiable if RELAY_PASSWORD set to a nonempty value - regardless of whether the user only wants to use the data from postfix-sasl-password.cf

It appears that this is a bug as the related tickets do not specify this kind of change.

What did you expect to happen?

I would suggest to fix the condition to preserve the backwards compatibility, e.g.:

  if [[ ! -f /tmp/docker-mailserver/postfix-sasl-password.cf ]] \
    && [[ -z ${RELAY_USER} || -z ${RELAY_PASSWORD} ]]

How do we replicate the issue?

  1. Startup the container with RELAY_HOST=any-value and postfix-sasl-password.cf existing
  2. "Missing relay-host mapped credentials provided via ENV, or from postfix-sasl-password.cf" is being printed on stdout.

DMS version

master

What operating system is DMS running on?

Linux

Which operating system version?

Debian 11

What instruction set architecture is DMS running on?

AMD64 / x86_64

What container orchestration tool are you using?

Docker

docker-compose.yml

No response

Relevant log output

No response

Other relevant information

No response

What level of experience do you have with Docker and mail servers?

  • I am inexperienced with docker
  • I am rather experienced with docker
  • I am inexperienced with mail servers
  • I am rather experienced with mail servers
  • I am uncomfortable with the CLI
  • I am rather comfortable with the CLI

Code of conduct

Improvements to this form?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions