email

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2026 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AttachmentResult

type AttachmentResult struct {
	Path        string `json:"path"`
	Filename    string `json:"filename"`
	ContentType string `json:"content_type,omitempty"`
	Bytes       int64  `json:"bytes"`
	Hint        string `json:"hint"`
}

AttachmentResult is the answer of the get_attachment action: where the attachment lies in the sandbox and how the agent looks at it.

type Config

type Config struct {
	IMAPAddr string // host:port
	IMAPHost string // hostname for TLS SNI
	IMAPTLS  string
	SMTPAddr string
	SMTPHost string
	SMTPTLS  string
	Username string
	Password string
	From     string // sender address (default: username)
}

Config is the parsed connection configuration of both endpoints.

func ParseConfig

func ParseConfig(cred target.Credential) (Config, error)

ParseConfig decomposes the brokered credential into the mail configuration.

type Message

type Message struct {
	MessageSummary
	To          []string `json:"to,omitempty"`
	Cc          []string `json:"cc,omitempty"`
	ReplyTo     string   `json:"reply_to,omitempty"`
	InReplyTo   []string `json:"in_reply_to,omitempty"`
	Body        string   `json:"body"`
	BodyIsHTML  bool     `json:"body_is_html,omitempty"`
	Truncated   bool     `json:"truncated,omitempty"`
	Attachments []string `json:"attachments,omitempty"`
}

Message is the detail view (get_message) including the extracted text.

type MessageSummary

type MessageSummary struct {
	UID       uint32 `json:"uid"`
	Mailbox   string `json:"mailbox"`
	From      string `json:"from"`
	Subject   string `json:"subject"`
	Date      string `json:"date,omitempty"`
	Seen      bool   `json:"seen"`
	MessageID string `json:"message_id,omitempty"`
}

MessageSummary is the list view of a mail (list_unread/list_messages).

type System

type System struct{}

System binds a mail account (IMAP/SMTP) into the target registry as a target system plugin: read the inbox (IMAP), reply and send (SMTP), file mail by flags/folders. There is no webhook inbound — mail knows no pushes; the intake runs by HEARTBEAT.md polling as with the GitLab plugin.

func (System) ActionSubject

func (System) ActionSubject(action string, _ json.RawMessage) string

ActionSubject: every SMTP delivery leaves the organization — send and reply are guard-rail subjects of their own that can be ruled on sharply.

func (System) Execute

func (System) Execute(ctx context.Context, action string, params json.RawMessage, cred target.Credential) (any, error)

func (System) HasWork

func (System) HasWork(_ context.Context, cred target.Credential) (bool, error)

HasWork (target.WorkChecker): cheap pre-check of the control plane for nur-wenn: heartbeats — is at least one unread mail in the INBOX working set? Uses the same path as list_unread, so that echo protection and COVEY_EMAIL_INTAKE_ADDRESSES take effect identically: what the agent would not see does not wake it either.

func (System) Name

func (System) Name() string

func (System) ParseWebhook

func (System) ParseWebhook([]byte) (target.WebhookEvent, error)

func (System) PromptDoc

func (System) PromptDoc() string

func (System) VerifyWebhook

func (System) VerifyWebhook(string, []byte, http.Header) bool

VerifyWebhook/ParseWebhook: mail knows no webhooks — the intake runs by heartbeat polling; answers show up as new unread mail.

Jump to

Keyboard shortcuts

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