Skip to content

Fixed signing in to mailboxes with characters beyond ASCII in the username or password - #1224

Merged
SommerEngineering merged 16 commits into
MindWorkAI:mainfrom
peerschuett:fix-mail-provider-login
Nov 24, 2026
Merged

SommerEngineering merged 16 commits into
MindWorkAI:mainfrom
peerschuett:fix-mail-provider-login

Conversation

@peerschuett

@peerschuett peerschuett commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Some users could not sign in to their mailbox because their password contained a character beyond ASCII, in this case a German umlaut, and AI Studio reported a wrong password. MailKit sends usernames and passwords in UTF-8, but depending on its configuration, a mail server may expect another encoding. Microsoft Exchange, for example, may decode them with the code page of its Windows system: windows-1252 in Western Europe, windows-1250 in Central Europe, windows-1251 for Cyrillic, windows-1254 in Turkey, or shift_jis in Japan.

What changes:

  • Encoding per mailbox: Every mailbox has an encoding for its username and password, utf-8 by default. Users choose it in the server details of the mailbox dialog, under "Encoding of username and password". AI Studio offers every encoding .NET knows which keeps ASCII as it is, and stores its name, such as windows-1254. UTF-16 and UTF-32 are left out because SASL PLAIN separates its parts with null bytes; UTF-8 already covers every Unicode character, Chinese, Japanese, and Korean included.
  • Encoding per mail server of the organization: A configuration plugin may set PasswordEncoding for an entry of MAILBOX_PROVIDERS. MailServerPolicy applies it to every connection to that server, the synchronization and mailboxes added before included, and the dialog shows it read-only.
  • One sign-in, one attempt: AI Studio never tries a second encoding on its own. With a typo in such a password, every test would cost two failed attempts, which may lock the account. Instead, after the server rejected a username or password with characters beyond ASCII, the dialog explains the setting and offers "Test again with …", with the code page common for the language of the operating system. Every click is exactly one test. The dialog offers neither the explanation nor the button for the well-known providers in its list, such as Gmail or mailbox.org: there is no IT department to ask, and their servers serve users of every language.
  • Nothing sent which cannot work: MailKit takes an encoding only for SASL PLAIN. When the chosen encoding lacks a character of the username or password, such as ş or ẞ in windows-1252, or when it is not UTF-8 and the server offers no PLAIN, AI Studio sends nothing and says why (new failure UNSUITABLE_ENCODING). For encodings other than UTF-8, the text is normalized to NFC first, so a decomposed ä, e.g., from a password manager, still fits windows-1252.
  • Secret store unchanged: Usernames and passwords stay in the secret store of the operating system as they are; the encoding applies only when signing in. New tests in C# and Rust show that such passwords pass the bridge between app and runtime unchanged.
  • Agent instructions: AGENTS.md gets the rule "Text beyond ASCII", for every language and script.
  • Changelog entries for users and IT departments, and the German translation.

The first version of this pull request knew only UTF8 and WINDOWS_1252. Configuration plugins now name the encoding as .NET does, e.g., utf-8 or windows-1252. The old names are invalid and leave the entry out; since no release contained them, there is no compatibility for them.

Related proposal or issue

None. Users reported the bug directly.

How did you test it?

  • Ran dotnet run -- verify: 7,211 .NET tests, the trim smoke test, 379 Rust tests, Clippy, and the model sources.
  • New unit tests check the bytes of each encoding through MailKit's own SaslMechanismPlain for characters of several scripts and code pages, exactly one sign-in attempt, nothing sent for an unsuitable encoding, the encoding of the organization, the suggestion per language, and the encryption of such passwords in C# and Rust.

Wiki

Users, page "Mailboxes" (German: "Postfächer"), new section "Characters beyond ASCII in the username or password", requires AI Studio v26.11.2 or newer: which encoding a mail server may expect, where to choose it, the button "Test again with …" after a rejected sign-in, why AI Studio never tries another encoding on its own, and when it sends nothing. Not for the well-known providers in the list of the dialog, such as Gmail or mailbox.org, also when users enter their host themselves.

IT departments, page "Confidence and Data Security", row CONFIG["MAILBOX_PROVIDERS"]: the optional field PasswordEncoding with examples such as windows-1252, windows-1254, or shift_jis. Every mailbox on that server signs in with it, also one added before, and users can't change it. An invalid name leaves out the entry as a whole.

Both are prepared for the release.

Required statements

  • Review: I have reviewed every change in this pull request and can explain it when asked.
  • License: I license my contribution in this pull request, including all commits I add to it later, under the MIT License, and I agree that it is distributed as part of MindWork AI Studio under the project license or under the MIT License.
  • Right to contribute: The contribution is my own work, or I have permission to submit it, including the consent of my employer or client where needed. To the best of my knowledge, it does not infringe the rights of others, and AI-generated parts do not reproduce third-party code under incompatible terms.
  • Changes by maintainers: I understand that the maintainers will change this pull request to fit the product, and that they may close it.

Credits (optional)

  • Credit me with my GitHub username only.
  • Do not credit me.

Peer Hogeterp added 4 commits November 23, 2026 14:22
Many users of AI Studio write German, and a mailbox password with an
umlaut failed to sign in at Exchange because the encoding was never
considered. Agents now keep the German special characters in mind
wherever text leaves or enters the app as bytes: the encoding the other
side expects, the Unicode normalization, and tests with such characters.
A mailbox now stores how its username and password are encoded when
signing in: UTF-8, as before, or Windows-1252, which Microsoft Exchange
expects. Mailboxes stored earlier load with UTF-8, and an encoding this
version does not know keeps the mailbox from signing in at all.

Windows-1252 goes through the SASL mechanism PLAIN only: MailKit sends
the LOGIN command in UTF-8, whatever encoding it is handed. A username
or password the encoding lacks a character of is never sent in it, and
Windows-1252 composes a decomposed umlaut first.

Nothing changes yet for existing mailboxes; the connection test which
finds the encoding follows in the next commit.
…assword

Microsoft Exchange expects the username and the password in
Windows-1252, while AI Studio always sent UTF-8. A password with an
umlaut, ß, §, or € was therefore refused.

The connection test, which the user starts, may now try the other
encoding once more when the server refused the first one, but only when
the username or the password holds a character beyond ASCII. The
encoding the server accepted is stored with the mailbox. A refused
sign-in on record is cleared once the mailbox is saved with the new
encoding. The synchronization, a manual retry, and creating a folder
still sign in exactly once, with the stored encoding.
@peerschuett
peerschuett requested review from a team as code owners November 23, 2026 17:30
@peerschuett peerschuett self-assigned this Nov 24, 2026
@SommerEngineering SommerEngineering changed the title Fix Umlaute in mail provider login Fixed signing in to mailboxes with characters beyond ASCII in the username or password Nov 24, 2026
@SommerEngineering
SommerEngineering requested a review from a team as a code owner November 24, 2026 14:50
@SommerEngineering
SommerEngineering merged commit c72a194 into MindWorkAI:main Nov 24, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants