Skip to content

Preserve UTF-8 SMTP domains#274

Closed
vhafdal wants to merge 1 commit into
cosullivan:masterfrom
vhafdal:codex/smtputf8-idn-support
Closed

Preserve UTF-8 SMTP domains#274
vhafdal wants to merge 1 commit into
cosullivan:masterfrom
vhafdal:codex/smtputf8-idn-support

Conversation

@vhafdal

@vhafdal vhafdal commented Jul 15, 2026

Copy link
Copy Markdown

Summary

Preserves UTF-8 domain names when SMTP command parsing materializes domain strings for HELO, EHLO, MAIL FROM, and RCPT TO.

Root cause

SmtpServer already tokenizes bytes >= 0x80 as text and advertises SMTPUTF8. The mailbox local-part path decoded with UTF-8, but the domain side still used the default ASCII helper. That meant internationalized
domains such as dæmi.is were not preserved after parsing.

Changes

  • Decode HELO and EHLO domains with UTF-8.
  • Decode mailbox domains with UTF-8 when creating parsed mailbox addresses.
  • Add parser coverage for Icelandic examples:
    • EHLO dæmi.is
    • MAIL FROM:<þorsteinn@dæmi.is> SMTPUTF8
    • RCPT TO:<þorsteinn@dæmi.is>

Validation

  • dotnet build src/SmtpServer/SmtpServer.csproj
  • dotnet build src/SmtpServer.Tests/SmtpServer.Tests.csproj
  • git diff --check

Full test execution was not run on my host because the tests target net8.0, while the installed runtimes are .NET 9 and .NET 10.

@vhafdal

vhafdal commented Jul 15, 2026

Copy link
Copy Markdown
Author

Superseded by consolidated PR #284.

@vhafdal vhafdal closed this Jul 15, 2026
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.

1 participant