#!/bin/sh log=$1 && shift || log=~/Mail/.maillog tail -n 99 -f "$log" |perl -MEncode -Mopen=OUT,:locale -ln /dev/fd/3 3<<'__EOF__' 2>/dev/null s/^\s*Subject:\s*// and s/=\?\w\S*[^=]$/$&?=/, $subj = Encode::decode("MIME-Header", $_) || $_; /^\s*Folder:\s*(\S+)/ and printf "%-8s\t%s\n", $1, $subj; __EOF__