$Log$
+ Revision 605.14 2003/03/12 03:33:54 ajc
+ * More changes to the handling of RFC822 headers with regard to
+ splitting up the headers and body. (Blank lines and such.)
+
Revision 605.13 2003/03/11 06:23:50 ajc
* More accurate handling of IMAP FETCH xx BODYSTRUCTURE command. This should
make Pine happier with multipart messages.
Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
* Initial CVS import
-
cprintf("Organization: %s%s", lnode, nl);
/* Blank line signifying RFC822 end-of-headers */
- cprintf("%s", nl);
+ if (TheMessage->cm_format_type != FMT_RFC822) {
+ cprintf("%s", nl);
+ }
}
/* end header processing loop ... at this point, we're in the text */
* Citadel and RFC822 headers exist. Preference should
* probably be given to the RFC822 headers.
*/
+ int done_rfc822_hdrs = 0;
while (ch=*(mptr++), ch!=0) {
- if (ch==13) ;
- else if (ch==10) cprintf("%s", nl);
- else cprintf("%c", ch);
+ if (ch==13) {
+ /* do nothing */
+ }
+ else if (ch==10) {
+ if (!done_rfc822_hdrs) {
+ if (headers_only != HEADERS_NONE) {
+ cprintf("%s", nl);
+ }
+ }
+ else {
+ if (headers_only != HEADERS_ONLY) {
+ cprintf("%s", nl);
+ }
+ }
+ if ((*(mptr) == 13) || (*(mptr) == 10)) {
+ done_rfc822_hdrs = 1;
+ }
+ }
+ else {
+ if (done_rfc822_hdrs) {
+ if (headers_only != HEADERS_NONE) {
+ cprintf("%c", ch);
+ }
+ }
+ else {
+ if (headers_only != HEADERS_ONLY) {
+ cprintf("%c", ch);
+ }
+ }
+ if ((*mptr == 13) || (*mptr == 10)) {
+ done_rfc822_hdrs = 1;
+ }
+ }
}
- if (do_proto) cprintf("000\n");
- return(om_ok);
+ goto DONE;
}
}
if (headers_only == HEADERS_ONLY) {
- if (do_proto) cprintf("000\n");
- return(om_ok);
+ goto DONE;
}
/* signify start of msg text */
}
}
- /* now we're done */
+DONE: /* now we're done */
if (do_proto) cprintf("000\n");
return(om_ok);
}