session

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Session

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

Session holds data for each connected SMTP connection

func NewSession

func NewSession(config *config.Config) *Session

NewSession creates a fresh session with a generated UUID and timestamp

func (*Session) Data

func (s *Session) Data(r io.Reader) error

Data is called on the DATA SMTP command. It generally contains the "message" but also any other informational headers such as the mailer client and subject. This is seen as the "finished" command for each session, so it triggers the HTTP post, though technically Reset and Logout wil be called afterwards.

func (*Session) Logout

func (s *Session) Logout() error

Logout is called when a connection is terminated. It will log whether the current session did or not make a post request.

func (*Session) Mail

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

Mail is called on the MAIL SMTP command, it only stores the from address

func (*Session) Rcpt

func (s *Session) Rcpt(to string) error

Rcpt is called on the RCPT SMTP command, it stores the to address. It may be called multiple times in one session.

func (*Session) Reset

func (s *Session) Reset()

Reset is called on the RSET SMTP command, or after a successful DATA command It will log whether the current session did or not make a post request.

func (*Session) TemplateData

func (s *Session) TemplateData() *dispatch.TemplateData

Jump to

Keyboard shortcuts

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