At 02:58 4/19/2016 -0400, Steffen Kaiser [email protected] 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: https://msdn.microsoft.com/en-us/library/office/aa563064%28v=exchg.140%29.aspx _______________________________________________ NOTE: If there is a disclaimer or other legal boilerplate in the above message, it is NULL AND VOID. You may ignore it. Visit http://www.mimedefang.org and http://www.roaringpenguin.com MIMEDefang mailing list [email protected] http://lists.roaringpenguin.com/mailman/listinfo/mimedefang

