pkmail

package module
v0.0.0-...-69e31d5 Latest Latest
Warning

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

Go to latest
Published: May 16, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package pkmail implements a schema for storing parsed e-mail messages in Perkeep.

Index

Constants

View Source
const SchemaVersion = "2.2.0"

SchemaVersion is the latest schema version as a semver string.

Variables

View Source
var ErrMalformed = errors.New("malformed part")

ErrMalformed is the error produced when a blob does not conform to the pkmail schema.

Functions

func PkGetMsg

func PkGetMsg(ctx context.Context, src blob.Fetcher, ref blob.Ref) (*rmime.Message, error)

PkGetMsg fetches the blobs from src, rooted at ref, to reconstruct an rmime.Message.

func PkPutMsg

func PkPutMsg(ctx context.Context, dst blobserver.BlobReceiver, msg *rmime.Message) (blob.Ref, error)

PkPutMsg adds a message to the Perkeep server at dst. The message is added as a hierarchy of blobs with the root blob a schema blob having camliType "mime-message". See PkPutPart for other details of the root schema blob.

func PkPutPart

func PkPutPart(ctx context.Context, dst blobserver.BlobReceiver, p *rmime.Part) (blob.Ref, error)

PkPutPart adds a message part to the Perkeep server at dst. The message part is added as a hierarchy of blobs with the root blob a schema blob having camliType "mime-part".

Other fields of the root schema blob:

pkmail_version: semver string for the pkmail schema version in use
content_type: canonicalized content-type of the part
content_disposition: canonicalized content-disposition token ("inline" or "attachment")

and optionally:

header: header of the part as a list of (name, list-of-values) pairs (if non-empty)
time: parsed date of the part
charset: charset for text/* parts
subject: decoded subject text for message parts
content_type_params
content_disposition_params

Additionally, the body of the part appears as follows:

  • for multipart/* parts, as the field "subparts", a list of nested "mime-part" schema blobs
  • for message/delivery-status parts, {"message": fields, "recipients": [fields, ...]} as the field "delivery_status"
  • for message/* parts, as the field "submessage", a nested "mime-message" schema blob
  • for other parts, as the field "body", a reference to a "bytes" schema blob.

Types

This section is empty.

Directories

Path Synopsis
cmd
pkmail
Command pkmail reads folder names from the command line, parses their messages, and adds them to a Perkeep server.
Command pkmail reads folder names from the command line, parses their messages, and adds them to a Perkeep server.

Jump to

Keyboard shortcuts

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