Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Attachment ¶
Attachment represents an email attachment
func CollectAttachments ¶
func CollectAttachments(log *zerolog.Logger, r io.Reader) []Attachment
CollectAttachments walks a raw MIME message and returns the DMARC report attachments in it. It is exported for the Maildir intake, which holds whole messages on disk instead of an IMAP body.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client represents an IMAP client
func NewClient ¶
func NewClient(cfg *config.IMAPConfig, log *zerolog.Logger) *Client
NewClient creates a new IMAP client
func (*Client) Disconnect ¶
Disconnect closes the IMAP connection
func (*Client) FetchDMARCReports ¶
func (c *Client) FetchDMARCReports() (*FetchResult, error)
FetchDMARCReports fetches DMARC reports from the mailbox
func (*Client) MarkAsSeen ¶
MarkAsSeen marks messages as seen
type FetchResult ¶
type FetchResult struct {
Reports []Report
MessageIDs []uint32
// DeadletterIDs are the messages of the batch that carried no report at
// all. The Maildir intake moves them to the deadletter mailbox instead of
// cur/, so they are not fetched again as if nothing happened.
DeadletterIDs []uint32
}
FetchResult holds the fetched reports and the message sequence numbers
type Report ¶
type Report struct {
Subject string
From string
Date string
// MessageID is the RFC 5322 Message-ID from the IMAP envelope: the one
// key that finds the mail again on any server (SEARCH HEADER
// Message-ID, doveadm search, Gmail's rfc822msgid:) and in the MTA log.
MessageID string
// UID is the message's IMAP UID in the fetched mailbox. It is only
// stable there: a move to the processed mailbox assigns a new one.
UID uint32
Attachments []Attachment
}
Report represents a DMARC report email
Click to show internal directories.
Click to hide internal directories.