The parameters of the SMTP DSN extension (RFC 3461 §4): NOTIFY and
ORCPT on RCPT, RET and ENVID on MAIL.
iex> Sovite.SMTP.DSNParams.parse_notify("SUCCESS,FAILURE")
{:ok, [:success, :failure]}
iex> Sovite.SMTP.DSNParams.parse_orcpt("rfc822;bob+2Bwork@example.com")
{:ok, {"rfc822", "bob+work@example.com"}}
iex> Sovite.SMTP.DSNParams.encode_orcpt({"rfc822", "bob+work@example.com"})
"rfc822;bob+2Bwork@example.com"ENVID and the address in ORCPT are xtext (Sovite.SMTP.XText).
For internationalized addresses ORCPT has the utf-8 address type
(RFC 6533 §3), where characters are escaped as \x{HEX} instead:
utf-8;j\x{FC}rgen@example.com. With SMTPUTF8 the non-ASCII
characters may also be sent as they are.
Decoded values never contain control characters.
Summary
Types
NOTIFY: :never, or when to send a notification. Without NOTIFY, a
server sends failure and (at its choice) delay notifications.
ORCPT: the address type, lower-cased ("rfc822", "utf-8", ...), and
the decoded address, as the first client gave it.
RET: return the whole message in a failure notification, or only its headers.
Functions
Encodes an ENVID value.
Encodes a NOTIFY value.
Encodes an ORCPT value. A utf-8 address keeps its non-ASCII
characters with smtputf8: true, and is escaped otherwise.
Encodes a RET value.
The ORCPT for an address: rfc822 for an ASCII one, utf-8 for an
internationalized one.
Parses an ENVID value, at most 100 characters of xtext.
Parses a NOTIFY value: NEVER, or a comma-separated list.
Parses an ORCPT value. Non-ASCII characters in a utf-8 address are
accepted only with utf8: true, in a transaction with SMTPUTF8.
Parses a RET value.
Types
@type notify() :: :never | [:success | :failure | :delay, ...]
NOTIFY: :never, or when to send a notification. Without NOTIFY, a
server sends failure and (at its choice) delay notifications.
ORCPT: the address type, lower-cased ("rfc822", "utf-8", ...), and
the decoded address, as the first client gave it.
@type ret() :: :full | :hdrs
RET: return the whole message in a failure notification, or only its headers.
Functions
Encodes an ENVID value.
Encodes a NOTIFY value.
Encodes an ORCPT value. A utf-8 address keeps its non-ASCII
characters with smtputf8: true, and is escaped otherwise.
Encodes a RET value.
The ORCPT for an address: rfc822 for an ASCII one, utf-8 for an
internationalized one.
Parses an ENVID value, at most 100 characters of xtext.
Parses a NOTIFY value: NEVER, or a comma-separated list.
Parses an ORCPT value. Non-ASCII characters in a utf-8 address are
accepted only with utf8: true, in a transaction with SMTPUTF8.
Parses a RET value.