* modules registering serverports now need to specify a plaintext name.
[citadel.git] / citadel / modules / imap / serv_imap.c
index a391e91ac28291089538a78ee0c5f2891a48def3..ca4acfb6c38dca00a0ad52381d67f5dd244d11e7 100644 (file)
@@ -435,12 +435,16 @@ void imap_cleanup_function(void)
  * output this stuff in other places as well)
  */
 void imap_output_capability_string(void) {
-       cprintf("CAPABILITY IMAP4REV1 NAMESPACE ID ACL AUTH=PLAIN AUTH=LOGIN");
+       cprintf("CAPABILITY IMAP4REV1 NAMESPACE ID AUTH=PLAIN AUTH=LOGIN");
 
 #ifdef HAVE_OPENSSL
        if (!CC->redirect_ssl) cprintf(" STARTTLS");
 #endif
 
+#ifndef DISABLE_IMAP_ACL
+       cprintf(" ACL");
+#endif
+
        /* We are building a partial implementation of METADATA for the sole purpose
         * of interoperating with the ical/vcard version of the Bynari Insight Connector.
         * If you were expecting something else, comment out one or both of these
@@ -587,7 +591,7 @@ void imap_auth_plain(char *cmd)
 
        IMAP->authstate = imap_as_normal;
 
-       if (strlen(ident) > 0) {
+       if (!IsEmptyStr(ident)) {
                result = CtdlLoginExistingUser(user, ident);
        }
        else {
@@ -1578,16 +1582,19 @@ void imap_command_loop(void)
 }
 
 
+const char *CitadelServiceIMAP="IMAP";
+const char *CitadelServiceIMAPS="IMAPS";
+
 /*
  * This function is called to register the IMAP extension with Citadel.
  */
 CTDL_MODULE_INIT(imap)
 {
        CtdlRegisterServiceHook(config.c_imap_port,
-                               NULL, imap_greeting, imap_command_loop, NULL);
+                               NULL, imap_greeting, imap_command_loop, NULL, CitadelServiceIMAP);
 #ifdef HAVE_OPENSSL
        CtdlRegisterServiceHook(config.c_imaps_port,
-                               NULL, imaps_greeting, imap_command_loop, NULL);
+                               NULL, imaps_greeting, imap_command_loop, NULL, CitadelServiceIMAPS);
 #endif
        CtdlRegisterSessionHook(imap_cleanup_function, EVT_STOP);