Karta.Inbound.Route (Karta v1.0.0)

Which address of a verified domain a server receives, and what happens to its mail (Karta.Inbound).

local_part is the part before the @, in lower case (letters, digits, ., _ and -; no +), or * for every address of the domain that has no route of its own. With plus_addressing (the default), name+anything@domain is received by the route name when it has no route of its own.

mode:

  • :endpoint - the message goes to endpoint (Karta.Inbound.Endpoint);
  • :accept - the message is stored, and nothing more;
  • :report - the message is stored and read as a report (Karta.Reports, for DMARC and TLS reports addressed to the domain); a report is never trusted for anything;
  • :hold - the message is stored and marked held; an owner releases it to endpoint (Karta.Inbound.release/2);
  • :reject - the address is refused when the sender names it (550), so nobody is ever sent a bounce for it.

There is no mode that bounces mail after accepting it: the sender of received mail is not known to be genuine, and a bounce to a forged one is spam to an innocent party (backscatter).

Spam (Karta.Scan): a message whose spam score reached spam_threshold (default 6.0) is spam for this route. spam_mode is :mark (deliver it as it is), :hold (hold it until released, as the :hold mode does) or :reject (refuse it while the sender is connected, 550 5.7.1). A held message is delivered to endpoint, so a route that holds has one. fail_closed (the default) refuses the message with 451 4.7.1 when a scanner that is configured cannot answer; without it the message is accepted and marked.

With dmarc_reject (the default), mail that fails DMARC for an author domain whose owner asks for rejection is refused while the sender is connected (550 5.7.1); without it, such mail is accepted and marked (Karta.SMTP.Policy.Inbound).

Summary

Functions

The address a route receives, local@domain or *@domain (the domain preloaded).

What input may set: the local part, the mode, the endpoint, plus addressing, dmarc_reject and the spam settings.

Types

t()

@type t() :: %Karta.Inbound.Route{
  __meta__: term(),
  dmarc_reject: term(),
  domain: term(),
  domain_id: term(),
  endpoint: term(),
  endpoint_id: term(),
  fail_closed: term(),
  id: term(),
  inserted_at: term(),
  local_part: term(),
  mode: term(),
  plus_addressing: term(),
  retention_days: term(),
  retention_keep: term(),
  server: term(),
  server_id: term(),
  spam_mode: term(),
  spam_threshold: term(),
  updated_at: term()
}

Functions

address(route)

@spec address(t()) :: String.t()

The address a route receives, local@domain or *@domain (the domain preloaded).

changeset(route, attrs)

@spec changeset(t(), map()) :: Ecto.Changeset.t()

What input may set: the local part, the mode, the endpoint, plus addressing, dmarc_reject and the spam settings.