smtpd

package
v0.0.0-...-65e9c33 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2018 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HashMailboxName

func HashMailboxName(mailbox string) string

Take a mailbox name and hash it into the directory we'll store it in

func JoinStringList

func JoinStringList(listOfStrings *list.List) string

JoinStringList joins a List containing strings by commas

func ParseEmailAddress

func ParseEmailAddress(address string) (local string, domain string, err error)

ParseEmailAddress unescapes an email address, and splits the local part from the domain part. An error is returned if the local or domain parts fail validation following the guidelines in RFC3696.

func ParseMailboxName

func ParseMailboxName(localPart string) (result string, err error)

Take "user+ext" and return "user", aka the mailbox we'll store it in Return error if it contains invalid characters, we don't accept anything that must be quoted according to RFC3696.

func ValidateDomainPart

func ValidateDomainPart(domain string) bool

ValidateDomainPart returns true if the domain part complies to RFC3696, RFC1035

Types

type Client

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

func (*Client) Write

func (c *Client) Write(code string, text ...string)

type Server

type Server struct {
	Store *data.DataStore

	EnableXCLIENT bool
	TLSConfig     *tls.Config
	ForceTLS      bool
	Debug         bool
	DebugPath     string
	HostGreyList  bool
	FromGreyList  bool
	RcptGreyList  bool

	SpamRegex string
	// contains filtered or unexported fields
}

Real server code starts here

func NewSmtpServer

func NewSmtpServer(cfg config.SmtpConfig, ds *data.DataStore) *Server

Init a new Client object

func (*Server) Drain

func (s *Server) Drain()

Drain causes the caller to block until all active SMTP sessions have finished

func (*Server) Start

func (s *Server) Start()

Main listener loop

func (*Server) Stop

func (s *Server) Stop()

Stop requests the SMTP server closes it's listener

type State

type State int

Jump to

Keyboard shortcuts

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