> if this mail lives in a file, then you can simply check the file
> size, perhaps with the file test operator -s.
>
> my $size = -s $file;
>
> see the section of the perlfunc manpage that talk about these:
>
Nope, unfortunately it's not in a file. The script is used as a
sendmail alias (i.e. all mail sent to [EMAIL PROTECTED] is piped through
this script). So it's read on STDIN. I'm doing something like this:
# Not cut and pasted, just typed in off the cuff
while(<STDIN>) {
# Read lines into header hash until \n\n is found.
if(/^\n/) { @{$blah{"Body}} = <STDIN>; last; }
$blah{"Header"}[$#{$blah{"Header"}}] = $_;
}
What I'd like to do is monitor the size of the header/body hash (which
is actually a hash of arrays) If it gets too large, throw a red flag
and send an email to the sender of the message letting them know how
naughty they were. I've thought of doing a char count on the fly, but
that could get really slow. Any thoughts?
Brian Johnson
[EMAIL PROTECTED]
http://www.source1results.com
Providing marketing solutions for
Small to Medium sized businesses.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]