mail

package
v3.0.17 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2025 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Inbound struct {
		Host string `json:"host"`
		Pass string `json:"pass"`
		User string `json:"user"`
	} `json:"inbound"`
	Outbound struct {
		Host string `json:"host"`
		Pass string `json:"pass"`
		User string `json:"user"`
	} `json:"outbound"`
}

type FoundMail

type FoundMail struct {
	Address      string
	DKIMSelector string
}

type Server

type Server struct {
	CheckTLS bool
	Scanner  *scanner.Scanner
	// contains filtered or unexported fields
}

func NewMailServer

func NewMailServer(config Config, logger zerolog.Logger, sc *scanner.Scanner, advisor *domainAdvisor.Advisor) (*Server, error)

NewMailServer returns a new instance of a mail server.

func (*Server) GetMail

func (s *Server) GetMail() (map[string]FoundMail, error)

GetMail returns the most recent mail found within the logged-in user's mailbox.

func (*Server) Login

func (s *Server) Login() (*imapClient.Client, error)

Login initializes an open session to the configured IMAP server.

func (*Server) SendMail

func (s *Server) SendMail(mailbox string, result model.ScanResultWithAdvice) error

SendMail takes a hermes.Email object, converts it into both html and plaintext, and then send the email to the provided mailbox.

func (*Server) Serve

func (s *Server) Serve(interval time.Duration)

Jump to

Keyboard shortcuts

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