in reply to Splitting folded MIME headers into indivual headers?

Did you have a look at or try something like MIME::Parser? It seems to be able to do what you need without you having to code the parsing yourself.

jeffa

L-LL-L--L-LL-L--L-LL-L--
-R--R-RR-R--R-RR-R--R-RR
B--B--B--B--B--B--B--B--
H---H---H---H---H---H---
(the triplet paradiddle with high-hat)

Replies are listed 'Best First'.
Re^2: Splitting folded MIME headers into indivual headers?
by sebastiannielsen2 (Novice) on Mar 02, 2015 at 21:15 UTC

    Im already using that. What I need to do, is to get the generated data in name => value format, for input to Sendmail::PMilter.

    If PMilter could accept a opaque header object, I would just pass the output from MIME::Parser to PMilter, but now I need to use: $ctx->Addheader(NAME, VALUE)

    thus I need to have access to indivual header lines in a way that makes it possible to iterate over the headers.

    Any folding must be kept as-is to keep the output RFC compliant.