Karta.Inbound.Formats.PostalHash (Karta v1.0.0)

Postal's Hash format: the fields of a received message as Postal's HTTP endpoint sent them to applications that use its Hash format (app/senders/http_sender.rb), as JSON or as flat form data.

The fields, in Postal's order:

id, rcpt_to, mail_from, token, subject, message_id, timestamp, size,
spam_status, bounce, received_with_ssl, to, cc, from, date,
in_reply_to, references, html_body, attachment_quantity,
auto_submitted, reply_to, plain_body, attachments

id is the delivery's id (a UUID where Postal sent a number), token the stored message's id (Postal's token), message_id the header's Message-ID without its angle brackets (as Postal stores it), and timestamp when the message was received, in seconds with microseconds. to, cc, from, date, in_reply_to, references and auto_submitted are the last field of that name, unfolded and decoded; reply_to is every Reply-To field (Postal sends the list, which is null when there is none). spam_status is Postal's: Spam or NotSpam when the message was scanned (Karta.Scan), NotChecked when no scanner answered. bounce is false, and received_with_ssl says whether the message was received over TLS. plain_body and html_body are the first inline text/plain and text/html parts (null when absent).

attachments is Postal's: in JSON, a list of {filename, content_type, size, data} with data base64 in lines of 60 characters (Ruby's Base64.encode64); in form data, the flat fields attachments[N][filename], [content_type], [size] and [data].

The request is signed with the key of the endpoint's organisation, as Postal's RawMessage is (Karta.Webhooks.Postal.headers/2).

Summary

Functions

build(endpoint, delivery, message, raw, fields, now)

The request's headers and body.