View Source Pop3mail.EpopDownloader (pop3mail v1.5.0)

Retrieve and parse POP3 mail via the Epop client.

Summary

Types

Epop client from erlpop

Functions

Read all emails and save them to disk.

Read all emails and save them to disk.

Types

@type epop_client_type() :: :epop_client.connection()

Epop client from erlpop

Functions

@spec download(Pop3mail.EpopDownloader.Options.t()) ::
  {:ok, integer()} | {:error, atom()}

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
@spec parse_process_and_store(
  String.t(),
  integer(),
  boolean() | nil,
  boolean(),
  String.t()
) ::
  {atom(), String.t()}
  | [{:ok, String.t()} | {:error, atom(), String.t()}]
  | {:skip, [{:header, 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
@spec retrieve_and_store(
  epop_client_type(),
  integer(),
  Pop3mail.EpopDownloader.Options.t()
) ::
  {atom(), String.t()}
  | [{:ok, String.t()} | {:error, atom(), String.t()}]
  | {:skip, [{:header, 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
@spec retrieve_and_store_all(epop_client_type(), 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