email

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package email holds the flat, JSON-friendly representation that every format reader in this module produces, plus the text helpers shared between them.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertToUTF8

func ConvertToUTF8(s string) string

ConvertToUTF8 returns s unchanged if it is already valid UTF-8, otherwise decodes it from Windows-1252. On decode failure it returns s unchanged.

func DecodeString8

func DecodeString8(data []byte) string

DecodeString8 decodes a NUL-terminated single-byte string, as stored in MSG PT_STRING8 properties.

Types

type Attachment

type Attachment struct {
	Filename    string `json:"filename"`
	ContentType string `json:"contentType"`
	Data        []byte `json:"data"`
}

Attachment is a single file carried by a message, already decoded.

type Data

type Data struct {
	From          string       `json:"from"`
	To            []string     `json:"to"`
	Cc            []string     `json:"cc"`
	Bcc           []string     `json:"bcc"`
	Subject       string       `json:"subject"`
	Body          string       `json:"body"`
	Attachments   []Attachment `json:"attachments"`
	IsPec         bool         `json:"isPec"`
	HasInnerEmail bool         `json:"hasInnerEmail"`
	Date          string       `json:"date"`
}

Data is a message flattened into the shape callers consume: addresses as strings, a single body, attachments already decoded.

Jump to

Keyboard shortcuts

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