MCPcopy Create free account
hub / github.com/foxcpp/maddy / Lookup

Method Lookup

internal/table/email_localpart.go:57–67  ·  view source on GitHub ↗
(ctx context.Context, key string)

Source from the content-addressed store, hash-verified

55}
56
57func (s *EmailLocalpart) Lookup(ctx context.Context, key string) (string, bool, error) {
58 mbox, _, err := address.Split(key)
59 if err != nil {
60 if s.allowNonEmail {
61 return key, true, nil
62 }
63 // Invalid email, no local part mapping.
64 return "", false, nil
65 }
66 return mbox, true, nil
67}
68
69func init() {
70 modules.Register("table.email_localpart", NewEmailLocalpart)

Callers

nothing calls this directly

Calls 1

SplitFunction · 0.92

Tested by

no test coverage detected