Documentation
¶
Index ¶
- Constants
- func CreateHistogramByBucket(latencies []time.Duration, bucketCount int)
- func CreateHistogramByDuration(latencies []time.Duration, bucketSize time.Duration)
- func GetLatencies(p string, w io.Writer) error
- func HasFlexedPrefix(s, prefix string) bool
- func IsMailText(p string) bool
- func OptimisticUID() (string, error)
- func ReadFirstBytes(p string, bytes int) ([]byte, error)
- func Send(data map[string]any, opts ...Option) (map[string]any, error)
- type Bulk
- type Callback
- type Client
- func (c *Client) Auth(a smtp.Auth) error
- func (c *Client) Close() error
- func (c *Client) Data() (io.WriteCloser, error)
- func (c *Client) Extension(ext string) (bool, string)
- func (c *Client) Hello(localName string) error
- func (c *Client) Mail(from string) error
- func (c *Client) Noop() error
- func (c *Client) Quit() error
- func (c *Client) Rcpt(to string) error
- func (c *Client) Reset() error
- func (c *Client) StartTLS(config *tls.Config) error
- func (c *Client) TLSConnectionState() (state tls.ConnectionState, ok bool)
- func (c *Client) Verify(addr string) error
- type DeliveryResult
- type Latencies
- type Latency
- type Mail
- type MockServer
- type MockServerSession
- type Option
- type Req
- type Res
- type Result
- type TLS
Constants ¶
View Source
const ( StartTLSOff = "off" StartTLSAuto = "auto" StartTLSRequired = "required" )
The values of starttls.
Variables ¶
This section is empty.
Functions ¶
func CreateHistogramByBucket ¶
func IsMailText ¶
func OptimisticUID ¶
Types ¶
type Bulk ¶
type Bulk struct {
Addr string `map:"addr" validate:"required"`
From string `map:"from" validate:"required"`
To string `map:"to" validate:"required"`
Subject string `map:"subject"`
MyHostname string `map:"myhostname"`
Session int `map:"session"`
Message int `map:"message"`
Length int `map:"length"`
// StartTLS is off, auto or required, as the smtp action's starttls. It
// is off when empty, as Bulk always was.
StartTLS string
// InsecureSkipTLS accepts any certificate after STARTTLS.
InsecureSkipTLS bool
// contains filtered or unexported fields
}
func (*Bulk) DeliverWithResult ¶ added in v0.19.0
func (b *Bulk) DeliverWithResult() DeliveryResult
type Client ¶
func (*Client) TLSConnectionState ¶
func (c *Client) TLSConnectionState() (state tls.ConnectionState, ok bool)
type DeliveryResult ¶ added in v0.19.0
type Latencies ¶
type Latencies struct {
EarliestTime time.Time
Data []Latency
MailDir string
TimeFormat string
TimeLocation *time.Location
}
func (*Latencies) FindEarliestSentTime ¶
type Latency ¶
type Latency struct {
// SentTimeOffset is the time offset from the earliest sent time to when this email was sent
SentTimeOffset time.Duration
// ReceivedTimeOffset is the time offset from the earliest sent time to when this email was received
ReceivedTimeOffset time.Duration
SentTime time.Time
LastReceivedTime time.Time
EndToEnd time.Duration
FirstReceivedTime time.Time
Relay time.Duration
ReturnPath string
FilePath string
}
type Mail ¶
type Mail struct {
Addr string
// LocalName is the host name sent in EHLO and HELO. When it is empty the
// machine's host name is used, falling back to "localhost".
LocalName string
MailFrom string
RcptTo []string
Data []byte
Auth smtp.Auth
StartTLSDisabled bool
// StartTLSRequired fails the session when the server does not offer
// STARTTLS, instead of going on in plain text.
StartTLSRequired bool
// InsecureSkipVerify accepts any certificate after STARTTLS, such as a
// self-signed one.
InsecureSkipVerify bool
MessageCount int
// Delivered is how many messages the server accepted in the last Send.
// Each message is committed on its own, so a Send that fails part way
// has still delivered the ones before.
Delivered int
}
type MockServer ¶
type MockServer struct {
Addr string
Name string
Log *log.Logger
*TLS
// contains filtered or unexported fields
}
func (*MockServer) Serve ¶
func (s *MockServer) Serve() error
type MockServerSession ¶
type MockServerSession struct {
// contains filtered or unexported fields
}
type Req ¶ added in v0.20.0
type Req struct {
Addr string `map:"addr" validate:"required"`
From string `map:"from" validate:"required"`
To string `map:"to" validate:"required"`
Subject string `map:"subject"`
MyHostname string `map:"myhostname"`
Session int `map:"session"`
Message int `map:"message"`
Length int `map:"length"`
// StartTLS is off, auto (use it when the server offers it) or required
// (fail when it does not).
StartTLS string `map:"starttls"`
InsecureSkipTLS bool `map:"insecure_skip_tls"`
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.