webops

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

Package webops implements shared functionality between webapisrv and webmail.

Index

Constants

This section is empty.

Variables

View Source
var ErrMessageNotFound = errors.New("no such message")

Functions

func Export

func Export(log mlog.Log, accName string, w http.ResponseWriter, r *http.Request)

Export is used by webmail and webaccount to export messages of one or multiple mailboxes, in maildir or mbox format, in a tar/tgz/zip archive or direct mbox.

func ReadableParts

func ReadableParts(p message.Part, maxSize int64) (text string, html string, found bool, err error)

ReadableParts returns the contents of the first text and/or html parts, descending into multiparts, truncated to maxSize bytes if longer.

Types

type XOps

type XOps struct {
	DBWrite    func(ctx context.Context, acc *store.Account, fn func(tx *bstore.Tx))
	Checkf     func(ctx context.Context, err error, format string, args ...any)
	Checkuserf func(ctx context.Context, err error, format string, args ...any)
}

func (XOps) MessageDelete

func (x XOps) MessageDelete(ctx context.Context, log mlog.Log, acc *store.Account, messageIDs []int64)

func (XOps) MessageDeleteTx

func (x XOps) MessageDeleteTx(ctx context.Context, log mlog.Log, tx *bstore.Tx, acc *store.Account, messageIDs []int64, modseq store.ModSeq) (store.ModSeq, []store.Change)

func (XOps) MessageFlagsAdd

func (x XOps) MessageFlagsAdd(ctx context.Context, log mlog.Log, acc *store.Account, messageIDs []int64, flaglist []string)

func (XOps) MessageFlagsClear

func (x XOps) MessageFlagsClear(ctx context.Context, log mlog.Log, acc *store.Account, messageIDs []int64, flaglist []string)

func (XOps) MessageMove

func (x XOps) MessageMove(ctx context.Context, log mlog.Log, acc *store.Account, messageIDs []int64, mailboxName string, mailboxID int64)

MessageMove moves messages to the mailbox represented by mailboxName, or to mailboxID if mailboxName is empty.

func (XOps) MessageMoveTx

func (x XOps) MessageMoveTx(ctx context.Context, log mlog.Log, acc *store.Account, tx *bstore.Tx, messageIDs []int64, mbDst store.Mailbox, modseq store.ModSeq) (store.ModSeq, []store.Change)

Jump to

Keyboard shortcuts

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