client-common-auth.c revision e2a88d59c0d47d63ce1ad5b1fd95e487124a3fd4
f8c829e72968b574e1c9bda96f4d5f206622358fPavel Březina/* Copyright (c) 2002-2012 Dovecot authors, see the included COPYING file */
f8c829e72968b574e1c9bda96f4d5f206622358fPavel Březina#define PROXY_FAILURE_MSG "Account is temporarily unavailable."
f8c829e72968b574e1c9bda96f4d5f206622358fPavel Březina/* If we've been waiting auth server to respond for over this many milliseconds,
f8c829e72968b574e1c9bda96f4d5f206622358fPavel Březina send a "waiting" message. */
f8c829e72968b574e1c9bda96f4d5f206622358fPavel Březina#define AUTH_WAITING_WARNING_TIMEOUT_MSECS (10*1000)
f8c829e72968b574e1c9bda96f4d5f206622358fPavel Březinastatic void client_auth_failed(struct client *client)
f8c829e72968b574e1c9bda96f4d5f206622358fPavel Březina if (client->auth_initializing || client->destroyed)
f8c829e72968b574e1c9bda96f4d5f206622358fPavel Březina client->io = io_add(client->fd, IO_READ, client_input, client);
f8c829e72968b574e1c9bda96f4d5f206622358fPavel Březinastatic void client_auth_waiting_timeout(struct client *client)
968e2bc3bb28458b25c3b19868ea50f0325d8b0aPavel Březina client_log_warn(client, "Auth process not responding, "
46d3d2c731e8c7e138462e5b60a39a279dc77d81Pavel Březina "delayed sending initial response (greeting)");
46d3d2c731e8c7e138462e5b60a39a279dc77d81Pavel Březina client_notify_status(client, FALSE, client->master_tag == 0 ?
46d3d2c731e8c7e138462e5b60a39a279dc77d81Pavel Březina AUTH_SERVER_WAITING_MSG : AUTH_MASTER_WAITING_MSG);
46d3d2c731e8c7e138462e5b60a39a279dc77d81Pavel Březinavoid client_set_auth_waiting(struct client *client)
46d3d2c731e8c7e138462e5b60a39a279dc77d81Pavel Březinastatic void client_auth_parse_args(struct client *client,
e6092759dc4268b105b79478aa9b1398f21ed7a9Pavel Březina const char *const *args,
f8c829e72968b574e1c9bda96f4d5f206622358fPavel Březina reply_r->proxy_timeout_msecs = 1000*atoi(value);
46d3d2c731e8c7e138462e5b60a39a279dc77d81Pavel Březina reply_r->ssl_flags |= PROXY_SSL_FLAG_ANY_CERT;
f8c829e72968b574e1c9bda96f4d5f206622358fPavel Březina reply_r->port = login_binary->default_ssl_port;
968e2bc3bb28458b25c3b19868ea50f0325d8b0aPavel Březina reply_r->ssl_flags |= PROXY_SSL_FLAG_ANY_CERT;
f8c829e72968b574e1c9bda96f4d5f206622358fPavel Březina /* already handled in login-common */
f8c829e72968b574e1c9bda96f4d5f206622358fPavel Březina i_debug("Ignoring unknown passdb extra field: %s", key);
f8c829e72968b574e1c9bda96f4d5f206622358fPavel Březinastatic void proxy_free_password(struct client *client)
f8c829e72968b574e1c9bda96f4d5f206622358fPavel Březina safe_memset(client->proxy_password, 0, strlen(client->proxy_password));
if (send_line) {
const char *line;
unsigned int duration;
if (!success)
return FALSE;
return TRUE;
const char *reason;
return TRUE;
return FALSE;
return TRUE;
const unsigned char *data;
unsigned int len;
for (i = 0; i < size; i++) {
return i < size;
switch (sasl_reply) {
const char *init_resp)
return TRUE;
if (pass_sent) {
return FALSE;
void clients_notify_auth_connected(void)