#include <ctype.h>
#include <string.h>
#include <limits.h>
+#include <libcitadel.h>
#include "citadel.h"
#include "server.h"
#include "citserver.h"
#include "policy.h"
#include "database.h"
#include "msgbase.h"
-#include "tools.h"
#include "internet_addressing.h"
#include "serv_imap.h"
#include "imap_tools.h"
* output this stuff in other places as well)
*/
void imap_output_capability_string(void) {
- cprintf("CAPABILITY IMAP4REV1 NAMESPACE ID AUTH=PLAIN AUTH=LOGIN");
+ cprintf("CAPABILITY IMAP4REV1 NAMESPACE ID AUTH=PLAIN AUTH=LOGIN UIDPLUS");
#ifdef HAVE_OPENSSL
if (!CC->redirect_ssl) cprintf(" STARTTLS");
}
if (!strcasecmp(parms[2], "LOGIN")) {
- CtdlEncodeBase64(buf, "Username:", 9);
+ CtdlEncodeBase64(buf, "Username:", 9, 0);
cprintf("+ %s\r\n", buf);
IMAP->authstate = imap_as_expecting_username;
strcpy(IMAP->authseq, parms[0]);
}
if (!strcasecmp(parms[2], "PLAIN")) {
- // CtdlEncodeBase64(buf, "Username:", 9);
+ // CtdlEncodeBase64(buf, "Username:", 9, 0);
// cprintf("+ %s\r\n", buf);
cprintf("+ \r\n");
IMAP->authstate = imap_as_expecting_plainauth;
CtdlDecodeBase64(buf, cmd, SIZ);
CtdlLoginExistingUser(NULL, buf);
- CtdlEncodeBase64(buf, "Password:", 9);
+ CtdlEncodeBase64(buf, "Password:", 9, 0);
cprintf("+ %s\r\n", buf);
IMAP->authstate = imap_as_expecting_password;
return;
cprintf("* %d EXISTS\r\n", msgs);
cprintf("* %d RECENT\r\n", new);
- cprintf("* OK [UIDVALIDITY 1] UID validity status\r\n");
+ cprintf("* OK [UIDVALIDITY %ld] UID validity status\r\n", GLOBAL_UIDVALIDITY_VALUE);
cprintf("* OK [UIDNEXT %ld] Predicted next UID\r\n", CitControl.MMhighest + 1);
/* Note that \Deleted is a valid flag, but not a permanent flag,
imap_copy(num_parms, parms);
}
- else if ((!strcasecmp(parms[1], "UID"))
- && (!strcasecmp(parms[2], "COPY"))) {
+ else if ((!strcasecmp(parms[1], "UID")) && (!strcasecmp(parms[2], "COPY"))) {
imap_uidcopy(num_parms, parms);
}
imap_expunge(num_parms, parms);
}
+ else if ((!strcasecmp(parms[1], "UID")) && (!strcasecmp(parms[2], "EXPUNGE"))) {
+ imap_expunge(num_parms, parms);
+ }
+
else if (!strcasecmp(parms[1], "CLOSE")) {
imap_close(num_parms, parms);
}