From 5f7ea4544d67ae2def325f6180ad22dd00e3a139 Mon Sep 17 00:00:00 2001 From: Brad Stein Date: Fri, 2 Jan 2026 03:09:26 -0300 Subject: [PATCH] mailu: store app password as list --- scripts/mailu_sync.py | 2 +- scripts/nextcloud-mail-sync.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/mailu_sync.py b/scripts/mailu_sync.py index ee8aa18..4d08a62 100644 --- a/scripts/mailu_sync.py +++ b/scripts/mailu_sync.py @@ -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}") diff --git a/scripts/nextcloud-mail-sync.sh b/scripts/nextcloud-mail-sync.sh index 816b56a..4476e7f 100755 --- a/scripts/nextcloud-mail-sync.sh +++ b/scripts/nextcloud-mail-sync.sh @@ -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"