Namespace: joker.pop3
v1.0Contents
Summary
Retrieves raw email messages from POP3 mailboxes using explicit client sessions.
Index
Constants
Constants are variables with :const true in their metadata. Joker currently does not recognize them as special; as such, it allows redefining them or their values.-
(None.)
Variables
-
(None.)
Functions, Macros, and Special Forms
-
capabilities
Function v1.8(capabilities client)(capabilities ^POP3Client client)Returns the server CAPA response as a map of capability strings to vectors
show types
of argument strings.
For example, a response containing UIDL and SASL PLAIN becomes
{"UIDL" [] "SASL" ["PLAIN"]}. Throws Error when CAPA is unsupported or
the session cannot complete the operation. -
close
Function v1.8(close client)(close ^POP3Client client)Closes client without sending QUIT and returns nil.
show types
Use close to abandon a session without committing deletion marks. close is
idempotent; the POP3Client is unusable afterward. -
connect
Function v1.8(connect opts)(connect ^Map opts)Connects to a POP3 server, authenticates, and returns a POP3Client session.
show types
opts is a map with the following keys:
- addr (string, required): server address, such as "pop.example.com:995".
- username (string, required): USER authentication value.
- password (string, required): PASS authentication value.
- tls (keyword, string, or symbol, optional): :implicit (default),
:starttls, or :none.
- server-name (string, optional): TLS certificate hostname override. By
default the host portion of :addr is used.
- timeout-ms (int, optional): positive timeout applied separately to
connecting, TLS negotiation, authentication, and each later operation.
If omitted, operations have no configured timeout.
:implicit establishes TLS before reading the POP3 greeting. :starttls reads
the greeting, issues STLS, and then establishes TLS before authentication.
:none sends credentials on an unencrypted connection and must be selected
explicitly.
Authentication uses USER and PASS. connect throws Error on configuration,
network, TLS, protocol, or authentication failure.
Example:
(def client
(joker.pop3/connect {:addr "pop.example.com:995"
:tls :implicit
:username "user@example.com"
:password "secret"
:timeout-ms 30000})) -
delete
Function v1.8(delete client number)(delete ^POP3Client client ^Int number)Marks message number for deletion and returns nil.
show types
POP3 applies marked deletions only after a successful quit. Use reset to
clear deletion marks or close to abort a session without issuing QUIT. -
list
Function v1.8(list client)(list ^POP3Client client)(list client number)(list ^POP3Client client ^Int number)Returns POP3 message size information.
show types
With one argument, returns a vector of {:number n :octets size} maps for all
available messages. With number, returns the size map for that message.
Throws Error when the server rejects the request or responds incorrectly. -
noop
Function v1.8(noop client)(noop ^POP3Client client)Sends POP3 NOOP to keep a session active or check connectivity and returns
show types
nil. -
quit
Function v1.8(quit client)(quit ^POP3Client client)Sends QUIT, commits server-side deletions marked in this session, closes the
show types
connection, and returns nil.
The POP3Client is unusable after quit, including when QUIT fails. -
reset
Function v1.8(reset client)(reset ^POP3Client client)Clears any deletion marks in the current session and returns nil.
show types -
retrieve
Function v1.8(retrieve client number)(retrieve ^POP3Client client ^Int number)Retrieves the complete raw RFC 5322 message for message number.
show types
Returns the message as a string with POP3 dot-stuffing removed and CRLF line
endings preserved. The complete message is buffered in memory. This function
does not parse MIME content or headers. -
stat
Function v1.8(stat client)(stat ^POP3Client client)Returns mailbox statistics as {:count n :octets size}.
show types
:count is the number of messages in the mailbox and :octets is their
combined reported size. -
top
Function v1.8(top client number lines)(top ^POP3Client client ^Int number ^Int lines)Retrieves message headers and up to lines body lines for message number.
show types
TOP is an optional POP3 command; unsupported servers cause Error. The
returned raw message fragment has POP3 dot-stuffing removed and CRLF line
endings preserved. lines must be non-negative. -
uidl
Function v1.8(uidl client)(uidl ^POP3Client client)(uidl client number)(uidl ^POP3Client client ^Int number)Returns POP3 unique identifiers.
show types
With one argument, returns a vector of {:number n :uid id} maps for all
available messages. With number, returns the identifier map for that
message. UIDL is an optional POP3 command; unsupported servers cause Error.