[PR #406] [CLOSED] Update lib.go: Changing mailFromRE regex #549

Closed
opened 2026-03-15 14:25:28 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/axllent/mailpit/pull/406
Author: @ThomasLandauer
Created: 12/12/2024
Status: Closed

Base: developHead: patch-2


📝 Commits (2)

  • 3115e57 Update lib.go: Changing mailFromRE regex
  • a52ff39 Update lib.go

📊 Changes

1 file changed (+1 additions, -1 deletions)

View changed files

📝 server/smtpd/lib.go (+1 -1)

📄 Description

  • First change: Strictly speaking, there's no whitespace allowed: https://datatracker.ietf.org/doc/html/rfc5321#section-3.3

    Since it has been a common source of errors, it is worth noting that
    spaces are not permitted on either side of the colon following FROM
    in the MAIL command or TO in the RCPT command. The syntax is exactly
    as given above.

    But I agree that it's OK to allow it, but I'd restrict it to horizontal whitespace.

  • Second change: The pattern is still too liberal, since not all characters are allowed in an email address. But what's really important is that you can't accept an > or vertical whitespace here.

  • Third change: certainly no vertical whitespace allowed here.

If you agree, I'd do the same for the other regex'es


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/axllent/mailpit/pull/406 **Author:** [@ThomasLandauer](https://github.com/ThomasLandauer) **Created:** 12/12/2024 **Status:** ❌ Closed **Base:** `develop` ← **Head:** `patch-2` --- ### 📝 Commits (2) - [`3115e57`](https://github.com/axllent/mailpit/commit/3115e574d714804e5c88fb25aa8de120c593c2bb) Update lib.go: Changing `mailFromRE` regex - [`a52ff39`](https://github.com/axllent/mailpit/commit/a52ff39ae3f24705e68dfd245bce7792b9f36b3c) Update lib.go ### 📊 Changes **1 file changed** (+1 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `server/smtpd/lib.go` (+1 -1) </details> ### 📄 Description * First change: Strictly speaking, there's no whitespace allowed: https://datatracker.ietf.org/doc/html/rfc5321#section-3.3 > Since it has been a common source of errors, it is worth noting that spaces are not permitted on either side of the colon following FROM in the MAIL command or TO in the RCPT command. The syntax is exactly as given above. But I agree that it's OK to allow it, but I'd restrict it to *horizontal* whitespace. * Second change: The pattern is still too liberal, since not all characters are allowed in an email address. But what's really important is that you can't accept an `>` or vertical whitespace here. * Third change: certainly no vertical whitespace allowed here. If you agree, I'd do the same for the other regex'es --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-15 14:25:28 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/mailpit#549
No description provided.