client-common.h revision a75907609d7c410c9e17beedfafbf28b4439fa8a
b72c3363092b73cab1da2de4a9d75592e7d8fd6bTimo Sirainen/* max. size of input buffer. this means:
7384b4e78eaab44693c985192276e31322155e32Stephan Bosch IMAP: Max. length of a single parameter
7384b4e78eaab44693c985192276e31322155e32Stephan Bosch POP3: Max. length of a command line (spec says 512 would be enough)
7384b4e78eaab44693c985192276e31322155e32Stephan Bosch/* max. size of output buffer. if it gets full, the client is disconnected.
7384b4e78eaab44693c985192276e31322155e32Stephan Bosch SASL authentication gives the largest output. */
7384b4e78eaab44693c985192276e31322155e32Stephan Bosch/* Disconnect client after idling this many milliseconds */
7384b4e78eaab44693c985192276e31322155e32Stephan Bosch#define CLIENT_LOGIN_IDLE_TIMEOUT_MSECS (3*60*1000)
7384b4e78eaab44693c985192276e31322155e32Stephan Bosch "Waiting for authentication process to respond.."
7384b4e78eaab44693c985192276e31322155e32Stephan Bosch "Waiting for authentication master process to respond.."
feba5e502b2131c9a1c766b7ef9ff041dbf71d1dStephan Bosch /* for proxying */
7ebcb054e0d3cc4be54038cbf763ec4189d9725bStephan Bosch unsigned int port;
7384b4e78eaab44693c985192276e31322155e32Stephan Bosch void (*send_line)(struct client *client, enum client_cmd_reply reply,
7384b4e78eaab44693c985192276e31322155e32Stephan Bosch const char *text);
6dad0888fcec8372f230941c70d8940b8c203b32Stephan Bosch bool (*auth_handle_reply)(struct client *client,
6a90041707f1290c8970a3bacb0f8f928aeaaba6Stephan Bosch void (*auth_send_challenge)(struct client *client, const char *data);
7384b4e78eaab44693c985192276e31322155e32Stephan Bosch int (*auth_parse_response)(struct client *client);
7384b4e78eaab44693c985192276e31322155e32Stephan Bosch int (*proxy_parse_line)(struct client *client, const char *line);
7384b4e78eaab44693c985192276e31322155e32Stephan Bosch struct timeout *to_authfail_delay, *to_auth_waiting;
b72c3363092b73cab1da2de4a9d75592e7d8fd6bTimo Sirainen char *proxy_user, *proxy_master_user, *proxy_password;
d08e49550aa890e71a5f10b7de43347ec44473acTimo Sirainenstruct client *client_create(int fd, bool ssl, pool_t pool,
d08e49550aa890e71a5f10b7de43347ec44473acTimo Sirainenvoid client_destroy(struct client *client, const char *reason);
d08e49550aa890e71a5f10b7de43347ec44473acTimo Sirainenvoid client_destroy_success(struct client *client, const char *reason);
d08e49550aa890e71a5f10b7de43347ec44473acTimo Sirainenvoid client_destroy_internal_failure(struct client *client);
7384b4e78eaab44693c985192276e31322155e32Stephan Boschvoid client_cmd_starttls(struct client *client);
208dcaf62332b80b220c8c66e776f7cc0c39253bStephan Boschunsigned int clients_get_count(void) ATTR_PURE;
7384b4e78eaab44693c985192276e31322155e32Stephan Boschvoid client_log(struct client *client, const char *msg);
7384b4e78eaab44693c985192276e31322155e32Stephan Boschvoid client_log_err(struct client *client, const char *msg);
6ee9ce5ed955a1283dc22ad28980bf9cc23d4c4eStephan Boschconst char *client_get_extra_disconnect_reason(struct client *client);
6ee9ce5ed955a1283dc22ad28980bf9cc23d4c4eStephan Boschvoid client_auth_failed(struct client *client, bool nodelay);
208dcaf62332b80b220c8c66e776f7cc0c39253bStephan Boschvoid client_send_line(struct client *client, enum client_cmd_reply reply,
208dcaf62332b80b220c8c66e776f7cc0c39253bStephan Bosch const char *text);
208dcaf62332b80b220c8c66e776f7cc0c39253bStephan Boschvoid client_send_raw_data(struct client *client, const void *data, size_t size);
208dcaf62332b80b220c8c66e776f7cc0c39253bStephan Boschvoid client_send_raw(struct client *client, const char *data);
208dcaf62332b80b220c8c66e776f7cc0c39253bStephan Boschvoid client_set_auth_waiting(struct client *client);
d08e49550aa890e71a5f10b7de43347ec44473acTimo Sirainenvoid client_auth_send_challenge(struct client *client, const char *data);
d08e49550aa890e71a5f10b7de43347ec44473acTimo Sirainenint client_auth_parse_response(struct client *client);
d08e49550aa890e71a5f10b7de43347ec44473acTimo Sirainenint client_auth_begin(struct client *client, const char *mech_name,
208dcaf62332b80b220c8c66e776f7cc0c39253bStephan Boschbool client_check_plaintext_auth(struct client *client, bool pass_sent);
208dcaf62332b80b220c8c66e776f7cc0c39253bStephan Boschvoid client_proxy_finish_destroy_client(struct client *client);
208dcaf62332b80b220c8c66e776f7cc0c39253bStephan Boschvoid client_proxy_log_failure(struct client *client, const char *line);
208dcaf62332b80b220c8c66e776f7cc0c39253bStephan Boschvoid client_proxy_failed(struct client *client, bool send_line);