#ifndef IMAPC_CLIENT_H
#define IMAPC_CLIENT_H
#include "net.h"
/* IMAP RFC defines this to be at least 30 minutes. */
enum imapc_command_state {
/* Authentication to IMAP server failed (NO or BAD) */
/* Client was unexpectedly disconnected. */
};
extern const char *imapc_command_state_names[];
enum imapc_capability {
};
struct imapc_capability_name {
const char *name;
};
extern const struct imapc_capability_name imapc_capability_names[];
enum imapc_command_flags {
/* The command changes the selected mailbox (SELECT, EXAMINE) */
/* The command is sent to server before login (or is the login
command itself). Non-prelogin commands will be queued until login
is successful. */
/* Allow command to be automatically retried if disconnected before it
finishes. */
/* This is the LOGOUT command. Use a small timeout for it. */
/* Command is being resent after a reconnection. */
};
enum imapc_client_ssl_mode {
};
struct imapc_throttling_settings {
unsigned int init_msecs;
unsigned int max_msecs;
unsigned int shrink_min_msecs;
};
struct imapc_client_settings {
const char *host;
const char *master_user;
const char *username;
const char *password;
/* Space-separated list of SASL mechanisms to try (in the specified
order). The default is to use only LOGIN command or SASL PLAIN. */
const char *sasl_mechanisms;
unsigned int max_idle_time;
/* If ID capability is advertised, send a unique "x-session-ext-id",
which begins with this prefix. */
const char *session_id_prefix;
const char *dns_client_socket_path;
const char *temp_path_prefix;
bool ssl_verify;
const char *rawlog_dir;
const char *ssl_crypto_device;
bool debug;
/* Timeout for logging in. 0 = default. */
unsigned int connect_timeout_msecs;
/* Number of retries, -1 = infinity */
unsigned int connect_retry_count;
/* Interval between retries, must be > 0 if retries > 0 */
unsigned int connect_retry_interval_msecs;
/* Timeout for IMAP commands. Reset every time more data is being
sent or received. 0 = default. */
unsigned int cmd_timeout_msecs;
/* Maximum allowed line length (not including literals read as
streams). 0 = unlimited. */
};
struct imapc_command_reply {
/* "[RESP TEXT]" produces key=RESP, value=TEXT.
"[RESP]" produces key=RESP, value=NULL
otherwise both are NULL */
/* The full tagged reply, including [RESP TEXT]. */
const char *text_full;
/* Tagged reply text without [RESP TEXT] */
const char *text_without_resp;
};
struct imapc_arg_file {
/* file descriptor containing the value */
int fd;
/* parent_arg.list[list_idx] points to the IMAP_ARG_LITERAL_SIZE
argument */
unsigned int list_idx;
};
struct imapc_untagged_reply {
/* name of the untagged reply, e.g. EXISTS */
const char *name;
/* number at the beginning of the reply, or 0 if there wasn't any.
Set for EXISTS, EXPUNGE, etc. */
/* the rest of the reply can be read from these args. */
/* arguments whose contents are stored into files. only
"FETCH (BODY[" arguments can be here. */
unsigned int file_args_count;
/* "* OK [RESP TEXT]" produces key=RESP, value=TEXT.
"* OK [RESP]" produces key=RESP, value=NULL
otherwise both are NULL */
/* If this reply occurred while a mailbox was selected, this contains
the mailbox's untagged_context. */
void *untagged_box_context;
};
enum imapc_state_change_event {
};
/* Called when tagged reply is received for command. */
void *context);
/* Called each time untagged input is received. */
void *context);
const char *error);
struct imapc_client *
/* Set login callback, must be set before calling other commands.
This is called only for the first login, not for any reconnects or if there
are multiple connections created. */
void
/* Explicitly login to server (also done automatically). */
/* Send a LOGOUT and wait for disconnection. */
struct imapc_command *
enum imapc_command_flags flags);
void *context);
struct imapc_client_mailbox *
void *untagged_box_context);
void *context);
const char *errmsg);
struct imapc_command *
struct imapc_msgmap *
enum imapc_capability *capabilities_r);
const char **path_r);
void *context);
#endif