1
0
mirror of https://github.com/jhillyerd/inbucket.git synced 2025-12-17 09:37:02 +00:00

smtp: Wire in policy.Recipient for #84

This commit is contained in:
James Hillyerd
2018-03-17 12:39:09 -07:00
parent 469a778d81
commit b9003a9328
4 changed files with 47 additions and 66 deletions

View File

@@ -15,6 +15,7 @@ import (
"github.com/jhillyerd/inbucket/pkg/config"
"github.com/jhillyerd/inbucket/pkg/msghub"
"github.com/jhillyerd/inbucket/pkg/policy"
"github.com/jhillyerd/inbucket/pkg/storage"
"github.com/jhillyerd/inbucket/pkg/test"
)
@@ -172,10 +173,7 @@ func TestMailState(t *testing.T) {
{"RCPT TO: u4@gmail.com", 250},
{"RSET", 250},
{"MAIL FROM:<john@gmail.com>", 250},
{"RCPT TO:<user\\@internal@external.com", 250},
{"RCPT TO:<\"first last\"@host.com", 250},
{"RCPT TO:<user\\>name@host.com>", 250},
{"RCPT TO:<\"user>name\"@host.com>", 250},
{`RCPT TO:<"first/last"@host.com`, 250},
}
if err := playSession(t, server, script); err != nil {
t.Error(err)
@@ -360,7 +358,8 @@ func setupSMTPServer(ds storage.Store) (s *Server, buf *bytes.Buffer, teardown f
close(shutdownChan)
cancel()
}
s = NewServer(cfg, shutdownChan, ds, msghub.New(ctx, 100))
apolicy := &policy.Addressing{Config: cfg}
s = NewServer(cfg, shutdownChan, ds, apolicy, msghub.New(ctx, 100))
return s, buf, teardown
}