Karta.SMTP.Path (Karta v1.0.0)

Parses the <path> [params] argument of MAIL FROM and RCPT TO (RFC 5321 §4.1.2, extended for UTF-8 by RFC 6531). Address syntax here is the SMTP envelope syntax; header addresses are parsed by Karta.Mail.Address.

Summary

Functions

An address split at its last @: {local, domain}, the local part alone and an empty domain when there is no @. A quoted local part may contain one, so the last one separates the domain. Case is kept.

Types

params()

@type params() :: %{required(String.t()) => String.t() | true}

Functions

parse(arg, opts \\ [])

@spec parse(binary(), keyword()) ::
  {:ok, :null | String.t(), params()} | {:error, :syntax}

split(address)

@spec split(String.t()) :: {String.t(), String.t()}

An address split at its last @: {local, domain}, the local part alone and an empty domain when there is no @. A quoted local part may contain one, so the last one separates the domain. Case is kept.

valid_domain?(literal)

@spec valid_domain?(binary()) :: boolean()