client-authenticate.c revision e248fe370c4047cee921a91b48edc37944ab0526
/* Copyright (c) 2002-2009 Dovecot authors, see the included COPYING file */
#include "common.h"
#include "base64.h"
#include "buffer.h"
#include "ioloop.h"
#include "istream.h"
#include "ostream.h"
#include "safe-memset.h"
#include "str.h"
#include "str-sanitize.h"
#include "imap-resp-code.h"
#include "imap-parser.h"
#include "auth-client.h"
#include "client.h"
#include "client-authenticate.h"
#include "imap-proxy.h"
#include <stdlib.h>
{
const struct auth_mech_desc *mech;
unsigned int i, count;
for (i = 0; i < count; i++) {
}
}
const struct client_auth_reply *reply)
{
/* IMAP referral
[nologin] referral host=.. [port=..] [destuser=..]
[reason=..]
NO [REFERRAL imap://destuser;AUTH=..@host:port/] Can't login.
OK [...] Logged in, but you should use this server instead.
.. [REFERRAL ..] (Reason from auth server)
*/
else {
"this server instead.");
}
return TRUE;
}
/* Authentication went ok, but for some reason user isn't
allowed to log in. Shouldn't probably happen. */
} else if (reply->authz_failure) {
"Authorization failed");
} else {
}
} else {
return FALSE;
}
return TRUE;
}
static int
const char *init_resp)
{
char *prefix;
}
{
/* we want only one argument: authentication mechanism name */
return -1;
/* optional SASL initial response */
return -1;
}
"SSL required for authentication");
}
client->auth_attempts++;
return 1;
}
if (*mech_name == '\0')
return -1;
}
{
/* two arguments: username and password */
return -1;
return -1;
return -1;
return 1;
/* authorization ID \0 authentication ID \0 pass */
}