Documentation ¶
Overview ¶
Package dsn contains the utilities used for dsn message (DSN) generation.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrUnicodeMailbox = errors.New("address: cannot convert the Unicode local-part to the ACE form")
)
View Source
var FailedTemplateText = `` /* 414-byte string literal not displayed */
FailedTemplateText is the text of the human-readable part of DSN.
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.
func SendDSN ¶
func SendDSN(smtpaddr string, utf8 bool, envelope Envelope, mtaInfo ReportingMTAInfo, rcptsInfo []RecipientInfo, failedHeader textproto.Header) error
SendDSN generates and sends DSN via an smtp relay From Addr defaults to <>
Types ¶
type RecipientInfo ¶
type ReportingMTAInfo ¶
type ReportingMTAInfo struct { ReportingMTA string ReceivedFromMTA string // XMTAName if empty it defaults to Godsn, and is used as MTA name in // the X-HeaderKey (e.g. X-Godsn-Sender) - rfc3464 section 2.4 XMTAName string // Message sender address, included as 'X-Godsn-Sender: rfc822; ADDR' field. XSender string // Message identifier, included as 'X-Godsn-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 }
Click to show internal directories.
Click to hide internal directories.