smtpauth

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: May 9, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package smtpauth provides implementations of the smtp.Auth interface for sending messages with the LOGIN authentication mechanism, only allowed of SSL/TLS connections.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewLoginAuth

func NewLoginAuth(username, password string) smtp.Auth

NewLoginAuth returns an Auth that implements the LOGIN authentication mechanism as defined in RFC 4616.

Types

type LoginAuth

type LoginAuth struct {
	// contains filtered or unexported fields
}

LoginAuth is an Auth that implements the LOGIN authentication mechanism as defined in RFC 4616.

func (*LoginAuth) Next

func (a *LoginAuth) Next(fromServer []byte, more bool) ([]byte, error)

Next continues the authentication. The server has just sent the fromServer data. If more is true, the server expects a response, which Next should return as toServer; otherwise Next should return toServer == nil. If Next returns a non-nil error, the SMTP client aborts the authentication attempt and closes the connection.

func (*LoginAuth) Start

func (a *LoginAuth) Start(server *smtp.ServerInfo) (string, []byte, error)

Start begins an authentication with a server. It returns the name of the authentication protocol and optionally data to include in the initial AUTH message sent to the server. It can return proto == "" to indicate that the authentication should be skipped. If it returns a non-nil error, the SMTP client aborts the authentication attempt and closes the connection.

Jump to

Keyboard shortcuts

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