Documentation ¶
Overview ¶
Package mime implements the MIME encoding used for messages in Mute.
Index ¶
- Constants
- func EncodeChunks(header Header, msg string, size uint64) (chunks []string, err error)
- func New(w io.Writer, header Header, msg string, attachments []*Attachment) error
- func Parse(r io.Reader) (header *Header, subject string, message string, attachments []*Attachment, ...)
- func SplitMessage(msg string) (subject, message string)
- type Attachment
- type Header
Constants ¶
View Source
const MaxMsgSize = 10485760 // 10GB
MaxMsgSize is the maximums size a MIME encoded message can have.
Variables ¶
This section is empty.
Functions ¶
func EncodeChunks ¶
EncodeChunks splits a MIME encoded message msg into multiple chunks of given size many bytes.
func Parse ¶
func Parse(r io.Reader) ( header *Header, subject string, message string, attachments []*Attachment, err error, )
Parse parses a MIME encoded message.
func SplitMessage ¶
SplitMessage splits a given Mute message msg into subject line (before the first newline) and actual message (after the first newline).
Types ¶
type Attachment ¶
type Attachment struct { Filename string // original filename of attachment Reader io.Reader // the io.Reader to read the attachment from ContentType string // e.g., ""application/pdf" Inline bool // attachment should be displayed inline }
Attachment is a file attachment in Mute. The Content-Type of the MIME attachment is determined as follows:
- if ContentType != "" ContentType is used
- if ContentType == "" the Content-Type is derived from Filename
- if no Content-Type could be derived "application/octet-stream" is used
Click to show internal directories.
Click to hide internal directories.