As part of a script, I want to take a file containing an email and extract a header, e.g., the subject header. The following almost works:
formail -c -x subject < FILE
But it does not decode headers encoded using the MIME encoded-word syntax (aka RFC2047), e.g.,
What's a nice way to extract an email header while taking care of decoding MIME encoded-word parts?