Documentation ¶
Index ¶
- func ParseEmailAddress(address string) (local string, domain string, err error)
- func ValidateDomainPart(domain string) bool
- type Addressing
- func (a *Addressing) ExtractMailbox(address string) (string, error)
- func (a *Addressing) NewRecipient(address string) (*Recipient, error)
- func (a *Addressing) ParseOrigin(address string) (*Origin, error)
- func (a *Addressing) ShouldAcceptDomain(domain string) bool
- func (a *Addressing) ShouldAcceptOriginDomain(domain string) bool
- func (a *Addressing) ShouldStoreDomain(domain string) bool
- type Origin
- type Recipient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseEmailAddress ¶
ParseEmailAddress unescapes an email address, and splits the local part from the domain part. An error is returned if the local or domain parts fail validation following the guidelines in RFC3696.
func ValidateDomainPart ¶
ValidateDomainPart returns true if the domain part complies to RFC3696, RFC1035. Used by ParseEmailAddress().
Types ¶
type Addressing ¶
Addressing handles email address policy.
func (*Addressing) ExtractMailbox ¶
func (a *Addressing) ExtractMailbox(address string) (string, error)
ExtractMailbox extracts the mailbox name from a partial email address.
func (*Addressing) NewRecipient ¶
func (a *Addressing) NewRecipient(address string) (*Recipient, error)
NewRecipient parses an address into a Recipient. This is used for parsing RCPT TO arguments, not To headers.
func (*Addressing) ParseOrigin ¶
func (a *Addressing) ParseOrigin(address string) (*Origin, error)
ParseOrigin parses an address into a Origin. This is used for parsing MAIL FROM argument, not To headers.
func (*Addressing) ShouldAcceptDomain ¶
func (a *Addressing) ShouldAcceptDomain(domain string) bool
ShouldAcceptDomain indicates if Inbucket accepts mail destined for the specified domain.
func (*Addressing) ShouldAcceptOriginDomain ¶
func (a *Addressing) ShouldAcceptOriginDomain(domain string) bool
ShouldAcceptOriginDomain indicates if Inbucket accept mail from the specified domain.
func (*Addressing) ShouldStoreDomain ¶
func (a *Addressing) ShouldStoreDomain(domain string) bool
ShouldStoreDomain indicates if Inbucket stores mail destined for the specified domain.
type Origin ¶
type Origin struct { mail.Address // LocalPart is the part of the address before @, including +extension. LocalPart string // Domain is the part of the address after @. Domain string // contains filtered or unexported fields }
Origin represents a potential email origin, allows policies for it to be queried.
func (*Origin) ShouldAccept ¶
ShouldAccept returns true if Inbucket should accept mail from this origin.
type Recipient ¶
type Recipient struct { mail.Address // LocalPart is the part of the address before @, including +extension. LocalPart string // Domain is the part of the address after @. Domain string // Mailbox is the canonical mailbox name for this recipient. Mailbox string // contains filtered or unexported fields }
Recipient represents a potential email recipient, allows policies for it to be queried.
func (*Recipient) ShouldAccept ¶
ShouldAccept returns true if Inbucket should accept mail for this recipient.
func (*Recipient) ShouldStore ¶
ShouldStore returns true if Inbucket should store mail for this recipient.