From 2ab4879d9f52f888a48885bc01979dcf1ac264cf Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Tue, 26 Dec 2000 03:46:52 +0000 Subject: [PATCH] * More IMAP tweaks --- citadel/ChangeLog | 4 +++- citadel/imap_fetch.c | 3 +++ citadel/imap_tools.c | 1 - citadel/msgbase.c | 9 +++++---- citadel/techdoc/hack.txt | 2 +- 5 files changed, 12 insertions(+), 7 deletions(-) diff --git a/citadel/ChangeLog b/citadel/ChangeLog index 48fd23bb0..fcf957f36 100644 --- a/citadel/ChangeLog +++ b/citadel/ChangeLog @@ -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 Fri Jul 10 1998 Art Cancro * Initial CVS import - diff --git a/citadel/imap_fetch.c b/citadel/imap_fetch.c index 563984112..5bfc50520 100644 --- a/citadel/imap_fetch.c +++ b/citadel/imap_fetch.c @@ -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 diff --git a/citadel/imap_tools.c b/citadel/imap_tools.c index e2527c4d8..a633cbde4 100644 --- a/citadel/imap_tools.c +++ b/citadel/imap_tools.c @@ -99,4 +99,3 @@ void imap_mailboxname(char *buf, int bufsize, struct quickroom *qrbuf) { } } - diff --git a/citadel/msgbase.c b/citadel/msgbase.c index 09bb33fe6..e21bcd22e 100644 --- a/citadel/msgbase.c +++ b/citadel/msgbase.c @@ -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); } diff --git a/citadel/techdoc/hack.txt b/citadel/techdoc/hack.txt index a03585c6c..40b7d62d0 100644 --- a/citadel/techdoc/hack.txt +++ b/citadel/techdoc/hack.txt @@ -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 -- 2.30.2