IMAP
Types
EasyCurl.IMAPResponse
— TypeIMAPResponse <: CurlResponse
An IMAP response object returned on a request completion.
Fields
Name | Description | Accessors (get ) |
---|---|---|
total_time::Float64 | Total time spent receiving a response in seconds. | imap_total_time(x) , curl_total_time(x) |
body::Vector{UInt8} | The response body as a vector of bytes. | imap_body(x) , curl_body(x) |
EasyCurl.IMAPOptions
— TypeIMAPOptions <: CurlOptions
Represents options for configuring an IMAP request.
Fields
Name | Description | Default |
---|---|---|
read_timeout::Real | Timeout in seconds for reading the response. | 30 |
connect_timeout::Real | Maximum time in seconds that you allow the connection phase to take. | 10 |
ssl_verifyhost::Bool | Enables SSL certificate's host verification. | true |
ssl_verifypeer::Bool | Enables the SSL certificate verification. | true |
verbose::Bool | Enables detailed output from Curl (useful for debugging). | false |
proxy::Union{String,Nothing} | Proxy server URL, or nothing to bypass proxy settings. | nothing |
interface::Union{String,Nothing} | Specifies a particular network interface to use for the request, or nothing to use the default. | nothing |
Methods
EasyCurl.imap_request
— Functionimap_request(url::String, username::String, password::String; kw...) -> IMAPResponse
Send a url
IMAP request using username
and password
, then return a IMAPResponse
object.
Keyword arguments
Name | Description | Default |
---|---|---|
mailbox::Union{Nothing,String} | Required mailbox. | nothing |
command | Available IMAP commands after authentication. | nothing |
path::Union{Nothing,String} | The specific path or criteria of the query. | nothing |
retry::Int64 | Number of retries. | 0 |
retry_delay::Real | Delay after failed request. | 0.25 |
options... | Another IMAP request options. |
Examples
julia> response = imap_request(
"imaps://imap.gmail.com:993",
"your_imap_username",
"your_imap_password",
mailbox = "INBOX",
command = "SEARCH SINCE 09-Sep-2024",
);
julia> imap_body(response) |> String |> print
* SEARCH 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410