mdn

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package mdn is an implementation of RFC 9007: Handling Message Disposition Notification with the JSON Meta Application Protocol (JMAP). In plain terms, it handles read receipts of emails.

Index

Constants

View Source
const URI jmap.URI = "urn:ietf:params:jmap:mdn"

Variables

This section is empty.

Functions

This section is empty.

Types

type Capability

type Capability struct{}

The MDN Capability

func (*Capability) New

func (m *Capability) New() jmap.Capability

func (*Capability) URI

func (m *Capability) URI() jmap.URI

type Disposition

type Disposition struct {
	// This MUST be one of the following strings:
	// - "manual-action"
	// - "automatic-action"
	ActionMode string `json:"actionMode,omitempty"`

	// This MUST be one of the following strings:
	// - "mdn-sent-manually"
	// - "mdn-sent-automatically"
	SendingMode string `json:"sendingMode,omitempty"`

	// This MUST be one of the following strings:
	// - "deleted"
	// - "dispatched"
	// - "displayed"
	// - "processed"
	Type string `json:"type,omitempty"`
}

type MDN

type MDN struct {
	// The Email ID of the received message to which this MDN is related
	ForEmailID jmap.ID `json:"forEmailId,omitempty"`

	// The Subject of the MDN
	Subject string `json:"subject,omitempty"`

	// The human-readable part of the MDN, as plain text
	TextBody string `json:"textBody,omitempty"`

	// If true, the content of the original message will appear in the third
	// component of the multipart/report generated for the MDN
	IncludeOriginalmessage bool `json:"includeOriginalMessage,omitempty"`

	// The name of the Mail User Agent (MUA) creating this MDN
	ReportingUA string `json:"reportinUA,omitempty"`

	// The object containing the diverse MDN disposition options
	Disposition *Disposition `json:"disposition,omitempty"`

	// The name of the gateway or MTA that translated a foreign
	// (non-internet) MDN into this MDN
	//
	// server-set
	MDNGateway string `json:"mdnGateway,omitempty"`

	// The original recipient address specified by the sender of the message
	// which the MDN is for
	//
	// server-set
	OriginalRecipient string `json:"originalRecipient,omitempty"`

	// The recipient for which the MDN is issued
	//
	// server-set
	FinalRecipient string `json:"finalRecipient,omitempty"`

	// The "Message-ID" header field of the message this MDN is for
	//
	// server-set
	OriginalMessageID string `json:"originalMessageId,omitempty"`

	// Additional information in the form of text messages when the "error"
	// disposition modifier appears
	//
	// server-set
	Error []string `json:"error,omitempty"`

	// The object where keys are extension-field names and values are
	// extension-field values
	ExtensionFields map[string]string `json:"extensionFields,omitempty"`
}

A Message Delivery Notification (MDN) object

type Parse

type Parse struct {
	// The id of the account to use.
	Account jmap.ID `json:"accountId,omitempty"`

	// The IDs of blobs to parse as MDNs
	BlobIDs []jmap.ID `json:"blobIds,omitempty"`
}

Sends an RFC5322 message from an MDN object

func (*Parse) Name

func (m *Parse) Name() string

func (*Parse) Requires

func (m *Parse) Requires() []jmap.URI

type ParseResponse

type ParseResponse struct {
	// The id of the account used for the call.
	Account jmap.ID `json:"accountId,omitempty"`

	// A map of the blob ID to the MDN resulting from the parse
	Parsed map[jmap.ID]*MDN `json:"parsed,omitempty"`

	// A list blob IDs that could not be parsed as MDNs
	NotParsable []jmap.ID `json:"notParsable,omitempty"`

	// A list of blob IDs that couldn't be found
	NotFound []jmap.ID `json:"notFound,omitempty"`
}

type Send

type Send struct {
	// The id of the account to use.
	Account jmap.ID `json:"accountId,omitempty"`

	// The ID of the Identity to associate with these MDNs
	IdentityID jmap.ID `json:"identityId,omitempty"`

	// A map of client-specified creation ID to MDN object
	Send map[jmap.ID]*MDN `json:"send,omitempty"`

	// A map of the ID to a patch of update the Email object referenced by
	// MDN/send, if the sending succeeds. The ID will always be a backward
	// reference to the creation ids
	OnSuccessUpdateEmail map[jmap.ID]*jmap.Patch `json:"onSuccessUpdateEmail,omitempty"`
}

Sends an RFC5322 message from an MDN object

func (*Send) Name

func (m *Send) Name() string

func (*Send) Requires

func (m *Send) Requires() []jmap.URI

type SendResponse

type SendResponse struct {
	// The id of the account used for the call.
	Account jmap.ID `json:"accountId,omitempty"`

	// A map of the creation ID to an MDN containing any properties that
	// were not set by the client
	Sent map[jmap.ID]*MDN `json:"sent,omitempty"`

	// A map of creation ID to a SetError for each MDN not sent
	NotSent map[jmap.ID]*jmap.SetError `json:"notSent,omitempty"`
}

Jump to

Keyboard shortcuts

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