int cmd_authenticate(struct imap_client *imap_client,
const struct imap_arg *args)
{
- struct client *client = &imap_client->common;
const char *mech_name, *init_resp = NULL;
/* we want only one argument: authentication mechanism name */
init_resp = IMAP_ARG_STR(&args[1]);
}
- if (!client->secured && strcmp(client->set->ssl, "required") == 0) {
- if (client->set->verbose_auth) {
- client_log(client, "Login failed: "
- "SSL required for authentication");
- }
- client->auth_attempts++;
- client_send_line(client, CLIENT_CMD_REPLY_AUTH_FAIL_NOSSL,
- "Authentication not allowed until SSL/TLS is enabled.");
- return 1;
- }
-
mech_name = IMAP_ARG_STR(&args[0]);
if (*mech_name == '\0')
return -1;
int client_auth_begin(struct client *client, const char *mech_name,
const char *init_resp)
{
+ if (!client->secured && strcmp(client->set->ssl, "required") == 0) {
+ if (client->set->verbose_auth) {
+ client_log(client, "Login failed: "
+ "SSL required for authentication");
+ }
+ client->auth_attempts++;
+ client_send_line(client, CLIENT_CMD_REPLY_AUTH_FAIL_NOSSL,
+ "Authentication not allowed until SSL/TLS is enabled.");
+ return 1;
+ }
+
+
client_ref(client);
client->auth_initializing = TRUE;
sasl_server_auth_begin(client, login_protocol, mech_name,
const struct auth_mech_desc *mech;
const char *mech_name, *p;
- if (!client->secured && strcmp(client->set->ssl, "required") == 0) {
- if (client->set->verbose_auth) {
- client_log(client, "Login failed: "
- "SSL required for authentication");
- }
- client->auth_attempts++;
- client_send_line(client, CLIENT_CMD_REPLY_AUTH_FAIL_NOSSL,
- "Authentication not allowed until SSL/TLS is enabled.");
- return TRUE;
- }
-
if (*args == '\0') {
/* Old-style SASL discovery, used by MS Outlook */
unsigned int i, count;