http://bugzilla.spamassassin.org/show_bug.cgi?id=4606





------- Additional Comments From [EMAIL PROTECTED]  2005-09-30 15:04 -------
Subject: Re:  Misparsing of message causes binary attachment to be treated as 
text

I wonder if there is a way to do "cheap subparsing" that might solve both
issues.

As I think I understand the problem with subparsing, I'm assuming that you
were basically calling some largish mime parser module recursively, and this
was probably upsetting perl at the stack size, leading to the deep recursion
error.

What about the possibility of simply hacking the mime parser by adding a
string array used as a stack of mime boundaries?  Every time when linearly
parsing down you recognize the introduction of a new boundary you push it
ont the stack and make it the active boundary, and run it until you see the
end boundary flag, when you pop it off, reverting to the previous boundary?

That has some potential holes with malformed mime introductions or missing
end boundaries, but I don't see that recursively calling the parser would in
any way be immune to those faults either.  You could always keep the outer
boundary handy and compare text to it to make sure you don't overrun the
overall message.  (Assuming that the outer boundary isn't reused as an
internal boundary.)

The main point of this hack would be to simply detect and delete internal
non-text mime parts, not to actually create separate recursive mime parts
for all the found text parts.  Thus, in the case of a message that had a
bunch of embedded messages as the reply history, all of that would still
show up as the outer-level text part by the time SA was scanning things.
However, any gif that was embedded in someone's signature three levels in
would have been correctly stripped from that one agglomerated text part.





------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

Reply via email to