smtpd

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

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

Go to latest
Published: Apr 23, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package smtpd implements a basic SMTP server.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

func Debug(msg string)

func ListenAndServe

func ListenAndServe(addr string, handler Handler, appname string, hostname string, dbg bool) error

ListenAndServe listens on the TCP network address addr and then calls Serve with handler to handle requests on incoming connections.

Types

type Handler

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

Handler function called upon successful receipt of an email.

type Server

type Server struct {
	Addr     string // TCP address to listen on, defaults to ":25" (all addresses, port 25) if empty
	Handler  Handler
	Appname  string
	Hostname string
}

Server is an SMTP server.

func (*Server) ListenAndServe

func (srv *Server) ListenAndServe() error

ListenAndServe listens on the TCP network address srv.Addr and then calls Serve to handle requests on incoming connections. If srv.Addr is blank, ":25" is used.

func (*Server) Serve

func (srv *Server) Serve(ln net.Listener) error

Serve creates a new SMTP session after a network connection is established.

Jump to

Keyboard shortcuts

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