Blop.Client (Blop v0.1.4)
View SourceBlop Client
It's supposed to be used in a GenServer. It starts a linked Agent to hold to the client state.
client = Client.new host: "imap.my.provider.com" Client.login(client, "my@provider.com", "my-unique-password") Client.list(client) Client.select(client, "INBOX") Client.fetch(client, "1:5")
Summary
Functions
Perform a EXAMINE command on a mailbox. Sets the currently selected mailbox in the client state.
Execute an IMAP command with the client.
Perform a FETCH command on the server to get a list of messages.
Return the client state.
Perform a LIST command on the server to get a list of mailboxes.
Log the client in to the server with the given username and password.
Create a new IMAP client.
Perform a SELECT command on a mailbox. Sets the currently selected mailbox in the client state.
Functions
Perform a EXAMINE command on a mailbox. Sets the currently selected mailbox in the client state.
Execute an IMAP command with the client.
@spec fetch(pid(), sequence_set :: String.t()) :: [Mail.Message.t()]
Perform a FETCH command on the server to get a list of messages.
@spec fetch(pid(), sequence_set :: String.t(), md_items_or_macro :: String.t()) :: [ Mail.Message.t() ]
Return the client state.
Perform a LIST command on the server to get a list of mailboxes.
Log the client in to the server with the given username and password.
Create a new IMAP client.
Accepted options:
:host
- The hostname of the IMAP server. (required):port
- The port of the IMAP server. Default is 993.:socket_module
- The socket module to use. Default is:ssl
.:login
- A tuple with the username and password. This will be used to log in automatically after the client is created. Users can also callClient.login/3
manually.
Connection options:
For example when using :ssl
:ssl
- A list of options to pass to:ssl.connect/4
. Default is[:binary, active: false, cacertfile: CAStore.file_path()]
.
Perform a SELECT command on a mailbox. Sets the currently selected mailbox in the client state.