courier

package
v1.13.0 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2023 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Package courier implements various couriers for delivering messages.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Courier

type Courier interface {
	// Deliver mail to a recipient. Return the error (if any), and whether it
	// is permanent (true) or transient (false).
	Deliver(from string, to string, data []byte) (error, bool)
}

Courier delivers mail to a single recipient. It is implemented by different couriers, for both local and remote recipients.

type MDA

type MDA struct {
	Binary  string        // Path to the binary.
	Args    []string      // Arguments to pass.
	Timeout time.Duration // Timeout for each invocation.
}

MDA delivers local mail by executing a local binary, like procmail or maildrop. It works with any binary that:

  • Receives the email to deliver via stdin.
  • Exits with code EX_TEMPFAIL (75) for transient issues.

func (*MDA) Deliver

func (p *MDA) Deliver(from string, to string, data []byte) (error, bool)

Deliver an email. On failures, returns an error, and whether or not it is permanent.

type SMTP

type SMTP struct {
	HelloDomain string
	Dinfo       *domaininfo.DB
	STSCache    *sts.PolicyCache
}

SMTP delivers remote mail via outgoing SMTP.

func (*SMTP) Deliver

func (s *SMTP) Deliver(from string, to string, data []byte) (error, bool)

Deliver an email. On failures, returns an error, and whether or not it is permanent.

Jump to

Keyboard shortcuts

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