Movatterモバイル変換


[0]ホーム

URL:


smtptest

package
v2.23.0Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2025 License:AGPL-3.0Imports:10Imported by:0

Details

Repository

github.com/coder/coder

Links

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

funcCreateMockSMTPServer

func CreateMockSMTPServer(be *Backend, useTLSbool) (*smtp.Server,net.Listener,error)

nolint:revive // Yes, useTLS is a control flag.

funcPingClient

func PingClient(listennet.Listener, useTLSbool, startTLSbool) (*smtp.Client,error)

Types

typeBackend

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

funcNewBackend

func NewBackend(cfgConfig) *Backend

func (*Backend)LastMessage

func (b *Backend) LastMessage() *Message

LastMessage returns a copy of the last message received by thebackend.

func (*Backend)NewSession

func (b *Backend) NewSession(c *smtp.Conn) (smtp.Session,error)

NewSession is called after client greeting (EHLO, HELO).

func (*Backend)Reset

func (b *Backend) Reset()

typeConfig

type Config struct {AuthMechanisms                                       []stringAcceptedIdentity, AcceptedUsername, AcceptedPasswordstringFailOnDataFn                                         func()error}

typeMessage

type Message struct {AuthMechstringIdentity, Username, Passwordstring// AuthFromstringTo                           []string// AddressSubject, Contentsstring// Content}

typeSession

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

func (*Session)Auth

func (s *Session) Auth(mechstring) (sasl.Server,error)

Auth is the handler for supported authenticators.

func (*Session)AuthMechanisms

func (s *Session) AuthMechanisms() []string

AuthMechanisms returns a slice of available auth mechanisms; only PLAIN issupported in this example.

func (*Session)Data

func (s *Session) Data(rio.Reader)error

func (*Session)Logout

func (*Session) Logout()error

func (*Session)Mail

func (s *Session) Mail(fromstring, _ *smtp.MailOptions)error

func (*Session)Rcpt

func (s *Session) Rcpt(tostring, _ *smtp.RcptOptions)error

func (*Session)Reset

func (*Session) Reset()

Source Files

View all Source files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f orF : Jump to
y orY : Canonical URL
go.dev uses cookies from Google to deliver and enhance the quality of its services and to analyze traffic.Learn more.

[8]ページ先頭

©2009-2025 Movatter.jp