looping over zero length file

Richard D Alloway ralloway at CHARTERPA.NET
Tue Jul 2 15:04:41 IST 2002


Thanks!

That was quick! (I know...I know...easy fix *grin*)

-Rich

On Tue, 2 Jul 2002, Julian Field wrote:

> At 14:48 02/07/2002, you wrote:
> >In /var/spool/mqueue.in, I have a single file:
> >
> >-rw-------   1 root     root            0 Jun  7 17:40 qfRAA06251
> >
> >Removing it solved the problem...
> >
> >Perhaps mailscanner should check to ensure that the file is non-zero
> >length before attempting to parse it...
>
> Good idea. If you are using a recent version, the patch looks like this.
> Add 1 line (the "+" line) to sendmail.pl.
>
> *** 132,141 ****
> --- 132,142 ----
>        # Optimised by binning the 50% that aren't H files first
>        next unless $file =~ /$MTA::HFileRegexp/;
>        $tmpdate = (stat("$InQueueDir/$file"))[9]; # 9 = mtime
>        #next unless -f "$InQueueDir/$file";
>        next unless -f _;
> +     next if -z _; # Skip 0-length qf files
>        $ModDate{$file} = $tmpdate;
>      }
>      @SortedFiles = sort { $ModDate{$a} <=> $ModDate{$b} } keys %ModDate;
>
>      # Keep going until end of dir or have reached every imposed limit.
>
> --
> Julian Field                Teaching Systems Manager
> jkf at ecs.soton.ac.uk         Dept. of Electronics & Computer Science
> Tel. 023 8059 2817          University of Southampton
>                              Southampton SO17 1BJ
>



More information about the MailScanner mailing list