A message that came to the app, as its mailbox gets it.
Its fields are a message's, whatever brought it: who sent it, to whom,
its subject, its text and HTML, its files, when it was sent. Email is
the one channel there is (channel: :email); the email's own are kept
beside them: its headers, Message-ID and references, its structure
and the raw email.
:id- the message's row (Letterbox.Inbound).:from- the sender (Letterbox.Address), as the email says it. Anyone can write anyFrom.:verified_from- the sender, when a mail server the app trusts checked it: theFromwhose domain passed DMARC, or DKIM or SPF for that domain, in that server'sAuthentication-Results(seeLetterbox.Email.parse/2's:trusted_servers). nil otherwise. Act on this one, not on:from, for what only a known sender may do.:to,:cc,:bcc,:reply_to- its addresses, as the email says.:recipient- the recipient its route matched (Letterbox.Routing): the address it came in by,site+abc123@in.example.com, whose sub-address (Letterbox.Address.tag/1) can say whose it is.:recipients- where it was delivered: the addresses the mail server took it for (an ingress's envelope, Resend'sreceived_for), else those ofTo,Cc,Delivered-ToandX-Original-To. An address inBccis only here.:subject,:text,:html- in UTF-8.:textis the plain text the email has, or text from its HTML when it has none.:lossyis true when some of it could not be read (a charset no one knows).:attachments- its files (Letterbox.Attachment), those its HTML shows (inline?: true) included.:file_links- links in its text to files sent another way, too large for an email: Apple's Mail Drop, Google Drive, OneDrive, Dropbox, WeTransfer.%{url: …, service: :mail_drop | …}.:sent_at- itsDate, in UTC, or nil.:message_id,:in_reply_to,:references- the email's ids, without their angle brackets: what threads it to what was sent.:headers- all the email's headers (Letterbox.MIME.Header), undecoded;header/2gives one decoded.:mime- its structure (Letterbox.MIME), and:raw, the email as it came.
Summary
Functions
Whether it was delivered to address (a string, any case, with or
without its sub-address).
Its attachments the HTML does not show in its text.
The first value of a header (any case), decoded to UTF-8, or nil.
Every value of a header (any case), decoded.
Types
@type t() :: %Letterbox.Message{ attachments: [Letterbox.Attachment.t()], bcc: [Letterbox.Address.t()], cc: [Letterbox.Address.t()], channel: :email, file_links: [%{url: String.t(), service: atom()}], from: Letterbox.Address.t() | nil, headers: [Letterbox.MIME.Header.t()], html: String.t() | nil, id: term(), in_reply_to: [String.t()], lossy: boolean(), message_id: String.t() | nil, mime: Letterbox.MIME.t() | nil, raw: binary() | nil, recipient: Letterbox.Address.t() | nil, recipients: [Letterbox.Address.t()], references: [String.t()], reply_to: [Letterbox.Address.t()], sent_at: DateTime.t() | nil, subject: String.t() | nil, text: String.t() | nil, to: [Letterbox.Address.t()], verified_from: Letterbox.Address.t() | nil }
Functions
Whether it was delivered to address (a string, any case, with or
without its sub-address).
@spec files(t()) :: [Letterbox.Attachment.t()]
Its attachments the HTML does not show in its text.
The first value of a header (any case), decoded to UTF-8, or nil.
Every value of a header (any case), decoded.