Describe the bug
On Windows with the regional format set to Turkish (tr-TR), adding an Outlook.com account fails with:
Required folder not found. Ensure your account has an `Inbox` folder, or if this is a Gmail account, verify that `All Mail` is enabled for IMAP in your Gmail settings.
The account does have an Inbox. Login succeeds, and the server lists the folder in the IMAP log:
5 LIST "" "*"
* LIST (\HasNoChildren) "/" Ar&AV8-iv
* LIST (\Marked \HasNoChildren) "/" Inbox
* LIST (\HasNoChildren \Junk) "/" Junk
* LIST (\HasNoChildren) "/" Outbox
* LIST (\HasNoChildren \Sent) "/" Sent
...
* LIST (\HasNoChildren \Trash) "/" Deleted
* LIST (\HasNoChildren \Drafts) "/" Drafts
5 OK LIST completed.
When the Windows regional format is switched to en-US, the same account adds and syncs normally.
Likely cause
Outlook doesn’t send a \Inbox special-use flag, so Mailspring has to find the inbox by name. My guess is that this case-insensitive comparison depends on the user’s locale. Under tr-TR, INBOX lowercases to ınbox (dotless ı, U+0131) instead of inbox, so the match fails. This is the well-known “Turkish I” problem. I haven’t confirmed it in the source code, but changing only the locale makes the error go away.
To Reproduce
- On Windows, set Settings → Time & language → Language & region → Regional format to Turkish.
- Start Mailspring and add an Outlook.com / Microsoft 365 account (OAuth).
- Login succeeds, but setup stops with “Required folder not found”.
- Set the regional format to English (United States), restart Mailspring and add the account again: it works.
Expected behavior
The Inbox folder is detected no matter which system locale is set. Folder-name matching should be locale-independent, for example ASCII-only lowercasing or the invariant/“C” locale.
Environment
- OS: Windows 11 Pro
- Mailspring: 1.26.2
- Account: Outlook.com (IMAP, XOAUTH2,
imap-mail.outlook.com:993) - Regional format: Turkish (
tr-TR)
Workaround (for other affected users)
Windows programs take their locale from the user’s regional format, not from environment variables like LANG. So the scripts below switch the current user’s format to en-US only while Mailspring is running, then restore it. No admin rights or reboot needed. Before switching, the script backs up HKCU\Control Panel\International, and it restores that backup afterwards, so custom date and number formats are kept.
Put both files in %LOCALAPPDATA%\Mailspring (next to Update.exe) and double-click Mailspring (English).cmd. Add the account, then quit Mailspring fully (tray icon → Quit). Closing the window isn’t enough.
Mailspring (English).cmd
@echo off
powershell.exe -NoProfile -ExecutionPolicy Bypass -File "%~dp0mailspring-english.ps1"
mailspring-english.ps1
# Opens Mailspring with a temporary en-US regional format (Turkish "I" issue).
# The original regional settings are restored when Mailspring fully exits.
$ErrorActionPreference = 'Stop'
$app = Get-ChildItem $PSScriptRoot -Directory -Filter 'app-*' |
Sort-Object { [version]($_.Name -replace '^app-', '') } -Descending |
Select-Object -First 1
$exe = Join-Path $app.FullName 'mailspring.exe'
$running = Get-Process mailspring, mailsync -ErrorAction SilentlyContinue
if ($running) {
Write-Host 'Mailspring is running, closing it...'
$running | Stop-Process -Force
Start-Sleep 2
}
# Back up all regional settings so custom date/number formats are kept
$original = (Get-Culture).Name
$backup = Join-Path $env:TEMP 'mailspring-international-backup.reg'
reg export 'HKCU\Control Panel\International' $backup /y | Out-Null
Write-Host "Temporarily switching regional format to en-US (current: $original)"
Set-Culture en-US
try {
$env:LANG = 'en_US.UTF-8'
$env:LC_ALL = 'en_US.UTF-8'
Start-Process $exe -ArgumentList '--lang=en-US'
Start-Sleep 5
Write-Host ''
Write-Host 'Add your account, then quit Mailspring COMPLETELY (tray icon > Quit).'
Write-Host 'Do not close this window; it closes itself when Mailspring exits.'
while (Get-Process mailspring -ErrorAction SilentlyContinue) { Start-Sleep 2 }
} finally {
Set-Culture $original
reg import $backup 2>&1 | Out-Null
Write-Host "Regional format restored: $original"
Start-Sleep 3
}
Notes:
- If the console window is closed while Mailspring is open, the restore doesn’t run. Fix it with
Set-Culture tr-TR, or re-import%TEMP%\mailspring-international-backup.reg. - While Mailspring is open, other apps you start may show English date and number formats.