I really like good text formatting. (Man pages get me all a-tingley.) Thus, I like my email to be formatted nicely when I reply to people. The solution: email_tremendufy!
I created a simple framework for filtering mail using Mail::Filter, Mail::Internet and a few source filtering tricks. Thus, I now immediately pipe my replies through a script that looks like this:
use HairyMailFilter;
# remove RT header stuff filter { s/> .*\n> -{72,}\n/\n/s; };
# trim signature filter { s/(?<=\n)> -{2,4} ?\n(> .+?\n)+/\n/gs; };
# remove greetings filter { my $greetings = join('|',qw( hi hello hey howdy morning )); ...
map \r:%! email_tremendufy /^$ o O
use LessHairyMailFilter;
# remove RT header stuff message->quoted->trim_until( qr/^-{72,}$/m );
# strip signature after a "--" line message->quoted->trim_after( qr(\n--\s*\n.*$/s );
# change email addresses to name using getpwnam() # but only if on "On date x, so-and-so wrote:" lines # (line-by-line basis) message->filter_lines( qr/wrote:$/ => \&email_to_names );
# autoformat using Text::Autoformat message->quoted->autoformat( right => 70 );
# remove duplicate lines message->filter( sub { s/\n\n\n/\n\n/gs while /\n\n\n/ } );
forward-socks4 / 127.0.0.1:1080 .