email

package
v0.0.0-...-bd40a71 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2024 License: BSD-3-Clause Imports: 21 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Context

func Context(ctx context.Context, queue *Queue) context.Context

Returns a context which includes the given mail worker.

func EnqueueStd

func EnqueueStd(ctx context.Context, header mail.Header,
	bodyReader io.Reader, rcptKey *string) error

Updates an email with the standard SourceHut headers, signs and optionally encrypts it, and then queues it for delivery.

Senders should fill in at least the To and Subject headers, and the message body. Message-ID, Date, From, and Reply-To will also be added if they are not already present.

func Middleware

func Middleware(queue *Queue) func(next http.Handler) http.Handler

Adds HTTP middleware to provide an email work queue to this context.

func NewTask

func NewTask(msg *bytes.Buffer, rcpts []string) *work.Task

Returns a task which will send this email for the work queue. If the caller does not need to customize the task parameters, the Enqueue function may be more desirable.

func Send

func Send(ctx context.Context, msg io.Reader, rcpts []string) error

Sends an email. Blocks until it's sent or an error occurs.

Types

type Queue

type Queue struct {
	*work.Queue
	// contains filtered or unexported fields
}

func ForContext

func ForContext(ctx context.Context) *Queue

Returns the email worker for this context.

func NewQueue

func NewQueue(conf ini.File) *Queue

Creates a new email processing queue.

func (*Queue) CanPGPSign

func (q *Queue) CanPGPSign() bool

CanPGPSign checks whether emails sent via the queue are signed via OpenPGP.

Jump to

Keyboard shortcuts

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