Plover.Types (plover v0.6.0)

Copy Markdown View Source

Shared type definitions for the Plover IMAP client.

Summary

Types

A connection process identifier.

A FETCH data item to request.

A message flag atom (e.g., :seen, :flagged, :deleted).

An IMAP mailbox name.

A response code from a server status response (RFC 9051 §7.1).

A sequence number: a positive integer or :star (representing *).

A parsed sequence set as a list of {from, to} range tuples.

A STATUS attribute to query on a mailbox.

How flags are applied in a STORE command.

Whether the STORE command should suppress untagged FETCH responses.

An untagged server response passed to the :on_unsolicited_response callback.

Types

conn()

@type conn() :: GenServer.server()

A connection process identifier.

fetch_attr()

@type fetch_attr() ::
  :envelope
  | :flags
  | :uid
  | :body_structure
  | :internal_date
  | :rfc822_size
  | {:body, String.t()}
  | {:body_peek, String.t()}

A FETCH data item to request.

Atoms request standard attributes. Tuple forms request body content:

  • {:body, section} - fetches the section and sets the \Seen flag
  • {:body_peek, section} - fetches the section without setting \Seen

flag()

@type flag() :: atom()

A message flag atom (e.g., :seen, :flagged, :deleted).

mailbox_name()

@type mailbox_name() :: String.t()

An IMAP mailbox name.

response_code()

@type response_code() ::
  nil
  | Plover.Response.Capability.t()
  | {:permanent_flags, [flag()]}
  | {:uid_next, pos_integer()}
  | {:uid_validity, pos_integer()}
  | {:append_uid, {pos_integer(), pos_integer()}}
  | {:copy_uid, {pos_integer(), String.t(), String.t()}}
  | {atom(), nil | String.t()}

A response code from a server status response (RFC 9051 §7.1).

Data codes carry a typed value. No-data codes are {name, nil} tuples — common names include :alert, :parse, :read_only, :read_write, :try_create, :closed, :authentication_failed, :expired, :contact_admin, :no_perm, :in_use, :over_quota, :nonexistent, and others from RFC 9051 §7.1. Unrecognized codes from extensions are {atom(), nil | String.t()}.

seq_number()

@type seq_number() :: pos_integer() | :star

A sequence number: a positive integer or :star (representing *).

sequence_set()

@type sequence_set() :: [{seq_number(), seq_number()}]

A parsed sequence set as a list of {from, to} range tuples.

status_attr()

@type status_attr() :: :messages | :recent | :unseen | :uid_next | :uid_validity

A STATUS attribute to query on a mailbox.

store_action()

@type store_action() :: :set | :add | :remove

How flags are applied in a STORE command.

store_silent()

@type store_silent() :: boolean()

Whether the STORE command should suppress untagged FETCH responses.

untagged_response()

An untagged server response passed to the :on_unsolicited_response callback.