composing

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2024 License: MIT Imports: 28 Imported by: 0

Documentation

Overview

Package composing implements $EDITOR interfacing with a Brief sack. The Brief composing model is grounded on an attempt to present the editor with a version of the mail being composed as close to human-readable as possible whilst still being correctly parseable by a lenient parser. Once composed, a very standards-compliant RFC 822 message is produced.

Index

Constants

View Source
const ASCIIWhitespace = "\t\n\r "
View Source
const CRLF = "\r\n"

Variables

This section is empty.

Functions

func Composing

func Composing(osfsys *OSFS) (bool, error)

func Crlf2Lf

func Crlf2Lf(raw []byte) []byte

func Destroy

func Destroy(osfsys *OSFS) error

func Edit

func Edit(osfsys *OSFS, editor string, dealias config.DealiasFunc, enalias config.EnaliasFunc) error

func Lf2Crlf

func Lf2Crlf(raw []byte) []byte

func SplitByCommaRespectingDoubleQuotes

func SplitByCommaRespectingDoubleQuotes(text string) []string

NOTE: Does *not* conform to the full RFC 5322's "address-list": comments, group names, etc. are not accounted for

func Write deprecated

func Write(osfsys *OSFS, alias config.EnaliasFunc, cm *ComposingMessage) error

Deprecated: TODO: deprecated?

Types

type Attachment

type Attachment struct {
	Filename string
	MIMEType string
	Data     []byte
}

func (Attachment) Part

func (attachment Attachment) Part() *mailx.Part

type ComposingMessage

type ComposingMessage struct {
	// TODO unrepresented in msgs.(*ParsedMessage)
	Body         []byte
	BodyLanguage string
	Attachments  []Attachment
	ExtraParts   []ExtraPart

	Notes []string

	Date        time.Time
	Froms       []*netmail.Address
	Senders     []*netmail.Address
	Tos         []*netmail.Address
	Ccs         []*netmail.Address
	Bccs        []*netmail.Address
	InReplyTos  []msgs.MessageId
	Subject     string
	ExtraFields []mailx.Field
}

func Read

func Read(osfsys *OSFS, dealias config.DealiasFunc) (*ComposingMessage, error)

func (*ComposingMessage) Fixup

func (cm *ComposingMessage) Fixup(enalias config.EnaliasFunc)

func (*ComposingMessage) MarshalBinary

func (cm *ComposingMessage) MarshalBinary() ([]byte, error)

func (*ComposingMessage) Sender

func (cm *ComposingMessage) Sender() (*netmail.Address, error)

func (*ComposingMessage) Simple

func (cm *ComposingMessage) Simple() bool

A simple message is one without any multipart components.

type ExtraPart

type ExtraPart struct {
	Fields  []mailx.Field
	RawBody []byte
}

TODO

type OSFS

type OSFS struct {
	Root string
	vfs.FS
}

Jump to

Keyboard shortcuts

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