Perl one-(long-)liner to clean up an email archive for web display. * Cuts all headers except From, Date, Subject * Cuts PGP signatures * Cuts email addresses in From: headers Not guaranteed to work with anyone else's email setup. perl -ne 'print unless /^Return-path:/ .. /^X-Spam-Level:/ or /--BEGIN PGP SIGNATURE--/ .. /--END PGP SIGNATURE--/; print if /^Subject:|^Date:/; if (/^From:/) { s/<.*>//; print } ' < in.txt > out.txt Come to that, not guaranteed to work at all.