cmd-append.c revision 7913b62dac8e4928226bc5eba59b01675cdb0018
/* Copyright (C) 2002 Timo Sirainen */
#include "common.h"
#include "ioloop.h"
#include "commands.h"
#include "imap-parser.h"
#include "imap-date.h"
/* Returns -1 = error, 0 = need more data, 1 = successful. flags and
internal_date may be NULL as a result, but mailbox and msg_size are always
set when successful. */
{
*internal_date = NULL;
&args))
return 0;
switch (count) {
case 2:
/* do we have flags or internal date parameter? */
break;
case 3:
/* do we have both flags and internal date? */
else
return -1;
break;
case 4:
/* we have all parameters */
break;
default:
i_assert(0);
}
/* check that mailbox and message arguments are ok */
return -1;
return -1;
return 1;
}
{
const char *custom_flags[MAIL_CUSTOM_FLAGS_COUNT];
const char *mailbox, *internal_date_str;
int failed;
/* <mailbox> [<flags>] [<internal date>] <message literal> */
case -1:
/* error */
return TRUE;
case 0:
/* need more data */
return FALSE;
default:
}
return TRUE;
if (internal_date_str == NULL) {
/* no time given, default to now. */
return TRUE;
}
/* this mailbox is selected */
} else {
/* open the mailbox */
return TRUE;
return TRUE;
}
}
/* save the mail */
if (failed) {
} else {
}
return TRUE;
}