#!/usr/bin/perl -w # # Script to say "You have new mail" if you have new mail. In the good # old days we didn't have to do this ourselves, but OpenSSH doesn't let # you use the CheckMail option anymore. # # Written 5 Aug 02 by Michael A. Dickerson use strict; my $mtime; my $atime; my $size; my $x = `whoami`; # $x is a throwaway value chomp $x; my $mailfile = "/var/mail/$x"; ($x, $x, $x, $x, $x, $x, $x, $size, $atime, $mtime) = stat $mailfile; print "You have new mail in $mailfile\n" if ($mtime > $atime && $size > 0); # That's all