server

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: 27 Imported by: 0

Documentation

Overview

smtp server implementation

Index

Constants

View Source
const DEFAULT_ADMIN_LOGIN = "admin"

the default admin login

View Source
const SERV_NAME = "Brain Dead Simple Mail Server"
View Source
const VERS_MAJOR = 0
View Source
const VERS_MINOR = 1
View Source
const VERS_PATCH = 0

Variables

This section is empty.

Functions

func Version

func Version() string

return version string

Types

type MailEvent

type MailEvent struct {
	// remote address of sender
	Addr string
	// recipiant of message
	Recip string
	// sender of message
	Sender string
	// file containg the message
	File string
}

event fired when we got a new mail message

type MailHandler

type MailHandler interface {
	// we got a mail message
	// handle it somehow
	GotMail(ev *MailEvent)
	// do we accept mail going to this recipiant?
	AllowRecipiant(recip string) bool
}

handler of mail messages

type Server

type Server struct {

	// custom mail handler
	Handler MailHandler

	// tls config
	TLS *tls.Config
	// contains filtered or unexported fields
}

mail server

func New

func New() (s *Server)

create new server with defaults

func (*Server) Bind

func (s *Server) Bind() (err error)

bind network services

func (*Server) Bounce

func (s *Server) Bounce(recip, from, fpath string, e error)

func (*Server) FindStoreFor

func (s *Server) FindStoreFor(email string) (st mailstore.Store, has bool)

get a local maildir or empty string if it's not local to us

func (*Server) LoadConfig

func (s *Server) LoadConfig(fname string) (err error)

load configuration file

func (*Server) PermitSend

func (s *Server) PermitSend(from, username string) bool

func (*Server) Plain

func (s *Server) Plain(username, password string) bool

func (*Server) ReloadConfig

func (s *Server) ReloadConfig() (err error)

reload server configuration

func (*Server) Run

func (s *Server) Run()

func (*Server) Stop

func (s *Server) Stop()

stop server

Jump to

Keyboard shortcuts

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