This is a very complete script, thank you. I'm having a problem parsing emails with attachments as I'm consistently getting:
PHP Notice: Undefined index: FileDisposition
I found your scripts here:
damnsemicolon.com/php/php-parse-ema ...
and this is the code I'm using. I'm getting the same results when I use your test message examples as well. Here's the link to my complete test file:
gist.github.com/967563