From bee8910fff808f2a644af22792fd21c9f34ef16f Mon Sep 17 00:00:00 2001 From: Tero Date: Fri, 18 Sep 2026 12:43:20 +0300 Subject: [PATCH] Some script fixes --- migration/New-AccountPlan.ps1 | 2 +- migration/README.md | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/migration/New-AccountPlan.ps1 b/migration/New-AccountPlan.ps1 index edc1702..c98ec06 100644 --- a/migration/New-AccountPlan.ps1 +++ b/migration/New-AccountPlan.ps1 @@ -10,7 +10,7 @@ param( [Parameter(Mandatory = $true)][string]$OutFile ) -$rows = Import-Csv -Path $CsvPath +$rows = @(Import-Csv -Path $CsvPath) $missing = $rows | Where-Object { -not $_.new_password } if ($missing) { diff --git a/migration/README.md b/migration/README.md index 72ac004..d919b8c 100644 --- a/migration/README.md +++ b/migration/README.md @@ -73,7 +73,7 @@ set to `new_password` and any `aliases`), so re-running after edits is safe. Linux: ```bash -export STALWART_URL="https://mail.eternityproject.fi" +export STALWART_URL="http://127.0.0.1:8081" export STALWART_USER="admin" export STALWART_PASSWORD="" @@ -84,7 +84,7 @@ stalwart-cli apply --file accounts-plan.ndjson Windows: ```powershell -$env:STALWART_URL = "https://mail.eternityproject.fi" +$env:STALWART_URL = "http://localhost:8081" $env:STALWART_USER = "admin" $env:STALWART_PASSWORD = "" @@ -92,6 +92,14 @@ stalwart-cli apply --file accounts-plan.ndjson --dry-run stalwart-cli apply --file accounts-plan.ndjson ``` +Use the permanent administrator username and password created in the Stalwart setup UI, not a mailbox login. The default Compose deployment binds the administration API only to the local host, so `https://mail.eternityproject.fi` is not the CLI endpoint unless you have separately configured a reverse proxy for it. Confirm the CLI can reach and authenticate to the local API before applying a real plan: + +```powershell +stalwart-cli apply --url http://localhost:8081 --user admin --file accounts-plan.ndjson --dry-run +``` + +The command prompts for the password when `STALWART_PASSWORD` and `--password` are omitted. If the command says `authentication failed`, reset or use the correct permanent administrator password in the Stalwart WebUI. If it says `failed to connect`, verify `docker compose ps stalwart` and use `http://localhost:8081` on Docker Desktop or `http://127.0.0.1:8081` directly on the Linux server. + ## 5. Copy mail with imapsync The sync scripts use the upstream `gilleslamiral/imapsync` Docker image. The first