Documentation
¶
Overview ¶
Package addr includes IDNA aware address structs
Index ¶
- Variables
- type MailFrom
- func (a *MailFrom) AsciiDomain() string
- func (m *MailFrom) AuthenticatedUser() string
- func (m *MailFrom) AuthenticationMethod() string
- func (m *MailFrom) Copy() *MailFrom
- func (a *MailFrom) Domain() string
- func (a *MailFrom) Local() string
- func (m *MailFrom) Transport() string
- func (a *MailFrom) UnicodeDomain() string
- type RcptTo
Constants ¶
This section is empty.
Variables ¶
var IDNAProfile = idna.Lookup
IDNAProfile is the *idna.Profile that this package uses to parse and generate the ASCII representation of domain names.
This defaults to idna.Lookup but you can use any *idna.Profile you like.
Functions ¶
This section is empty.
Types ¶
type MailFrom ¶
type MailFrom struct {
// contains filtered or unexported fields
}
MailFrom is the sender address and the sender info (used transport, authenticated user).
func NewMailFrom ¶
func NewMailFrom(from, esmtpArgs, transport, authenticatedUser, authenticationMethod string) MailFrom
NewMailFrom creates a new MailFrom
func (*MailFrom) AsciiDomain ¶
func (a *MailFrom) AsciiDomain() string
AsciiDomain returns Domain interpreted and converted as the ASCII representation. If Domain cannot be converted (e.g. invalid UTF-8 data), the unchanged Domain value gets returned.
func (*MailFrom) AuthenticatedUser ¶
AuthenticatedUser is the username of the logged-in user. It is empty, when there is no login.
func (*MailFrom) AuthenticationMethod ¶
AuthenticationMethod is the used method of authentication. E.g. "PLAIN" or "CRAM-MD5". It is empty, when there is no login.
func (*MailFrom) Domain ¶
func (a *MailFrom) Domain() string
Domain returns the part of an email after the @ symbol. It is returned as-is without any validation. If the address does not include an @ an empty string gets returned.
func (*MailFrom) Local ¶
func (a *MailFrom) Local() string
Local returns the part of an email in front of the @ symbol. If the address does not include an @ the whole address get returned.
func (*MailFrom) Transport ¶
Transport returns the used transport. You might use this to e.g. distinguish local generated mail from incoming mail.
func (*MailFrom) UnicodeDomain ¶
func (a *MailFrom) UnicodeDomain() string
UnicodeDomain returns Domain interpreted and converted as the UTF-8 representation. If Domain cannot be converted (e.g. invalid UTF-8 data), the unchanged Domain value gets returned.
type RcptTo ¶
type RcptTo struct {
// contains filtered or unexported fields
}
RcptTo is one recipient address and its metadata.
func (*RcptTo) AsciiDomain ¶
func (a *RcptTo) AsciiDomain() string
AsciiDomain returns Domain interpreted and converted as the ASCII representation. If Domain cannot be converted (e.g. invalid UTF-8 data), the unchanged Domain value gets returned.
func (*RcptTo) Domain ¶
func (a *RcptTo) Domain() string
Domain returns the part of an email after the @ symbol. It is returned as-is without any validation. If the address does not include an @ an empty string gets returned.
func (*RcptTo) Local ¶
func (a *RcptTo) Local() string
Local returns the part of an email in front of the @ symbol. If the address does not include an @ the whole address get returned.
func (*RcptTo) Transport ¶
Transport returns the next-hop transport . You might use this to e.g. distinguish a local recipient from an external recipient.
func (*RcptTo) UnicodeDomain ¶
func (a *RcptTo) UnicodeDomain() string
UnicodeDomain returns Domain interpreted and converted as the UTF-8 representation. If Domain cannot be converted (e.g. invalid UTF-8 data), the unchanged Domain value gets returned.