-
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #186 from mocktools/develop
Golang smtpmock v2.3.2
- Loading branch information
Showing
8 changed files
with
47 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
--- | ||
|
||
version: 2 | ||
|
||
builds: | ||
- id: "smtpmock-build" | ||
dir: cmd | ||
|
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 |
---|---|---|
@@ -1 +1 @@ | ||
golang 1.22.5 | ||
golang 1.23.0 |
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
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 |
---|---|---|
|
@@ -245,6 +245,24 @@ func TestHandlerMailfromMailfromEmail(t *testing.T) { | |
|
||
assert.Equal(t, emptyString, handler.mailfromEmail("MAIL FROM: "+invalidEmail)) | ||
}) | ||
|
||
t.Run("when request includes invalid email with multiple @ symbols", func(t *testing.T) { | ||
invalidEmail := "[email protected]@b.com" | ||
|
||
assert.Equal(t, emptyString, handler.mailfromEmail("MAIL FROM: "+invalidEmail)) | ||
}) | ||
|
||
t.Run("when request includes invalid email starting with dot", func(t *testing.T) { | ||
invalidEmail := "[email protected]" | ||
|
||
assert.Equal(t, emptyString, handler.mailfromEmail("MAIL FROM: "+invalidEmail)) | ||
}) | ||
|
||
t.Run("when request includes invalid email ending with dot before @", func(t *testing.T) { | ||
invalidEmail := "[email protected]" | ||
|
||
assert.Equal(t, emptyString, handler.mailfromEmail("MAIL FROM: "+invalidEmail)) | ||
}) | ||
} | ||
|
||
func TestHandlerHeloIsBlacklistedEmail(t *testing.T) { | ||
|
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 |
---|---|---|
|
@@ -345,6 +345,24 @@ func TestHandlerRcpttoRcpttoEmail(t *testing.T) { | |
|
||
assert.Equal(t, emptyString, handler.rcpttoEmail("RCPT TO: "+invalidEmail)) | ||
}) | ||
|
||
t.Run("when request includes invalid email address, wrong format", func(t *testing.T) { | ||
invalidEmail := "[email protected]@b.com" | ||
|
||
assert.Equal(t, emptyString, handler.rcpttoEmail("RCPT TO: "+invalidEmail)) | ||
}) | ||
|
||
t.Run("when request includes invalid email starting with dot", func(t *testing.T) { | ||
invalidEmail := "[email protected]" | ||
|
||
assert.Equal(t, emptyString, handler.rcpttoEmail("RCPT TO: "+invalidEmail)) | ||
}) | ||
|
||
t.Run("when request includes invalid email ending with dot before @", func(t *testing.T) { | ||
invalidEmail := "[email protected]" | ||
|
||
assert.Equal(t, emptyString, handler.rcpttoEmail("RCPT TO: "+invalidEmail)) | ||
}) | ||
} | ||
|
||
func TestHandlerRcpttoIsBlacklistedEmail(t *testing.T) { | ||
|