in reply to munpack and format=flowed

Looks like that encoding is specified in RFC2646, so that's the first place to look for the gooey details.

I'd take a look at the CPAN for Mime-tools, as that takes care of gory stuff for you in many cases. I've not used it for that format, so I won't promise miracles. (It looks like that format adds an extra space on the end of the line and tries to break things up into paragraphs. Interesting.)