-
-
Notifications
You must be signed in to change notification settings - Fork 159
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix: Ignore unsupported optional SMTP 'MAIL FROM' parameters (#407)
- Loading branch information
Showing
2 changed files
with
12 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -148,11 +148,15 @@ func TestCmdMAIL(t *testing.T) { | |
cmdCode(t, conn, "MAIL FROM:<[email protected]> SIZE=1000", "250") | ||
|
||
// MAIL with bad size parameter should return 501 syntax error | ||
cmdCode(t, conn, "MAIL FROM:<[email protected]> SIZE", "501") | ||
cmdCode(t, conn, "MAIL FROM:<[email protected]> SIZE=", "501") | ||
cmdCode(t, conn, "MAIL FROM:<[email protected]> SIZE= ", "501") | ||
cmdCode(t, conn, "MAIL FROM:<[email protected]> SIZE=foo", "501") | ||
|
||
// MAIL with options should be ignored except for SIZE | ||
cmdCode(t, conn, "MAIL FROM:<[email protected]> BODY=8BITMIME", "250") // ignored | ||
cmdCode(t, conn, "MAIL FROM:<[email protected]> BODY=8BITMIME,SIZE=1000", "250") // size detected | ||
cmdCode(t, conn, "MAIL FROM:<[email protected]> BODY=8BITMIME,SIZE=foo", "501") // ignored | ||
|
||
// TODO: MAIL with valid AUTH parameter should return 250 Ok | ||
|
||
// TODO: MAIL with invalid AUTH parameter must return 501 syntax error | ||
|
@@ -170,7 +174,6 @@ func TestCmdMAILMaxSize(t *testing.T) { | |
cmdCode(t, conn, "MAIL FROM:<[email protected]>", "250") | ||
|
||
// MAIL with bad size parameter should return 501 syntax error | ||
cmdCode(t, conn, "MAIL FROM:<[email protected]> SIZE", "501") | ||
cmdCode(t, conn, "MAIL FROM:<[email protected]> SIZE=", "501") | ||
cmdCode(t, conn, "MAIL FROM:<[email protected]> SIZE= ", "501") | ||
cmdCode(t, conn, "MAIL FROM:<[email protected]> SIZE=foo", "501") | ||
|