mailu: store app password as list

This commit is contained in:
Brad Stein 2026-01-02 03:09:26 -03:00
parent 26f11db285
commit 5f7ea4544d
2 changed files with 2 additions and 2 deletions

View File

@ -181,7 +181,7 @@ def main():
if not app_pw:
app_pw = random_password()
attrs["mailu_app_password"] = app_pw
attrs["mailu_app_password"] = [app_pw]
kc_update_attributes(token, user, attrs)
log(f"Set mailu_app_password for {email}")

View File

@ -46,7 +46,7 @@ users=$(curl -s -H "Authorization: Bearer ${token}" \
echo "${users}" | jq -c '.[]' | while read -r user; do
username=$(echo "${user}" | jq -r '.username')
email=$(echo "${user}" | jq -r '.email // empty')
app_pw=$(echo "${user}" | jq -r '.attributes.mailu_app_password[0] // empty')
app_pw=$(echo "${user}" | jq -r '(.attributes.mailu_app_password[0] // .attributes.mailu_app_password // empty)')
[[ -z "${email}" || -z "${app_pw}" ]] && continue
if account_exists "${username}" "${email}"; then
echo "Skipping ${email}, already exists"