Documentation
¶
Overview ¶
Package mailrules holds the rules every message must follow before a runner sends it: the idempotency key, plain addresses, header fields without line breaks or control characters, the allowed headers, sizes, mailbox folders and the pages of a mailbox list. A runner adds the app's own policy on top: the sender and the domains it may write to. mailer checks the same rules before it asks the runner.
Index ¶
Constants ¶
const ( // MaxRecipients bounds To, Cc and Bcc together. MaxRecipients = 50 // MaxAttachments bounds the attachments of one message. MaxAttachments = 20 // MaxSize bounds the subject, the bodies and the attachments with their content types of one // message together, in bytes. MaxSize = 10 << 20 // DefaultList is the number of messages a mailbox list returns when it asks for 0 or fewer. DefaultList = 50 // MaxList bounds the number of messages one mailbox list returns. MaxList = 100 )
Variables ¶
var Folders = []string{"inbox", "archive", "trash"}
Folders are the folders of an app's mailbox.
Functions ¶
func Address ¶
Address checks one bare address: at most 254 bytes of visible ASCII, one @, no display name, and a domain that email.to_domains in aicoded.yaml could list.
func Check ¶
func Check(msg *runnerv1.SendRequest) error
Check returns the first rule msg breaks, as a coded error, or nil.
func Page ¶
Page returns the offset and limit of a mailbox list: a negative offset is 0, a limit of 0 or less is DefaultList, and a limit above MaxList is MaxList.
func ValidDomain ¶
ValidDomain reports whether d is a lower-case domain that email.to_domains in aicoded.yaml may list.
Types ¶
This section is empty.