Another utililty that can reformat mail, extract/rewrite headers, and do other things with mail files is "formail" from pkgsrc/mail/procmail. I find it useful from time to time, but it might be showing its age at this point.