View Source smtp_util (gen_smtp v1.2.0)

Module with some general utility functions for SMTP.

Link to this section 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.

Link to this section Types

Specs

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

Link to this section Functions

Link to this function

combine_rfc822_addresses(Addresses)

View Source
Link to this function

compute_cram_digest(Key, Data)

View Source

Specs

compute_cram_digest(Key :: binary(), Data :: binary()) -> binary().
Compute the CRAM digest of Key and Data
Link to this function

generate_message_boundary()

View Source
Generate a unique MIME message boundary
Generate a unique message ID
Link to this function

get_cram_string(Hostname)

View Source

Specs

get_cram_string(Hostname :: string()) -> string().
Generate a seed string for CRAM.

Specs

guess_FQDN() -> string().
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
Link to this function

parse_rfc5322_addresses(B)

View Source

Specs

parse_rfc5322_addresses(string() | binary()) -> {ok, [name_address()]} | {error, any()}.
Parse list of mail addresses in RFC-5322#section-3.4 mailbox-list format
Link to this function

parse_rfc822_addresses(B)

View Source

Specs

parse_rfc822_addresses(string() | binary()) -> {ok, [name_address()]} | {error, any()}.
Generate a RFC 5322 timestamp based on the current time

Specs

trim_crlf(String :: string()) -> string().
Trim \r\n from String
Calculate the current timezone and format it like -0400. Borrowed from YAWS.