smtp

package
v0.0.0-...-4e2ebe7 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSSLmanager

func NewSSLmanager(c BlobClient) *autocert.Manager

Types

type Backend

type Backend struct {
	ListenAddress string
	Domain        string
	MxDomains     string
	BlobAccount   string
	BlobContainer string
	BlobKey       string
	BlobClient    BlobClient
}

The Backend implements SMTP server methods

func (*Backend) NewSession

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

type BlobClient

type BlobClient interface {
	Put(string, []byte) error
	Get(string) ([]byte, error)
	ListMail() ([]string, error)
}

func NewAzureBlobClient

func NewAzureBlobClient(account string, container string, key string) (BlobClient, error)

type Message

type Message struct {
	Recipient string
	From      string
	Data      []byte
}

A Message is a single message to be stored

type SSLblobCache

type SSLblobCache struct {
	BlobClient BlobClient
}

func (SSLblobCache) Delete

func (s SSLblobCache) Delete(ctx context.Context, key string) error

func (SSLblobCache) Get

func (s SSLblobCache) Get(ctx context.Context, key string) ([]byte, error)

func (SSLblobCache) Put

func (s SSLblobCache) Put(ctx context.Context, key string, data []byte) error

type Session

type Session struct {
	Backend  *Backend
	Messages []Message
}

A Session is returned after EHLO

func (*Session) AuthPlain

func (s *Session) AuthPlain(_, _ string) error

func (*Session) Data

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

func (*Session) Logout

func (s *Session) Logout() error

func (*Session) Mail

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

func (*Session) Rcpt

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

func (*Session) Reset

func (s *Session) Reset()

type Webmail

type Webmail struct {
	XsrfSecret string
	BlobClient BlobClient
}

func (*Webmail) ListenAndServeWebmail

func (wm *Webmail) ListenAndServeWebmail()

Jump to

Keyboard shortcuts

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