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

policy: Tie mailbox extraction to Addressing for #33

This commit is contained in:
James Hillyerd
2018-04-02 20:15:50 -07:00
parent c2e1d58b90
commit 939ff19991
5 changed files with 57 additions and 70 deletions

View File

@@ -35,8 +35,9 @@ type Manager interface {
// StoreManager is a message Manager backed by the storage.Store.
type StoreManager struct {
Store storage.Store
Hub *msghub.Hub
AddrPolicy *policy.Addressing
Store storage.Store
Hub *msghub.Hub
}
// Deliver submits a new message to the store.
@@ -154,7 +155,7 @@ func (s *StoreManager) SourceReader(mailbox, id string) (io.ReadCloser, error) {
// MailboxForAddress parses an email address to return the canonical mailbox name.
func (s *StoreManager) MailboxForAddress(mailbox string) (string, error) {
return policy.ParseMailboxName(mailbox)
return s.AddrPolicy.ExtractMailbox(mailbox)
}
// makeMetadata populates Metadata from a storage.Message.