or download this
use Compress::Zlib;
my $gz = deflateInit() || warn "Could not create zlib deflation stream
+: $!\n";
($out,$status) = $gz->deflate("$system_config{sendmail_log_dir}$_") ||
+ warn "Cannot deflate and open $system_config{sendmail_log_dir}$_: $!
+\n";
open (LOGFILE, $out) || warn "Cannot open deflated logfile for reading
+: $!\n";