addr

package
v0.8.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 28, 2023 License: BSD-2-Clause Imports: 2 Imported by: 1

Documentation

Overview

Package addr includes IDNA aware address structs

Index

Constants

This section is empty.

Variables

View Source
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

func (m *MailFrom) AuthenticatedUser() string

AuthenticatedUser is the username of the logged-in user. It is empty, when there is no login.

func (*MailFrom) AuthenticationMethod

func (m *MailFrom) AuthenticationMethod() string

AuthenticationMethod is the used method of authentication. E.g. "PLAIN" or "CRAM-MD5". It is empty, when there is no login.

func (*MailFrom) Copy

func (m *MailFrom) Copy() *MailFrom

Copy returns an independent copy of m.

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

func (m *MailFrom) Transport() string

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 NewRcptTo

func NewRcptTo(to, esmtpArgs, transport string) *RcptTo

NewRcptTo creates a new RcptTo

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) Copy

func (r *RcptTo) Copy() *RcptTo

Copy returns an independent copy of r.

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

func (r *RcptTo) Transport() string

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL