Kantoor. Aliases
(Kantoor v1.0.0)
Address aliases of a domain: extra addresses that deliver into an existing
mailbox (info@example.com into calvin@example.com).
A forwarding-only alias has no mailbox. Its verified destinations and delivery
queue are managed by Kantoor.Forwarding; it grants no sending identity.
An alias address is scoped to one domain. Its target may be in another verified
domain with the same explicit Karta organisation credential and operator. Its address is normalised like a mailbox
address and must not already be a mailbox address (in any domain: two mail
domains can never share a full address) nor another alias. Only addresses
Karta can route on their own are accepted (Kantoor.Mailboxes.Alias):
+tag in an alias would only be reachable through the catch-all.
Deleting an alias also deletes the sending identities that used its address, so nobody keeps sending as an address that no longer exists.
Summary
Functions
Whether a mailbox can receive an alias in this domain.
Creates the alias address in domain delivering into mailbox.
Deletes an alias and the identities that send as its address.
The aliases that deliver into a mailbox.
One alias of the given domain, or nil.
The alias with this address (with its target mailbox), or nil; case-insensitive.
The aliases of a domain, by address.
Converts a forwarding-only alias in place, retaining its address and id. Only a single confirmed destination equal to the selected mailbox is accepted. Queued deliveries must drain first. History is retained with forwarding disabled.
Cross-domain aliases require two active, verified Karta attachments using the same explicit organisation credential and provisioning operator. No inference is made from domain names or external references. Separate credentials fail closed, even when they happen to belong to the same Karta organisation.
Whether the alias and target still permit sending or local delivery.
Types
@type error() :: :not_found | {:invalid, %{required(atom()) => String.t()}} | Ecto.Changeset.t()
Functions
Whether a mailbox can receive an alias in this domain.
@spec create( Kantoor.Mailboxes.Domain.t(), Kantoor.Mailboxes.Mailbox.t() | nil, term(), term() ) :: {:ok, Kantoor.Mailboxes.Alias.t()} | {:error, error()}
Creates the alias address in domain delivering into mailbox.
mailbox: nil is reserved for Kantoor.Forwarding.create_alias/3, which
creates the destinations in the same transaction.
{:ok, alias}; {:error, {:invalid, %{field => message}}} when the address
is not usable (malformed, not routeable by Karta, already a mailbox or alias);
{:error, changeset} from the database.
@spec delete(Kantoor.Mailboxes.Alias.t()) :: :ok
Deletes an alias and the identities that send as its address.
@spec for_mailbox(Kantoor.Mailboxes.Mailbox.t()) :: [Kantoor.Mailboxes.Alias.t()]
The aliases that deliver into a mailbox.
@spec get(Kantoor.Mailboxes.Domain.t(), term()) :: Kantoor.Mailboxes.Alias.t() | nil
One alias of the given domain, or nil.
@spec get_by_address(term()) :: Kantoor.Mailboxes.Alias.t() | nil
The alias with this address (with its target mailbox), or nil; case-insensitive.
@spec list(Kantoor.Mailboxes.Domain.t()) :: [Kantoor.Mailboxes.Alias.t()]
The aliases of a domain, by address.
Converts a forwarding-only alias in place, retaining its address and id. Only a single confirmed destination equal to the selected mailbox is accepted. Queued deliveries must drain first. History is retained with forwarding disabled.
Cross-domain aliases require two active, verified Karta attachments using the same explicit organisation credential and provisioning operator. No inference is made from domain names or external references. Separate credentials fail closed, even when they happen to belong to the same Karta organisation.
Whether the alias and target still permit sending or local delivery.