Karta. Inbound. Endpoint
(Karta v1.0.0)
Where a server's received mail goes (Karta.Inbound). Its kind is
chosen when it is added and never changes:
:http- aPOSTof every message tourl, in aformatchosen when the endpoint is added::karta(the default; JSON, signed as Standard Webhooks with the endpoint'ssecret),:raw(the message itself,message/rfc822, signed the same way),:postal(Postal'sRawMessage, as JSON or form data byencoding, signed with the key of the endpoint's organisation; no secret of its own),:postal_hash(Postal'sHash, JSON or form data, signed with the same key),:mailgun(a Mailgun route'sforward()post, form data, the raw MIME in form data, or JSON byencoding, signed with the endpoint's own secret, which is the signing key),:sendgrid(SendGrid's Inbound Parse with the raw MIME message) or:postmark(Postmark's inbound webhook with the raw MIME message).encodingis the format's own:jsonorformfor Postal's two formats,form,mimeorjsonfor Mailgun's; the other parsed formats have one shape. A URL may carry a user name and password (https:only): they are taken out ofurland kept, decoded and encrypted, incredentials("user:password"), and sent as Basic authentication; a URL given without them removes them.:smtp- the message relayed to the mail server athostandport(default 25), with the envelope it arrived with.tls::opportunistic(default; STARTTLS when offered),:encrypted(STARTTLS required) or:verified(STARTTLS required and the certificate valid forhost).:address- the message forwarded toaddresses(one to ten), with a sender rewritten by SRS (Karta.Inbound.SRS).
An HTTP endpoint in the :karta format may be notify-only
(notify_only: true, set by Karta.Kantoor.mark_endpoint/3; nil
otherwise): the push carries the message's metadata without raw, and the
receiver fetches the body when it wants it. The dispatcher then neither
reads the stored body nor applies its size limit to it. kantoor: true
marks an endpoint of the Kantoor interface (Karta.Kantoor.Response).
credential_id names the Kantoor key that registered the endpoint, or is
nil for an endpoint an operator made (or whose key was deleted); the
interface's ownership rules are in Karta.Kantoor.Attach.
secret and credentials are encrypted by Karta.Vault. An HTTP
endpoint may also carry one extra header with a secret value, for a
receiver that cannot check a signature (auth_header,
auth_header_value; Karta.RequestAuth): it is sent beside the format's
signature, never instead of it, and its value is shown once.
Summary
Functions
What input may set. The kind, and an HTTP endpoint's format, only while
the endpoint is new. allow_http: true accepts http: URLs (otherwise
only https:).
Whether an endpoint of this kind and format has a secret of its own.
The user name an HTTP endpoint's requests authenticate with, or nil.
Types
@type t() :: %Karta.Inbound.Endpoint{ __meta__: term(), addresses: term(), auth_header: term(), auth_header_remove: term(), auth_header_value: term(), credential: term(), credential_id: term(), credentials: term(), encoding: term(), format: term(), host: term(), id: term(), inserted_at: term(), kantoor: term(), kind: term(), name: term(), notify_only: term(), port: term(), secret: term(), server: term(), server_id: term(), tls: term(), updated_at: term(), url: term() }
Functions
@spec changeset(t(), map(), keyword()) :: Ecto.Changeset.t()
What input may set. The kind, and an HTTP endpoint's format, only while
the endpoint is new. allow_http: true accepts http: URLs (otherwise
only https:).
Whether an endpoint of this kind and format has a secret of its own.
The user name an HTTP endpoint's requests authenticate with, or nil.