I use GNUS which has separate files for each message. Some of my saved mail are base64-encoded MIME messages, which can get pretty huge. One day I wondered if I could save some space by GZIP'ping those large mail messages which were pretty much in archival mode instead of being actively used, so I whipped up the attached, and it worked nicely!

For future improvement, I might have used Compress::Gzip directly, but this one worked well enough.

#!/usr/bin/perl use strict; $|++; use File::Find; find sub { return unless /^(\d+)$/ and -f and -s _ > 65535 and -A _ > 0.1; system '/bin/gzip', "-9v", $File::Find::name; }, "/home/merlyn/Mail";