smtp_util (gen_smtp v1.3.1-1)

View Source

Module with some general utility functions for SMTP.

Summary

Functions

Compute the CRAM digest of Key and Data

Generate a unique MIME message boundary

Generate a unique message ID

Generate a seed string for CRAM.

guess the current host's fully qualified domain name, on error return "localhost"

returns a sorted list of mx servers for Domain, lowest distance first

Parse list of mail addresses in RFC-5322#section-3.4 mailbox-list format

Generate a RFC 5322 timestamp based on the current time

Trim \r\n from String

Calculate the current timezone and format it like -0400. Borrowed from YAWS.

Types

name_address/0

-type name_address() :: {Name :: string() | undefined, Address :: string()}.

Functions

combine_rfc822_addresses(Addresses)

compute_cram_digest(Key, Data)

-spec compute_cram_digest(Key :: binary(), Data :: binary()) -> binary().

Compute the CRAM digest of Key and Data

generate_message_boundary()

Generate a unique MIME message boundary

generate_message_id()

Generate a unique message ID

get_cram_string(Hostname)

-spec get_cram_string(Hostname :: string()) -> string().

Generate a seed string for CRAM.

guess_FQDN()

-spec guess_FQDN() -> string().

guess the current host's fully qualified domain name, on error return "localhost"

mxlookup(Domain)

returns a sorted list of mx servers for Domain, lowest distance first

parse_rfc822_addresses(B)

-spec parse_rfc822_addresses(string() | binary()) -> {ok, [name_address()]} | {error, any()}.

parse_rfc5322_addresses(B)

-spec parse_rfc5322_addresses(string() | binary()) -> {ok, [name_address()]} | {error, any()}.

Parse list of mail addresses in RFC-5322#section-3.4 mailbox-list format

rfc5322_timestamp()

Generate a RFC 5322 timestamp based on the current time

trim_crlf(String)

-spec trim_crlf(String :: string()) -> string().

Trim \r\n from String

zone()

Calculate the current timezone and format it like -0400. Borrowed from YAWS.