Documentation
¶
Overview ¶
Package mail builds and sends AgentTransfer's outbound email and parses inbound email.
Outbound messages are ordinary multipart/mixed emails: a human-readable text body plus the machine-readable AgentTransfer manifest attached as application/vnd.agenttransfer+json. Sending goes through the operator's relay (any SMTP submission endpoint — Resend, SES, Postmark, ...); AgentTransfer never sends from its own IP.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractAgentMessageID ¶
ExtractAgentMessageID pulls an AgentTransfer "msg_..." id out of an RFC Message-ID like "<msg_abc@host>", or returns "".
func FormatRFCMessageID ¶
FormatRFCMessageID renders an AgentTransfer message id as an RFC Message-ID.
Types ¶
type InAttachment ¶
InAttachment is one attachment from an inbound email.
type Inbound ¶
type Inbound struct {
From string
To []string
Subject string
Text string
MessageID string
InReplyTo string
References string
Manifest []byte // raw agenttransfer.json bytes, if present
Attachments []InAttachment
}
Inbound is a parsed inbound email.
type Message ¶
type Message struct {
FromName string
From string
To []string
CC []string
Subject string
Text string
MessageID string // full RFC id, e.g. <msg_x@domain>
InReplyTo string
References string
// Manifest is attached as application/vnd.agenttransfer+json when set.
Manifest []byte
ManifestName string
}
Message is an outbound email under construction.
type Outbound ¶
type Outbound struct {
Host string // host:port
HostOnly string
User string
Pass string
Implicit bool // smtps:// — implicit TLS instead of STARTTLS
}
Outbound is a parsed OUTBOUND relay configuration.
func ParseOutbound ¶
ParseOutbound parses an OUTBOUND value:
resend:re_xxxx (sugar for Resend's SMTP endpoint) smtp://user:pass@host:587 (STARTTLS submission) smtps://user:pass@host:465 (implicit TLS)