[cvs] mime attachments

Matthias Andree matthias.andree at gmx.de
Mon Dec 30 12:08:18 CET 2002


Gyepi SAM <gyepi at praxis-sw.com> writes:

> On Sun, Dec 29, 2002 at 10:50:43PM -0500, David Relson wrote:
>
>> As you've noticed the current mime implementation doesn't do 
>> nesting.  Rather it uses msg_stack to keep track of the multiple parts of a 
>> multipart message.  I'm thinking a better approach to handling multiple 
>> parts would be to have a linked list of parts for each level of mime 
>> nesting.
>
> I think a stack is the right approach here. Granted, one could implement
> a stack with a linked list. (In fact, I just did such a thing a couple of days
> ago). One nice benefit is that we don't have to set an arbitrary depth limit
> for the stack.

No, we only need to make sure we don't overflow the stack, but deal
gracefully with messages that exceed the nesting limit. The current CVS
isn't limiting the stack size yet.

However, I wonder if it'd be good to make the lexer and the mime state
tracking synchronous first before going into details. If it doesn't get
the simple things really right, there's no point in fixing the
complicated ones.

I doubt I'll be able to work on the code before January 2nd.

> For most mime messages, what you describe will work.  Keep in mind,
> however, that that nested multipart messages are legal (obviously with
> different delimiters) and multipart/digest messages change delimiters
> within the mime part and that a higher level boundary can close a
> nested section. All this means that when a message is nested, we need
> to keep the higher level message on stack until we have unrolled all
> the nested parts. But we should pop the stack when we're finished with
> a message.

Yup.

-- 
Matthias Andree




More information about the bogofilter-dev mailing list