dsn

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2024 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Overview

Package dsn contains the utilities used for dsn message (DSN) generation.

It implements RFC 3464 and RFC 3462.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateDSN

func GenerateDSN(utf8 bool, envelope Envelope, mtaInfo ReportingMTAInfo, rcptsInfo []RecipientInfo, failedHeader textproto.Header, outWriter io.Writer) (textproto.Header, error)

GenerateDSN is a top-level function that should be used for generation of the DSNs.

DSN header will be returned, body itself will be written to outWriter.

Types

type Action

type Action string
const (
	ActionFailed    Action = "failed"
	ActionDelayed   Action = "delayed"
	ActionDelivered Action = "delivered"
	ActionRelayed   Action = "relayed"
	ActionExpanded  Action = "expanded"
)

type Envelope

type Envelope struct {
	MsgID string
	From  string
	To    string
}

type RecipientInfo

type RecipientInfo struct {
	FinalRecipient string
	RemoteMTA      string

	Action Action
	Status smtp.EnhancedCode

	// DiagnosticCode is the error that will be returned to the sender.
	DiagnosticCode error
}

func (RecipientInfo) WriteTo

func (info RecipientInfo) WriteTo(utf8 bool, w io.Writer) error

type ReportingMTAInfo

type ReportingMTAInfo struct {
	ReportingMTA    string
	ReceivedFromMTA string

	// Message sender address, included as 'X-Maddy-Sender: rfc822; ADDR' field.
	XSender string

	// Message identifier, included as 'X-Maddy-MsgId: MSGID' field.
	XMessageID string

	// Time when message was enqueued for delivery by Reporting MTA.
	ArrivalDate time.Time

	// Time when message delivery was attempted last time.
	LastAttemptDate time.Time
}

func (ReportingMTAInfo) WriteTo

func (info ReportingMTAInfo) WriteTo(utf8 bool, w io.Writer) error

Jump to

Keyboard shortcuts

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