feat: Add password confirmation (#4072)
Co-authored-by: Georg Lauterbach <44545919+georglauterbach@users.noreply.github.com>
This commit is contained in:
parent
98cbcfc171
commit
d7dab2d20d
|
@ -6,6 +6,11 @@ All notable changes to this project will be documented in this file. The format
|
|||
|
||||
> **Note**: Changes and additions listed here are contained in the `:edge` image tag. These changes may not be as stable as released changes.
|
||||
|
||||
### Added
|
||||
|
||||
- **Internal:**
|
||||
- Add password confirmation to several `setup.sh` commands ([#4072](https://github.com/docker-mailserver/docker-mailserver/pull/4072))
|
||||
|
||||
### Updates
|
||||
|
||||
- **Fail2ban**:
|
||||
|
|
|
@ -7,8 +7,7 @@ function _main() {
|
|||
_require_n_parameters_or_print_usage 1 "${@}"
|
||||
|
||||
local MAIL_ACCOUNT="${1}"
|
||||
shift
|
||||
local PASSWD="${*}"
|
||||
local PASSWD="${2}"
|
||||
|
||||
_manage_accounts_dovecotmaster_create "${MAIL_ACCOUNT}" "${PASSWD}"
|
||||
}
|
||||
|
|
|
@ -7,8 +7,7 @@ function _main() {
|
|||
_require_n_parameters_or_print_usage 1 "${@}"
|
||||
|
||||
local MAIL_ACCOUNT="${1}"
|
||||
shift
|
||||
local PASSWD="${*}"
|
||||
local PASSWD="${2}"
|
||||
|
||||
_manage_accounts_create "${MAIL_ACCOUNT}" "${PASSWD}"
|
||||
|
||||
|
|
|
@ -8,8 +8,7 @@ function _main() {
|
|||
|
||||
local DOMAIN="${1}"
|
||||
local RELAY_ACCOUNT="${2}"
|
||||
shift 2
|
||||
local PASSWD="${*}"
|
||||
local PASSWD="${3}"
|
||||
|
||||
_validate_parameters
|
||||
_add_relayhost_credentials
|
||||
|
|
|
@ -7,8 +7,7 @@ function _main() {
|
|||
_require_n_parameters_or_print_usage 1 "${@}"
|
||||
|
||||
local MAIL_ACCOUNT="${1}"
|
||||
shift
|
||||
local PASSWD="${*}"
|
||||
local PASSWD="${2}"
|
||||
|
||||
_manage_accounts_dovecotmaster_update "${MAIL_ACCOUNT}" "${PASSWD}"
|
||||
}
|
||||
|
|
|
@ -7,8 +7,7 @@ function _main() {
|
|||
_require_n_parameters_or_print_usage 1 "${@}"
|
||||
|
||||
local MAIL_ACCOUNT="${1}"
|
||||
shift
|
||||
local PASSWD="${*}"
|
||||
local PASSWD="${2}"
|
||||
|
||||
_manage_accounts_update "${MAIL_ACCOUNT}" "${PASSWD}"
|
||||
}
|
||||
|
|
|
@ -98,9 +98,14 @@ function __account_already_exists() {
|
|||
|
||||
# Also used by addsaslpassword
|
||||
function _password_request_if_missing() {
|
||||
local PASSWD_CONFIRM
|
||||
if [[ -z ${PASSWD} ]]; then
|
||||
read -r -s -p 'Enter Password: ' PASSWD
|
||||
echo
|
||||
[[ -z ${PASSWD} ]] && _exit_with_error 'Password must not be empty'
|
||||
|
||||
read -r -s -p 'Confirm Password: ' PASSWD_CONFIRM
|
||||
echo
|
||||
[[ ${PASSWD} != "${PASSWD_CONFIRM}" ]] && _exit_with_error 'Passwords do not match!'
|
||||
fi
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue