MailAddress v1.0.1 MailAddress.Options View Source

Contains struct to hold configuration.

Link to this section Summary

Functions

Holds the configuration options for handling addresses

Returns relaxed parsing options

Link to this section Types

Link to this type t() View Source
t() :: %MailAddress.Options{
  allow_address_literal: boolean(),
  allow_localhost: boolean(),
  allow_null: boolean(),
  allow_null_local_part: boolean(),
  downcase_domain: boolean(),
  max_address_length: pos_integer(),
  max_domain_length: pos_integer(),
  max_local_part_length: pos_integer(),
  require_brackets: boolean(),
  require_domain: boolean()
}

The MailAddress.Options struct.

Link to this section Functions

Link to this function %MailAddress.Options{} View Source (struct)

Holds the configuration options for handling addresses.

  • :allow_address_literal - if true, allows domain part to be an address literal. Defaults to false.

  • :allow_localhost - if true, allows domain part to be “localhost” or the equivalent address literal ([127.0.0.1] or [IPv6:::1]). Defaults to false.

  • :allow_null - if true allows address to be null. Defaults to false.

  • :allow_null_local_part - if true allows address to have an empty local part. Defaults to false.

  • :downcase_domain - if true downcases domain automatically. Defaults to false.

  • :max_address_length - the maximum total length in characters. Defaults to 256 (from RFC5321).

  • :max_domain_length - the maximum domain length in characters. Defaults to 255 (from RFC5321).

  • :max_local_part_length - the maximum local part length in characters. Defaults to 64 (from RFC5321).

  • :require_brackets - if true, insists that address must be surrounded by angle brackets ‘<’ and ‘>’. If false the brackets are optional and any parsing will stop when either the end of string, or a space after the last valid domain character is reached. Defaults to false.

  • :require_domain - if true then the address must have a domain component unless it is a null address. Defaults to true.

Returns relaxed parsing options.