Skip to content

refactor: Migrate SASL_PASSWD ENV support#2605

Merged
polarathene merged 2 commits intodocker-mailserver:masterfrom
polarathene:refactor/migrate-env-sasl_passwd-support
Jun 5, 2022
Merged

refactor: Migrate SASL_PASSWD ENV support#2605
polarathene merged 2 commits intodocker-mailserver:masterfrom
polarathene:refactor/migrate-env-sasl_passwd-support

Conversation

@polarathene
Copy link
Copy Markdown
Member

@polarathene polarathene commented May 29, 2022

Description

I would like to merge this for git blame history, but otherwise see SASL_PASSWD being removed shortly after in next major.

See the prior PR this one builds off of for Relay support feature history if additional context is needed. These changes were originally part of the prior PR but seemed more suited for a separate review/discussion.

Changes:

  • SASL_PASSWD was an ENV introduced for the initial and very basic relay-host support offered back in 2016.
  • It is a legacy var that I assume is not in usage anymore. Documentation on the ENV isn't helpful (it's value should be a valid line for /etc/postfix/sasl_passwd config).
  • It has been moved into helpers/relay.sh which is where it belongs.
  • Tests using the ENV aren't actually using it (probably copy/paste from original test that didn't consider if it was necessary).
  • I believe it should be deprecated, or simply dropped in the next major release. I don't really see it serving any purpose that other relay ENV don't already cover, especially due to it's history and how relay-host support progressed.
Commit message for reference:
  • helpers/sasl.sh was to support an earlier ENV for SASL auth support. When extracting logic into individual helpers, it was assumed this was separate from relay support, which it appears was not the case.
  • The SASL_PASSWD ENV is specified in tests but no longer used. There is no external-domain.com relay configured or tested against anywhere in the project.
  • The ENV was likely used in tests prior to improved relay support that allowed for adding more than a single set of relay credentials.
  • It likewise has no real relevance anywhere else outside of relay.sh as it's the only portion of code to operate with it.
  • It's only relevant for SASL auth as an SMTP client, not the SMTP server (smtpd) SASL support that is delegated to Dovecot. Functionality has been completely migrated into relay.sh as a result.
  • Documentation is poor for this ENV, it is unlikely in wide use? Should consider for removal.
  • The ENV has been dependent upon RELAY_HOST to actually enable postfix to use /etc/postfix/sasl_passwd, thus not likely relevant in existing setups?
  • Migrate /etc/postfix/sasl_passwd check from tests.bats as it belongs to relay tests.

Type of change

  • Improvement (non-breaking change that does improve existing functionality)
  • Breaking change (Potentially)

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • New and existing unit tests pass locally with my changes

@polarathene polarathene self-assigned this May 29, 2022
@polarathene polarathene added priority/high service/postfix area/scripts kind/improvement Improve an existing feature, configuration file or the documentation labels May 29, 2022
@polarathene polarathene added this to the v11.1.0 milestone May 29, 2022
@polarathene polarathene added the pr/waiting for other PR to get merged This PR is waiting for another / other PR(s) to get merged label May 30, 2022
@polarathene polarathene marked this pull request as draft June 4, 2022 04:33
@polarathene polarathene force-pushed the refactor/migrate-env-sasl_passwd-support branch from 399be26 to ed262a5 Compare June 4, 2022 23:50
@polarathene polarathene marked this pull request as ready for review June 4, 2022 23:54
This helper was to support an earlier ENV for SASL auth support. When extracting logic into individual helpers, it was assumed this was separate from relay support, which it appears was not the case.

---

The `SASL_PASSWD` ENV is specified in tests but no longer used. There is no `external-domain.com` relay configured or tested against anywhere in the project.

The ENV was likely used in tests prior to improved relay support that allowed for adding more than a single set of relay credentials.

---

It likewise has no real relevance anywhere else outside of `relay.sh` as it's the only portion of code to operate with it.

It's only relevant for SASL auth as an SMTP client, not the SMTP server (`smtpd`) SASL support that is delegated to Dovecot. Functionality has been completely migrated into `relay.sh` as a result.

Documentation is poor for this ENV, it is unlikely in wide use? Should consider for removal.

---

The ENV has been dependent upon `RELAY_HOST` to actually enable postfix to use `/etc/postfix/sasl_passwd`, thus not likely relevant in existing setups?

---

Migrate `/etc/postfix/sasl_passwd` check from `tests.bats` as it belongs to relay tests.
@polarathene polarathene removed the pr/waiting for other PR to get merged This PR is waiting for another / other PR(s) to get merged label Jun 5, 2022
@polarathene polarathene force-pushed the refactor/migrate-env-sasl_passwd-support branch from ed262a5 to 0d38aef Compare June 5, 2022 02:51
Copy link
Copy Markdown
Member

@georglauterbach georglauterbach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏼

@polarathene polarathene merged commit 40e2d88 into docker-mailserver:master Jun 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/scripts kind/improvement Improve an existing feature, configuration file or the documentation priority/high service/postfix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants