4 return -1 unless open(M
, "<$mbox");
10 if (!$inhdr && /^From\s+\S+\s+(?i:sun|mon|tue|wed|thu|fri|sat)\s+(?i:jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)\s+\d+\s/) {
17 if (/^content-length:\s+(\d+)/i) {
21 if (/^status:\s+(\S)/i) {
22 $msgread = 1 unless $1 eq 'N' || $1 eq 'U';
26 $count++ if !$msgread;
27 seek(M
, $cl, 1) if defined $cl;
37 $mbox = $ARGV[0] || $ENV{'MAIL'};
38 $oldfmt = $ARGV[1] || "%4d ";
39 $newfmt = $ARGV[2] || "\005{Rk}%4d \005{-}";
41 @oldstat = stat($mbox);
43 print "\005{Rk} ??? \005{-}\n";
48 $count = countmsgs
($mbox);
50 print "\005{Rk} ??? \005{-}\n";
51 } elsif ($count < $oldcount || $count == 0) {
52 printf "$oldfmt\n", $count;
54 printf "$newfmt\n", $count;
58 @newstat = stat($mbox);
60 print "\005{Rk} ??? \005{-}\n";
63 last if $newstat[7] != $oldstat[7] || $newstat[9] != $oldstat[9];