mailmime

package
v0.0.0-...-175016c Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2026 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Overview

Package mailmime builds the plain-text MIME messages dankmail sends: threaded replies and minimal compositions. It is shared by the Gmail provider (raw message for users.messages.send) and the future IMAP/SMTP provider. Pure functions, no I/O.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoRecipients = errors.New("mailmime: no recipients")
)

Functions

func BuildCompose

func BuildCompose(from string, d provider.ComposeDraft) ([]byte, error)

BuildCompose constructs a minimal new plain-text message.

func BuildReply

func BuildReply(orig provider.MessageDelta, from string, d provider.ReplyDraft) ([]byte, error)

BuildReply constructs a plain-text reply to orig, sent as from. Threading: In-Reply-To is orig's Message-ID and References extends orig's References chain. Subject gets a single "Re: " prefix (idempotent, case-insensitive). Recipient rules:

  • reply: Reply-To of the original if present, else its From;
  • reply-all: additionally the original To (as To) and Cc (as Cc);
  • the sender's own address is always excluded, and if the reply target IS the sender (replying to your own message), the original To list is used instead.

The body is sent as-is (no quoting), UTF-8, quoted-printable.

Types

This section is empty.

Jump to

Keyboard shortcuts

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