imap-id.c revision 02c335c23bf5fa225a467c19f2c063fb0dc7b8c3
/* Copyright (c) 2008-2016 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "str.h"
#include "str-sanitize.h"
#include "istream.h"
#include "imap-parser.h"
#include "imap-quote.h"
#include "imap-id.h"
#ifdef HAVE_SYS_UTSNAME_H
#endif
#ifdef HAVE_UNAME
static struct utsname utsname_result;
static bool utsname_set = FALSE;
static const char *imap_id_get_uname(const char *key)
{
if (!utsname_set) {
utsname_set = TRUE;
if (uname(&utsname_result) < 0) {
i_error("uname() failed: %m");
}
}
return utsname_result.sysname;
return utsname_result.release;
return NULL;
}
#endif
static const char *imap_id_get_default(const char *key)
{
return PACKAGE_NAME;
return PACKAGE_VERSION;
return PACKAGE_WEBPAGE;
return PACKAGE_BUGREPORT;
#ifdef HAVE_UNAME
return imap_id_get_uname(key);
#endif
}
static const char *
{
if (IMAP_ARG_IS_EOL(args))
return "NIL";
/* broken input */
break;
args++;
} else {
/* key */
/* value */
break;
}
args++;
else {
}
}
}
/* broken */
return "NIL";
}
}
const char *imap_id_reply_generate(const char *settings)
{
struct imap_parser *parser;
const char *ret;
return "NIL";
(void)i_stream_read(input);
ret = "NIL";
else
return ret;
}
const char *value)
{
}
const char *settings)
{
bool log_all;
return NULL;
return NULL;
while (!IMAP_ARG_IS_EOL(&args[0]) &&
/* broken input */
args += 2;
continue;
}
args++;
/* broken: ID spec requires fields to be max. 30
octets */
args++;
continue;
}
value = "";
}
args++;
}
}