imap-login-cmd-id.c revision 5233c86a95d3865500c291f00d08b1f4c678a424
/* Copyright (c) 2002-2017 Dovecot authors, see the included COPYING file */
#include "login-common.h"
#include "str.h"
#include "imap-parser.h"
#include "imap-quote.h"
#include "imap-login-settings.h"
#include "imap-login-client.h"
static const char *const imap_login_reserved_id_keys[] = {
"x-originating-ip",
"x-originating-port",
"x-connected-ip",
"x-connected-port",
"x-proxy-ttl",
"x-session-id",
"x-session-ext-id",
};
static bool
{
/* SYNC WITH imap_login_reserved_id_keys */
/* nothing */
}
}
/* handle extra field */
} else {
return FALSE;
}
return TRUE;
}
static bool client_id_reserved_word(const char *key)
{
}
{
bool client_id_str;
/* length of key + length of value (NIL for NULL) and two set of
quotes and space */
/* do not try to process NIL values as client-info,
but store them for non-reserved keys */
} else {
}
} else {
}
} else {
}
else
}
}
{
return 1;
return -1;
/* no ID logging */
/* already logged the ID reply */
} else {
/* log all keys */
} else {
/* log only specified keys */
}
}
break;
case IMAP_CLIENT_ID_STATE_KEY:
return -1;
return -1;
break;
return -1;
break;
}
return 0;
}
{
/* finished handling the parameters */
}
}
t_strdup_printf("* ID %s\r\n",
}
{
}
{
struct imap_client_cmd_id *id;
int ret;
} else {
}
"Invalid ID parameters");
return -1;
}
if (ret > 0) {
/* NIL parameter */
ret = 0;
break;
}
}
if (ret == 0) {
/* finished the line */
return 1;
} else if (ret == -1) {
return 0;
return -1;
} else {
return 0;
}
}