pop3mail v1.3.1 Pop3mail.EpopDownloader View Source

Retrieve and parse POP3 mail via the Epop client.

Link to this section Summary

Types

Epop client from erlpop

Functions

Read all emails and save them to disk

Read all emails and save them to disk

Link to this section Types

Link to this type epop_client() View Source
epop_client() ::
  {:sk, any(), any(), any(), any(), any(), any(), boolean()}

Epop client from erlpop

Link to this section Functions

Link to this function download(options) View Source
download(Pop3mail.EpopDownloader.Options.t()) ::
  {:ok, integer()} | {:error, String.t()}

Read all emails and save them to disk.

options - EpopDownloader.Options

Link to this function parse_process_and_store(mail_content, mail_loop_counter, delivered, save_raw, output_dir) View Source
parse_process_and_store(String.t(), integer(), boolean(), boolean(), String.t()) ::
  {:skip, [{:header, String.t(), String.t()}]}
  | {atom(), String.t()}
  | {:error, String.t(), String.t()}

Parse headers, decode body and store everything.

  • mail_content - string with the complete raw email message.
  • mail_loop_count - number of the email in the current session.
  • delivered - true/false/nil. Presence, absence or don’t care of the ‘Delivered-To’ email header.
  • save_raw - true/false. Save or don’t save the raw email message.
  • output_dir - directory where all emails are stored.
Link to this function retrieve_and_store(epop_client, mail_loop_counter, options) View Source
retrieve_and_store(
  epop_client(),
  integer(),
  Pop3mail.EpopDownloader.Options.t()
) ::
  {:ok, integer()}
  | {:skip, [{:header, String.t(), String.t()}]}
  | {atom(), String.t()}
  | {:error, String.t(), String.t()}

Retrieve, parse and store an email.

  • epop_client - client returned by :epop_client.connect function.
  • mail_loop_counter - number of the email in the current session.
  • options - EpopDownloader.Options
Link to this function retrieve_and_store_all(epop_client, options) View Source
retrieve_and_store_all(epop_client(), Pop3mail.EpopDownloader.Options.t()) ::
  {:ok, integer()}

Read all emails and save them to disk.

  • epop_client - client returned by :epop_client.connect function.
  • options - EpopDownloader.Options