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