]> code.citadel.org Git - citadel.git/blobdiff - webcit/smtpqueue.c
* persistantly handle the bufferlengths for dates; snprintf doesn't terminate strings...
[citadel.git] / webcit / smtpqueue.c
index ca17b24e1fcb6dfb2a265b531edd6de07ec7e0c5..db7e4c19f0234b63baa6bba8d6fba60bb12525c2 100644 (file)
@@ -83,14 +83,14 @@ void display_queue_msg(long msgnum)
                        }
 
                        if (!strcasecmp(keyword, "bounceto")) {
+                               char *atsign;
                                extract_token(sender, buf, 1, '|', sizeof sender);
 
                                /* Strip off local hostname if it's our own */
-                               char *atsign;
                                atsign = strchr(sender, '@');
                                if (atsign != NULL) {
                                        ++atsign;
-                                       if (!strcasecmp(atsign, serv_info.serv_nodename)) {
+                                       if (!strcasecmp(atsign, ChrPtr(WC->serv_info->serv_nodename))) {
                                                --atsign;
                                                *atsign = 0;
                                        }
@@ -137,7 +137,7 @@ void display_queue_msg(long msgnum)
 
        wprintf("</td><td>");
        if (submitted > 0) {
-               webcit_fmt_date(buf, submitted, 1);
+               webcit_fmt_date(buf, 1024, submitted, 1);
                wprintf("%s", buf);
        }
        else {
@@ -146,7 +146,7 @@ void display_queue_msg(long msgnum)
 
        wprintf("</td><td>");
        if (last_attempt > 0) {
-               webcit_fmt_date(buf, last_attempt, 1);
+               webcit_fmt_date(buf, 1024, last_attempt, 1);
                wprintf("%s", buf);
        }
        else {
@@ -168,12 +168,15 @@ void display_smtpqueue_inner_div(void) {
        wcsession *WCC = WC;
        int i;
        int num_msgs;
+       StrBuf *Buf;
 
        /* Check to see if we can go to the __CitadelSMTPspoolout__ room.
         * If not, we don't have access to the queue.
         */
-       gotoroom("__CitadelSMTPspoolout__");
-       if (!strcasecmp(WCC->wc_roomname, "__CitadelSMTPspoolout__")) {
+       Buf = NewStrBufPlain(HKEY("__CitadelSMTPspoolout__"));
+       gotoroom(Buf);
+       FreeStrBuf(&Buf);
+       if (!strcasecmp(ChrPtr(WCC->wc_roomname), "__CitadelSMTPspoolout__")) {
 
                num_msgs = load_msg_ptrs("MSGS ALL", 0);
                if (num_msgs > 0) {