1
0
mirror of https://github.com/jhillyerd/inbucket.git synced 2025-12-18 10:07:02 +00:00

feat: Add RemoteAddr to SMTPSession (#548)

Signed-off-by: James Hillyerd <james@hillyerd.com>
This commit is contained in:
James Hillyerd
2024-10-20 11:49:55 -07:00
committed by GitHub
parent 78d4c4f4e7
commit 15d1970dbe
5 changed files with 42 additions and 20 deletions

View File

@@ -408,6 +408,7 @@ func TestBeforeMailFromAcceptedEventEmitted(t *testing.T) {
assert.NotNil(t, got, "BeforeMailListener did not receive Address")
assert.Equal(t, "john@gmail.com", got.From.Address, "Address had wrong value")
assert.Equal(t, "pipe", got.RemoteAddr, "RemoteAddr had wrong value")
}
// Test "MAIL FROM" acts on BeforeMailFromAccepted event result.
@@ -492,6 +493,7 @@ func TestBeforeRcptToAcceptedSingleEventEmitted(t *testing.T) {
require.NotNil(t, got, "BeforeRcptToListener did not receive SMTPSession")
require.NotNil(t, got.From)
require.NotNil(t, got.To)
assert.Equal(t, "pipe", got.RemoteAddr, "RemoteAddr had wrong value")
assert.Equal(t, "john@gmail.com", got.From.Address)
assert.Len(t, got.To, 1)
assert.Equal(t, "user@gmail.com", got.To[0].Address)