* More IMAP tweaks
authorArt Cancro <ajc@citadel.org>
Tue, 26 Dec 2000 03:46:52 +0000 (03:46 +0000)
committerArt Cancro <ajc@citadel.org>
Tue, 26 Dec 2000 03:46:52 +0000 (03:46 +0000)
citadel/ChangeLog
citadel/imap_fetch.c
citadel/imap_tools.c
citadel/msgbase.c
citadel/techdoc/hack.txt

index 48fd23bb081893afaece8242fd50b110beb8a7b9..fcf957f3682947649171d9f368f552d39b933dae 100644 (file)
@@ -1,4 +1,7 @@
  $Log$
+ Revision 573.57  2000/12/26 03:46:50  ajc
+ * More IMAP tweaks
+
  Revision 573.56  2000/12/25 22:50:43  ajc
  * Added an API function to extract and unfold specific RFC822 fields.
  * imap-->fetch-->envelope-->in-reply-to now works
@@ -2242,4 +2245,3 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant <bryant@cs.usm.maine.edu>
 
 Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
        * Initial CVS import 
-
index 563984112e7ed99705bea4063651eea9d0286808..5bfc50520eaa31101c884c8d98a108456466a49c 100644 (file)
@@ -108,6 +108,9 @@ void imap_fetch_rfc822(int msgnum, char *whichfmt, struct CtdlMessage *msg) {
        CtdlRedirectOutput(tmp, -1);
        CtdlOutputPreLoadedMsg(msg, msgnum, MT_RFC822, 0, 0, 1);
        CtdlRedirectOutput(NULL, -1);
+       if (!is_valid_message(msg)) {
+               lprintf(1, "WARNING: output clobbered the message!\n");
+       }
 
        /*
         * Now figure out where the headers/text break is.  IMAP considers the
index e2527c4d867a7b96302269d1650da63f7465a1b7..a633cbde46c698b221a8d36c26e56c80f6fa0f15 100644 (file)
@@ -99,4 +99,3 @@ void imap_mailboxname(char *buf, int bufsize, struct quickroom *qrbuf) {
        }
 }
 
-
index 09bb33fe69c3b921e1b957d8b921c40025dd5ec1..e21bcd22ec6939e5c6edc5fce1e9a11e9a361f96 100644 (file)
@@ -863,6 +863,11 @@ int CtdlOutputPreLoadedMsg(struct CtdlMessage *TheMessage,
        sprintf(mid, "%ld", msg_num);
        nl = (crlf ? "\r\n" : "\n");
 
+       if (!is_valid_message(TheMessage)) {
+               lprintf(1, "ERROR: invalid preloaded message for output\n");
+               return(om_no_such_msg);
+       }
+
        /* Are we downloading a MIME component? */
        if (mode == MT_DOWNLOAD) {
                if (TheMessage->cm_format_type != FMT_RFC822) {
@@ -887,7 +892,6 @@ int CtdlOutputPreLoadedMsg(struct CtdlMessage *TheMessage,
                                        desired_section);
                        }
                }
-               CtdlFreeMessage(TheMessage);
                return((CC->download_fp != NULL) ? om_ok : om_mime_error);
        }
 
@@ -1039,7 +1043,6 @@ int CtdlOutputPreLoadedMsg(struct CtdlMessage *TheMessage,
                else if (mode == MT_MIME) {     /* list parts only */
                        mime_parser(mptr, NULL, *list_this_part, NULL, 0);
                        if (do_proto) cprintf("000\n");
-                       CtdlFreeMessage(TheMessage);
                        return(om_ok);
                }
                else if (mode == MT_RFC822) {   /* unparsed RFC822 dump */
@@ -1054,14 +1057,12 @@ int CtdlOutputPreLoadedMsg(struct CtdlMessage *TheMessage,
                                else cprintf("%c", ch);
                        }
                        if (do_proto) cprintf("000\n");
-                       CtdlFreeMessage(TheMessage);
                        return(om_ok);
                }
        }
 
        if (headers_only) {
                if (do_proto) cprintf("000\n");
-               CtdlFreeMessage(TheMessage);
                return(om_ok);
        }
 
index a03585c6cb260b21a4f7ec2dfabc2b8ac36678a0..40b7d62d09805669d19196183899ab9fb73c79eb 100644 (file)
@@ -90,7 +90,7 @@ E     Extended ID     A persistent alphanumeric Message ID used for
                        message should be deleted.  If there exist any messages
                        with the same Extended ID that are *newer*, then this
                        message should be dropped.
-F      rFc821 address  For Internet mail, this is the delivery address of the
+F      rFc822 address  For Internet mail, this is the delivery address of the
                        message author.
 G      Gateway domain  This field is provided solely for the implementation
                         of C86Net gateways, and holds the C86Net domain of