View Source Pop3mail.Header (pop3mail v1.5.0)

Email header related functions.

Summary

Functions

Lookup value by header name. Returns a string.

Store email headers Date,From,To,Cc and Subject in a text file.

Functions

Link to this function

lookup(header_list, header_name, take \\ nil)

View Source
@spec lookup([{:header, String.t(), String.t()}], String.t(), integer() | nil) ::
  String.t()

Lookup value by header name. Returns a string.

If the searched header name occurs multiple times in the list, the result will be the concatenated comma separated value.

header_list - list with tuples {:header, header name, value} take - Optional parameter to specify maximum number of headers. Negative number takes last header values.

Link to this function

store(header_list, filename_prefix, filename_addition, dirname)

View Source
@spec store([{:header, String.t(), String.t()}], String.t(), String.t(), String.t()) ::
  {:ok, String.t()} | {:error, atom(), String.t()}

Store email headers Date,From,To,Cc and Subject in a text file.

filename is filename_prefix . unsafe_addition . txt

  • header_list - list with tuples {:header, header name, value}
  • unsafe_addition - append this to the filename if the filesystem allows it.