Documentation
¶
Overview ¶
Package maildev contains the opt-in MailDev REST compatibility contract.
Index ¶
- Constants
- func EmbedAttachmentURLs(html, basePath, emailID string, attachments []Attachment) string
- func MatchesFilters(email Email, filters map[string]string) bool
- func ParseNonNegativeInt(value string) (int, bool)
- type Address
- type Attachment
- type BulkDeleteResponse
- type ConfigResponse
- type Email
- type Envelope
- type EnvelopeAddress
- type Summary
- type SummaryResponse
Constants ¶
View Source
const ( DefaultPageSize = 50 MaxPageSize = 200 PreviewLength = 140 )
Variables ¶
This section is empty.
Functions ¶
func EmbedAttachmentURLs ¶
func EmbedAttachmentURLs(html, basePath, emailID string, attachments []Attachment) string
EmbedAttachmentURLs replaces MailDev-style CID references with facade URLs.
func MatchesFilters ¶
MatchesFilters applies MailDev's exact, case-sensitive query-string field matching to a compatibility DTO.
func ParseNonNegativeInt ¶
Types ¶
type Attachment ¶
type BulkDeleteResponse ¶
type ConfigResponse ¶
type Email ¶
type Email struct {
ID string `json:"id"`
Time time.Time `json:"time"`
Read bool `json:"read"`
Subject string `json:"subject"`
Source string `json:"source"`
Size int64 `json:"size"`
SizeHuman string `json:"sizeHuman"`
From []Address `json:"from"`
To []Address `json:"to"`
CC []Address `json:"cc,omitempty"`
BCC []Address `json:"bcc,omitempty"`
CalculatedBCC []Address `json:"calculatedBcc"`
Date *time.Time `json:"date,omitempty"`
HTML string `json:"html,omitempty"`
Text string `json:"text,omitempty"`
Headers map[string]interface{} `json:"headers"`
InReplyTo string `json:"inReplyTo,omitempty"`
Priority string `json:"priority,omitempty"`
Attachments []Attachment `json:"attachments"`
Envelope Envelope `json:"envelope"`
}
Email is deliberately independent from OwlMail's native DTO. Its JSON names, optional fields, envelope shape, and attachment shape follow MailDev's REST contract without changing /api/v1.
func FilterAndPage ¶
type Envelope ¶
type Envelope struct {
From EnvelopeAddress `json:"from"`
To []EnvelopeAddress `json:"to"`
Host string `json:"host,omitempty"`
RemoteAddress string `json:"remoteAddress,omitempty"`
}
type EnvelopeAddress ¶
type EnvelopeAddress struct {
Address string `json:"address"`
}
type Summary ¶
type Summary struct {
ID string `json:"id"`
Time time.Time `json:"time"`
Read bool `json:"read"`
Subject string `json:"subject"`
Size int64 `json:"size"`
SizeHuman string `json:"sizeHuman"`
From []Address `json:"from"`
To []Address `json:"to"`
CC []Address `json:"cc,omitempty"`
AttachmentCount int `json:"attachmentCount"`
Preview string `json:"preview"`
}
func FromEmailSummary ¶
func FromEmailSummary(email mailserver.EmailSummary) Summary
FromEmailSummary maps the mailbox's lightweight summary projection into the MailDev DTO without requiring a complete message clone.
Click to show internal directories.
Click to hide internal directories.