* This module is an managesieve implementation for the Citadel system.
* It is compliant with all of the following:
*
* This module is an managesieve implementation for the Citadel system.
* It is compliant with all of the following:
*
+int old_imap_parameterize(char** args, char *in)
+{
+ char* out = in;
+ int num = 0;
+
+ for (;;)
+ {
+ /* Skip whitespace. */
+
+ while (isspace(*in))
+ in++;
+ if (*in == 0)
+ break;
+
+ /* Found the start of a token. */
+
+ args[num++] = out;
+
+ /* Read in the token. */
+
+ for (;;)
+ {
+ int c = *in++;
+ if (isspace(c))
+ break;
+
+ if (c == '\"')
+ {
+ /* Found a quoted section. */
+
+ for (;;)
+ {
+ c = *in++;
+ if (c == '\"')
+ break;
+ else if (c == '\\')
+ c = *in++;
+
+ *out++ = c;
+ if (c == 0)
+ return num;
+ }
+ }
+ else if (c == '\\')
+ {
+ c = *in++;
+ *out++ = c;
+ }
+ else
+ *out++ = c;
+
+ if (c == 0)
+ return num;
+ }
+ *out++ = '\0';
+ }
+
+ return num;
+}
+
/*****************************************************************************/
/* MANAGESIEVE Server */
/*****************************************************************************/
/*****************************************************************************/
/* MANAGESIEVE Server */
/*****************************************************************************/
return NULL;
}
MGSVE->transmitted_message = malloc(size + 2);
if (MGSVE->transmitted_message == NULL) {
cprintf("NO %s Cannot allocate memory.\r\n", command);
return NULL;
}
MGSVE->transmitted_message = malloc(size + 2);
if (MGSVE->transmitted_message == NULL) {
cprintf("NO %s Cannot allocate memory.\r\n", command);
message = ReadString(GetSizeToken(parms[2]), parms[0]);
if (message != NULL) {/**< do we have tokenized login? */
message = ReadString(GetSizeToken(parms[2]), parms[0]);
if (message != NULL) {/**< do we have tokenized login? */
* PUTSCRIPT command, see chapter 2.6
*/
void cmd_mgsve_putscript(int num_parms, char **parms, struct sdm_userdata *u)
* PUTSCRIPT command, see chapter 2.6
*/
void cmd_mgsve_putscript(int num_parms, char **parms, struct sdm_userdata *u)
slen = strlen(script_content);
outbuf = malloc (slen + 64);
snprintf(outbuf, slen + 64, "{%ld+}\r\n%s\r\nOK\r\n",slen, script_content);
slen = strlen(script_content);
outbuf = malloc (slen + 64);
snprintf(outbuf, slen + 64, "{%ld+}\r\n%s\r\nOK\r\n",slen, script_content);
if ((length>= 12) && (!strncasecmp(parms[0], "AUTHENTICATE", 12))){
cmd_mgsve_auth(num_parms, parms, &u);
}
if ((length>= 12) && (!strncasecmp(parms[0], "AUTHENTICATE", 12))){
cmd_mgsve_auth(num_parms, parms, &u);
}
- CtdlLogPrintf(CTDL_INFO, "illegal Managesieve command: %s", parms[0]);
- CC->kill_me = 1;
+ syslog(LOG_INFO, "illegal Managesieve command: %s", parms[0]);
+ CC->kill_me = KILLME_ILLEGAL_MANAGESIEVE_COMMAND;
/* Don't do this stuff if this is not a managesieve session! */
if (CC->h_command_function != managesieve_command_loop) return;
/* Don't do this stuff if this is not a managesieve session! */
if (CC->h_command_function != managesieve_command_loop) return;