HylaFAX The world's most advanced open source fax server

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: faxmail fails on mime message/rfc822



On Tue, Aug 25, 1998 at 01:54:11PM +0900, Andrew S. Howell wrote:
> 
> Hello,
> 
> 	Faxmail gets itself into an infinite loop when processing a
> MIME message of Content-type: message/rfc822. From what I've found so
> far, the problem seems to lie in faxmail.c++. The two member
> functions:
> 
> 	formatMIME
> 	formatMessage
> 
> recursively call each other, with nothing to stop the recursion. Does
> anyone know if there is a patch for this?
> 

Hi,

I sent a patch to this mailing list some time ago. Here it is again. 



- MIC


----------------------------------------------------------------------------
Michael Salzmann
Schlund + Partner AG
Erbprinzenstr. 1                                            Tel.0721/91374-50
76133 Karlsruhe                                             Fax.0721/91374-20
http://www.schlund.de                                     salzmann@schlund.de


--SNIP------------------------------------------------
--- faxmail/faxmail.c++ Sat Feb 14 11:49:50 1998
+++ faxmail.local/faxmail.c++   Thu Apr  9 10:31:08 1998
@@ -448,7 +448,9 @@
 faxMailApp::formatMessage(FILE* fd, MIMEState& mime, MsgFmt& msg)
 {
     if (mime.getSubType() == "rfc822") {       // discard anything else
-       msg.parseHeaders(fd, mime.lineno);      // collect headers
+                               // 980316 - mic: new MsgFmt 
+      MsgFmt bodyHdrs(msg);            
+      bodyHdrs.parseHeaders(fd, mime.lineno);
        /*
         * Calculate the amount of space required to format
         * the message headers and any required inter-message
@@ -462,11 +464,11 @@
             * XXX, hack.  Avoid inserting a digest divider when
             * the sub-part is a faxmail prologue or related part.
             */
-           const fxStr* s = msg.findHeader("Content-Type");
+           const fxStr* s = bodyHdrs.findHeader("Content-Type");
            if (!s || !strneq(*s, "application/x-faxmail", 21))
                divider = msgDivider;
        }
-       u_int nl = msg.headerCount()            // header lines
+       u_int nl = bodyHdrs.headerCount()               // header lines
            + (nl > 0)                          // blank line following
header
            + (divider != NULL)                 // digest divider
            + 1;                                // 1st text line of message
@@ -477,10 +479,10 @@
            endLine();
        }
        if (nl > 0)
-           msg.formatHeaders(*this);           // emit formatted headers
+         bodyHdrs.formatHeaders(*this); // emit formatted headers
 
        MIMEState subMime(mime);
-       formatMIME(fd, subMime, msg);           // format message body
+       formatMIME(fd, subMime, bodyHdrs);              // format message
body
     } else {
        discardPart(fd, mime);
        formatDiscarded(mime);




Project hosted by iFAX Solutions