]> code.citadel.org Git - citadel.git/blobdiff - citadel/modules/imap/serv_imap.c
Completed HEADERS_FAST mode, which fetches only the top
[citadel.git] / citadel / modules / imap / serv_imap.c
index d3f5e9eb4f53c75b8dad9a8aa4f164356d526d6e..af02dd68cb4da83c8c9cc08401c91ca0ecf760f8 100644 (file)
@@ -498,6 +498,12 @@ void imap_greeting(void)
        IMAP->cached_rfc822_msgnum = (-1);
        IMAP->cached_rfc822_withbody = 0;
 
+       if (CC->nologin)
+       {
+               cprintf("* BYE; Server busy, try later\r\n");
+               CC->kill_me = 1;
+               return;
+       }
        cprintf("* OK [");
        imap_output_capability_string();
        cprintf("] %s IMAP4rev1 %s ready\r\n", config.c_fqdn, CITADEL);
@@ -881,6 +887,7 @@ void imap_create(int num_parms, char *parms[])
        int flags;
        int newroomtype = 0;
        int newroomview = 0;
+       char *notification_message = NULL;
 
        if (strchr(parms[2], '\\') != NULL) {
                cprintf("%s NO Invalid character in folder name\r\n",
@@ -924,6 +931,18 @@ void imap_create(int num_parms, char *parms[])
                cprintf("%s NO Mailbox already exists, or create failed\r\n", parms[0]);
        } else {
                cprintf("%s OK CREATE completed\r\n", parms[0]);
+               /* post a message in Aide> describing the new room */
+               notification_message = malloc(1024);
+               snprintf(notification_message, 1024,
+                       "A new room called \"%s\" has been created by %s%s%s%s\n",
+                       roomname,
+                       CC->user.fullname,
+                       ((ret & QR_MAILBOX) ? " [personal]" : ""),
+                       ((ret & QR_PRIVATE) ? " [private]" : ""),
+                       ((ret & QR_GUESSNAME) ? " [hidden]" : "")
+               );
+               aide_message(notification_message, "Room Creation Message");
+               free(notification_message);
        }
        CtdlLogPrintf(CTDL_DEBUG, "imap_create() completed\n");
 }
@@ -1405,13 +1424,14 @@ void imap_command_loop(void)
        }
        
        if (untagged_ok) {
-               imap_print_instant_messages();
-       
+
+               /* we can put any additional untagged stuff right here in the future */
+
                /*
                 * Before processing the command that was just entered... if we happen
                 * to have a folder selected, we'd like to rescan that folder for new
                 * messages, and for deletions/changes of existing messages.  This
-                * could probably be optimized somehow, but IMAP sucks...
+                * could probably be optimized better with some deep thought...
                 */
                if (IMAP->selected) {
                        imap_rescan_msgids();
@@ -1439,7 +1459,7 @@ void imap_command_loop(void)
 
        else if (!strcasecmp(parms[1], "LOGOUT")) {
                if (IMAP->selected) {
-                       imap_do_expunge();      /* yes, we auto-expunge */
+                       imap_do_expunge();      /* yes, we auto-expunge at logout */
                }
                cprintf("* BYE %s logging out\r\n", config.c_fqdn);
                cprintf("%s OK Citadel IMAP session ended.\r\n",
@@ -1612,6 +1632,7 @@ void imap_command_loop(void)
 
        gettimeofday(&tv2, NULL);
        total_time = (tv2.tv_usec + (tv2.tv_sec * 1000000)) - (tv1.tv_usec + (tv1.tv_sec * 1000000));
+       CtdlLogPrintf(CTDL_INFO, "IMAP: %s\n", cmdbuf); // FIXME FIXME FIXME REMOVE THIS NOW
        CtdlLogPrintf(CTDL_DEBUG, "IMAP command completed in %ld.%ld seconds\n",
                (total_time / 1000000),
                (total_time % 1000000)