[GH-ISSUE #622] Mailpit accepts RCPT TO with malformed source route syntax instead of rejecting it #389

Closed
opened 2026-03-15 14:11:44 +03:00 by kerem · 1 comment
Owner

Originally created by @rsingha108 on GitHub (Jan 21, 2026).
Original GitHub issue: https://github.com/axllent/mailpit/issues/622

Description

Mailpit accepts an invalid RCPT TO address that includes a malformed source route (missing the required colon), returning 250 OK instead of rejecting the syntax error. This permits delivery attempts to an invalid recipient address and violates SMTP syntax handling per RFC 5321 §4.1.1.3.

Affected Version

v1.28

Steps to Reproduce

  1. Ensure Mailpit is running on 127.0.0.1:8030 (docker image: axllent/mailpit:v1.28)
  2. Connect to the SMTP port (e.g., telnet 127.0.0.1 8030).
  3. Issue the following commands in order:
  • EHLO client.example
  • MAIL FROM:alice@example.com
  • RCPT TO:<@route.example user@example.com>
  1. Observe the server’s response to the RCPT TO command.

Buggy Behavior

Mailpit responds “250 2.1.5 Ok” to RCPT TO:<@route.example user@example.com>, accepting a recipient address with an invalid source route syntax (missing the colon).

Expected Behavior

The server should reject the malformed recipient address with a 501 syntax error (e.g., “501 Syntax error in parameters or arguments”) because the source route is not correctly formed.
As per RFC 5321 [4.1.1.3]: "[4.1.1.3] Receiving systems MUST recognize source route syntax but SHOULD strip off the source route specification and utilize the domain name associated with the mailbox as if the source route had not been provided."

Originally created by @rsingha108 on GitHub (Jan 21, 2026). Original GitHub issue: https://github.com/axllent/mailpit/issues/622 ### Description Mailpit accepts an invalid RCPT TO address that includes a malformed source route (missing the required colon), returning 250 OK instead of rejecting the syntax error. This permits delivery attempts to an invalid recipient address and violates SMTP syntax handling per RFC 5321 §4.1.1.3. ### Affected Version v1.28 ### Steps to Reproduce 1. Ensure Mailpit is running on 127.0.0.1:8030 (docker image: axllent/mailpit:v1.28) 2. Connect to the SMTP port (e.g., telnet 127.0.0.1 8030). 3. Issue the following commands in order: - EHLO client.example - MAIL FROM:<alice@example.com> - RCPT TO:<@route.example user@example.com> 4. Observe the server’s response to the RCPT TO command. ### Buggy Behavior Mailpit responds “250 2.1.5 Ok” to RCPT TO:<@route.example user@example.com>, accepting a recipient address with an invalid source route syntax (missing the colon). ### Expected Behavior The server should reject the malformed recipient address with a 501 syntax error (e.g., “501 Syntax error in parameters or arguments”) because the source route is not correctly formed. As per RFC 5321 [4.1.1.3]: "[4.1.1.3] Receiving systems MUST recognize source route syntax but SHOULD strip off the source route specification and utilize the domain name associated with the mailbox as if the source route had not been provided."
kerem 2026-03-15 14:11:44 +03:00
  • closed this issue
  • added the
    invalid
    label
Author
Owner

@axllent commented on GitHub (Jan 23, 2026):

Thank you, but this issue was already fixed in v1.28.3.

<!-- gh-comment-id:3788158684 --> @axllent commented on GitHub (Jan 23, 2026): Thank you, but this issue was already fixed in v1.28.3.
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#389
No description provided.