Skip to content

feat: Add password confirmation#4072

Merged
casperklein merged 9 commits intodocker-mailserver:masterfrom
casperklein:password-confirmation
Jun 19, 2024
Merged

feat: Add password confirmation#4072
casperklein merged 9 commits intodocker-mailserver:masterfrom
casperklein:password-confirmation

Conversation

@casperklein
Copy link
Copy Markdown
Member

@casperklein casperklein commented Jun 16, 2024

Description

Fixes: #4071 (typo when entering the password)

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Improvement (non-breaking change that does improve existing functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (README.md or the documentation under docs/)
  • If necessary, I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have added information about changes made in this PR to CHANGELOG.md

@casperklein casperklein self-assigned this Jun 16, 2024
@casperklein casperklein added area/scripts kind/improvement Improve an existing feature, configuration file or the documentation labels Jun 16, 2024
@casperklein casperklein added this to the v14.1.0 milestone Jun 16, 2024
More strict handling of the password parameter. After `shift`, `$*` considers not only the first parameter, but all as password.
`setup email add [email protected] top secret` makes "topsecret" the password, which is weird.
@casperklein
Copy link
Copy Markdown
Member Author

@georglauterbach @polarathene
See my second commit 7a4186f. Any idea why this was implemented this way in the first place?

If you agree, I'll change this logic in the other files as well.

@casperklein casperklein marked this pull request as ready for review June 16, 2024 22:14
@polarathene
Copy link
Copy Markdown
Member

See my second commit 7a4186f.

More strict handling of the password parameter.
After shift, $* considers not only the first parameter, but all as password.
setup email add [email protected] top secret makes "topsecret" the password, which is weird.

Any idea why this was implemented this way in the first place?

I cannot recall, the scripts for all of these features was inconsistent and messy (Not that the unified approach I refactored is any more pleasant to work with). It was probably a naive approach. If someone wants spaces they should quote wrap, no clue why we'd take in additional parameters, I think some utilities did have sanity checks on parameter length.

This is really something that'd be much nicer in Rust or similar instead of the assortment of shell scripts and awkward syntax required for some of the logic which is not as nice to maintain.


If there was a reason for it that isn't obvious and we break something by removing the shift logic, then we revert and add test cases 😅

I assume the shift was used for the convenience of passing remaining params to a function call with ${@}? I haven't looked at those scripts in some time.

The reference issue this is a fix for I think was more of a UX error with the omission of a password, there is no prompt provided as context for "Enter a password" (there is in the script... but not in their output of the bug report? 🤷‍♂️ )

polarathene
polarathene previously approved these changes Jun 18, 2024

# Also used by addsaslpassword
function _password_request_if_missing() {
local CONFIRM
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Perhaps PASSWD_CONFIRM or similar would be a bit better in context. I'm not fussed either way though.

@georglauterbach
Copy link
Copy Markdown
Member

I don't know either why we use ${*}, ${2} seems more appropriate 👍🏼

@casperklein casperklein dismissed stale reviews from georglauterbach and polarathene via e7fd385 June 18, 2024 18:30
@casperklein casperklein enabled auto-merge (squash) June 18, 2024 18:37
@casperklein casperklein disabled auto-merge June 18, 2024 18:45
@casperklein casperklein enabled auto-merge (squash) June 18, 2024 22:22
Copy link
Copy Markdown
Member

@polarathene polarathene left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@casperklein casperklein merged commit d7dab2d into docker-mailserver:master Jun 19, 2024
@casperklein casperklein deleted the password-confirmation branch June 19, 2024 08:36
@georglauterbach georglauterbach modified the milestones: v14.1.0, v15.0.0 Sep 26, 2024
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug report: adding new email account using setup email is failing

3 participants