]> code.citadel.org Git - citadel.git/commitdiff
Added a minimal implementation of IMAP 'ID' extension (RFC2971).
authorArt Cancro <ajc@citadel.org>
Mon, 20 Feb 2006 18:35:04 +0000 (18:35 +0000)
committerArt Cancro <ajc@citadel.org>
Mon, 20 Feb 2006 18:35:04 +0000 (18:35 +0000)
This was done only so that we can see if any clients are using it.

citadel/serv_imap.c

index 67032bae7454a1ad9433b60558ecedf86e492bef..64e2ed8601e544d4615820d6bbc0535fc2b6220e 100644 (file)
@@ -434,7 +434,7 @@ void imap_cleanup_function(void)
  * output this stuff in other places as well)
  */
 void imap_output_capability_string(void) {
-       cprintf("CAPABILITY IMAP4REV1 NAMESPACE AUTH=LOGIN");
+       cprintf("CAPABILITY IMAP4REV1 NAMESPACE ID AUTH=LOGIN");
 #ifdef HAVE_OPENSSL
        if (!CC->redirect_ssl) cprintf(" STARTTLS");
 #endif
@@ -453,6 +453,23 @@ void imap_capability(int num_parms, char *parms[])
 
 
 
+/*
+ * Implements the ID command (specified by RFC2971)
+ *
+ * We ignore the client-supplied information, and output a NIL response.
+ * Although this is technically a valid implementation of the extension, it
+ * is quite useless.  It exists only so that we may see which clients are
+ * making use of this extension.
+ * 
+ */
+void imap_id(int num_parms, char *parms[])
+{
+       cprintf("* ID NIL\r\n");
+       cprintf("%s OK ID completed\r\n", parms[0]);
+}
+
+
+
 /*
  * Here's where our IMAP session begins its happy day.
  */
@@ -1444,6 +1461,11 @@ void imap_command_loop(void)
                        parms[0]);
        }
 
+       else if (!strcasecmp(parms[1], "ID")) {
+               imap_id(num_parms, parms);
+       }
+
+
        else if (!strcasecmp(parms[1], "LOGOUT")) {
                if (IMAP->selected) {
                        imap_do_expunge();      /* yes, we auto-expunge */