smtpserver

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2023 License: MIT Imports: 49 Imported by: 1

Documentation

Overview

Package smtpserver implements an SMTP server for submission and incoming delivery of mail messages.

Index

Constants

This section is empty.

Variables

View Source
var Localserve bool

If set, regular delivery/submit is sidestepped, email is accepted and delivered to the account named mox.

Functions

func Listen added in v0.0.2

func Listen()

Listen initializes network listeners for incoming SMTP connection. The listeners are stored for a later call to Serve.

func Serve added in v0.0.2

func Serve()

Serve starts serving on all listeners, launching a goroutine per listener.

Types

type AuthMethod

type AuthMethod struct {
	// E.g. "dkim", "spf", "iprev", "auth".
	Method  string
	Result  string // Each method has a set of known values, e.g. "pass", "temperror", etc.
	Comment string // Optional, message header comment.
	Reason  string // Optional.
	Props   []AuthProp
}

AuthMethod is a result for one authentication method.

Example encoding in the header: "spf=pass smtp.mailfrom=example.net".

type AuthProp

type AuthProp struct {
	// Valid values maintained at https://www.iana.org/assignments/email-auth/email-auth.xhtml
	Type     string
	Property string
	Value    string
	// Whether value is address-like (localpart@domain, or domain). Or another value,
	// which is subject to escaping.
	IsAddrLike bool
	Comment    string // If not empty, header comment withtout "()", added after Value.
}

AuthProp describes properties for an authentication method. Each method has a set of known properties. Encoded in the header as "type.property=value", e.g. "smtp.mailfrom=example.net" for spf.

type AuthResults

type AuthResults struct {
	Hostname string
	Comment  string // If not empty, header comment without "()", added after Hostname.
	Methods  []AuthMethod
}

Authentication-Results header, see RFC 8601.

func (AuthResults) Header

func (h AuthResults) Header() string

Header returns an Authentication-Results header, possibly spanning multiple lines, always ending in crlf.

Jump to

Keyboard shortcuts

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