smtp

package
v0.0.0-...-8277694 Latest Latest
Warning

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

Go to latest
Published: May 8, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

smtp client / server implementation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Serve

func Serve(l net.Listener, h Handler, appname, hostname string) (err error)

serve smtp via a net.Listener

Types

type Auth

type Auth interface {
	PermitSend(from, username string) bool
	Plain(username, password string) bool
}

type Client

type Client struct {
	smtp.Client
}

func NewClient

func NewClient(conn net.Conn, host string) (*Client, error)

create a new smtp client wrapper function

type Handler

type Handler func(remoteAddr net.Addr, from string, to []string, fpath string)

smtp message handler

type Server

type Server struct {
	// name name of the smtp application
	Appname string
	// the hostname of the smtp server
	Hostname string
	// the handler of inbound mail
	Handler Handler
	// mail storage for inbound mail
	Inbound mailstore.Store
	// outbound mail queue
	Outbound mailstore.SendQueue
	// user authenticator for sending mail
	Auth Auth
	// TLS Config
	TLS *tls.Config
}

func (*Server) Serve

func (s *Server) Serve(l net.Listener) (err error)

serve creates a new smtp sesion after a network connection is established

Jump to

Keyboard shortcuts

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