Skip to content

SS-2 Tighten SMTP parser syntax handling#278

Closed
vhafdal wants to merge 1 commit into
cosullivan:masterfrom
vhafdal:ss-2-parser-strictness
Closed

SS-2 Tighten SMTP parser syntax handling#278
vhafdal wants to merge 1 commit into
cosullivan:masterfrom
vhafdal:ss-2-parser-strictness

Conversation

@vhafdal

@vhafdal vhafdal commented Jul 15, 2026

Copy link
Copy Markdown

Summary

Tightens SMTP parser handling for malformed known commands.

Root Cause

Some command parsers accepted a valid prefix and returned a command without verifying the command ended cleanly. MAIL FROM also treated malformed trailing ESMTP parameters as if no parameters were supplied. At the top-level TryMake path, syntax errors from recognized commands could be overwritten by later parser attempts and reported as an unrecognized command.

Changes

  • Preserve syntax errors from recognized command parsers in top-level TryMake.
  • Require HELO/EHLO parsed domains and address literals to be followed only by command end/whitespace.
  • Reject malformed trailing MAIL FROM ESMTP parameters instead of silently using an empty parameter dictionary.
  • Add regression tests for malformed HELO/EHLO/MAIL inputs and top-level syntax error reporting.

Validation

  • DOTNET_ROLL_FORWARD=Major dotnet test src/SmtpServer.Tests/SmtpServer.Tests.csproj
  • Result: 126 passed, 1 skipped.

Jira

  • SS-2

@vhafdal
vhafdal marked this pull request as ready for review July 15, 2026 11:43
@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