From a605e70c6ecfccfe650a85ef4a32ebbf9cd4385f Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Wed, 10 Oct 2007 21:28:25 +0000 Subject: [PATCH] Began implementing the UIDPLUS extension. [APPENDUID xxx yyy] response is complete. UID EXPUNGE is complete (uses 'fallback' methodology described in RFC2359) Still need to do COPYUID and UID COPY before we can advertise this extension. --- citadel/modules/imap/imap_misc.c | 3 ++- citadel/modules/imap/serv_imap.c | 9 ++++++--- citadel/modules/imap/serv_imap.h | 3 +++ 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/citadel/modules/imap/imap_misc.c b/citadel/modules/imap/imap_misc.c index 3b87e25c0..d75db8a34 100644 --- a/citadel/modules/imap/imap_misc.c +++ b/citadel/modules/imap/imap_misc.c @@ -445,7 +445,8 @@ void imap_append(int num_parms, char *parms[]) { new_msgnum = CtdlSubmitMsg(msg, NULL, ""); } if (new_msgnum >= 0L) { - cprintf("%s OK APPEND completed\r\n", parms[0]); + cprintf("%s OK [APPENDUID %ld %ld] APPEND completed\r\n", + parms[0], GLOBAL_UIDVALIDITY_VALUE, new_msgnum); } else { cprintf("%s BAD Error %ld saving message to disk.\r\n", diff --git a/citadel/modules/imap/serv_imap.c b/citadel/modules/imap/serv_imap.c index 19299eba1..b7d44b557 100644 --- a/citadel/modules/imap/serv_imap.c +++ b/citadel/modules/imap/serv_imap.c @@ -738,7 +738,7 @@ void imap_select(int num_parms, char *parms[]) 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, @@ -1552,8 +1552,7 @@ void imap_command_loop(void) 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); } @@ -1561,6 +1560,10 @@ void imap_command_loop(void) 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); } diff --git a/citadel/modules/imap/serv_imap.h b/citadel/modules/imap/serv_imap.h index c7d932a97..59e30643e 100644 --- a/citadel/modules/imap/serv_imap.h +++ b/citadel/modules/imap/serv_imap.h @@ -2,6 +2,9 @@ */ +#define GLOBAL_UIDVALIDITY_VALUE 1L + + void imap_cleanup_function(void); void imap_greeting(void); void imap_command_loop(void); -- 2.30.2