[Mimedefang] documentation bug/omission for newbies

starlight.2016q2 at binnacle.cx starlight.2016q2 at binnacle.cx
Tue Apr 19 20:11:39 EDT 2016

At 02:58 4/19/2016 -0400, Steffen Kaiser skmimedefang at smail.inf.fh-bonn-rhein-sieg.de wrote:
>because MIMEDefang internally breaks up the message into parts
>anyway and feeds all parts to filter(), I would construct your
>code like so:

[code omitted]

Ah!  I must concede that if one is looking for a
_general_ solution to examining the first text / body
part of a MIME message, your solution is correct and
the one I chose to implement is not correct.

Is very easy for someone who has not spent time working
with MIME to miss that MIME expresses an arbitrary
hierarchy of nested objects.

As in the Microsoft pictured example, the body text
could easily be two levels down from the message
part[0] object.

For my specific requirement looking at part[0] is
suitable for a narrow case being addressed.  In
the general case the state machine implemented
as you describe is the way to go.

Back to my original point. . .

Is easy for a technically competent person new to MIME
to be smacked by the nuances, but a little up-front
explanation would for the same audience be of great
help and potentially save a lot of time.  Just one
sentence and a link to a good MIME quick-study is
enough.  Here it has taken me a couple of days to
get up to speed, but just looking at that Microsoft
picture would have taken me to the same place in
15 minutes.  It's so helpful I have to repeat it:


More information about the MIMEDefang mailing list