client-common-auth.c revision 86bca14f79caeff0830abd2315d8a0e5db4b979b
5394bed8aaef2a6c1c870a34a23a7824e1f370bbStephan Bosch/* Copyright (c) 2002-2017 Dovecot authors, see the included COPYING file */
5394bed8aaef2a6c1c870a34a23a7824e1f370bbStephan Bosch#define PROXY_FAILURE_MSG "Account is temporarily unavailable."
5394bed8aaef2a6c1c870a34a23a7824e1f370bbStephan Bosch/* If we've been waiting auth server to respond for over this many milliseconds,
5394bed8aaef2a6c1c870a34a23a7824e1f370bbStephan Bosch send a "waiting" message. */
5394bed8aaef2a6c1c870a34a23a7824e1f370bbStephan Bosch#define AUTH_WAITING_WARNING_TIMEOUT_MSECS (10*1000)
0dffa25d211be541ee3c953b23566a1a990789dfTimo Sirainen const char *id;
5394bed8aaef2a6c1c870a34a23a7824e1f370bbStephan Boschstatic const struct client_auth_fail_code_id client_auth_fail_codes[] = {
e641c9f656f1788ca6226ef0d60b2d592e2ca6d1Stephan Boschclient_auth_fail_code_lookup(const char *fail_code)
d82ad7143c057c565e1fd5f3580645556ed0bcc9Stephan Bosch const struct client_auth_fail_code_id *fail = client_auth_fail_codes;
92c2272787b74eb000f05a926e9103a25a6a0dc0Stephan Boschstatic void client_auth_failed(struct client *client)
d82ad7143c057c565e1fd5f3580645556ed0bcc9Stephan Bosch if (client->auth_initializing || client->destroyed)
5394bed8aaef2a6c1c870a34a23a7824e1f370bbStephan Bosch client->io = io_add(client->fd, IO_READ, client_input, client);
069def4dc35022852d569b7ab75a3b19d2cb0f1cTimo Sirainenstatic void client_auth_waiting_timeout(struct client *client)
c911297407bdcc7c7936305eb8f791b450d6375cTimo Sirainen client_log_warn(client, "Auth process not responding, "
c911297407bdcc7c7936305eb8f791b450d6375cTimo Sirainen "delayed sending initial response (greeting)");
char *const *fields;
unsigned int i, count;
for (i = 0; i < count; i++) {
if (i == count) {
const char *const *args,
if (p == NULL) {
/* already handled in sasl-server.c */
if (success) {
const char **alt;
if (send_line) {
const char *line;
unsigned int duration;
} else if (login_source_ips_count > 0) {
if (!success)
return FALSE;
return TRUE;
const char *reason;
return TRUE;
return FALSE;
return TRUE;
const unsigned char *data;
for (i = 0; i < size; i++) {
switch (sasl_reply) {
data);
const char *init_resp)
!ssl_required))
return TRUE;
if (pass_sent) {
if (ssl_required) {
return FALSE;
void clients_notify_auth_connected(void)