views:

99

answers:

2

I'm working with a snippet of code that recursively calls itself and tries to pull out a mime type part of "text/html" from an email (if it exists) for further processing. The "text/html" could exist inside other content such as "multipart/alternative" so I'm trying to find out if there is a defined hierarchy for email mime types. Anybody know if there is and what it is? i.e. what types can parent other types?

A: 

Your question assumes that mail clients follow the RFC standards for MIME encoding, which they don't. I'd advise you collect a bunch of mail from sources and try and process it as-it-exists. The problem you are facing is extremely difficult (perhaps impossible) to solve 100%.

Robby Slaughter
+1  A: 

In theory, only multipart/ and message/ can parent other types (per RFC2046).

David Singer