On 8/5/03 8:59 AM, "Ernest W. Lessenger" <[EMAIL PROTECTED]> wrote:
[...]
> ** Append to EvalTests.pm
> sub received_between {
> my ($self, $min, $max) = @_;
here you're using $min as an argument passed to the function.
> local ($_);
> my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime();
here you assign a value into $min from the return of localtime(); so this
routine probably won't work as is.
> my $timeString = $hour.$min;
>
someone else mentioned the sprintf option for the above.
> if ($min < $max) {
> return 1 if (($timeString > $min) && ($timeString < $max));
> }
> else {
> return 1 if (($timeString > $min) || ($timeString < $max));
> }
>
> return 0;
> }
>
> Append to 20_head_tests.cf
> header RECVD_OUTSIDE_BUS_HOURS eval:received_between(1900,0800)
> describe RECVD_OUTSIDE_BUS_HOURS The last Received: date was outside of
> business hours
>
> A business (eg) might want to give this rule a small positive value, while an
> ISP (eg) might want to give it a small negative value.
>
> --Ernest
>
> At 03:48 PM 8/4/2003 -0700, you wrote:
>> At 8/4/03 02:20 PM , Erick Calder wrote:
>>>> Instead, I'd probably write an eval function
>>>
>>> where do I find docs on how to do that?
>>
>> The Camel Book? Seriously, you should learn Perl if you want to write an
>> eval function; it's not as simple as a one-line rule. If you do understand
>> Perl, then looking at a few of the other functions in
>> Mail::SpamAssassin::EvalTest.pm should make it clear how they work.
>>
>> --Kai MacTane
>> ----------------------------------------------------------------------
>> "Lucretia, my reflection, dance the ghost with me."
>> --Sisters of Mercy,
>> "Lucretia, My
>> Reflection"
>>
>>
>>
>>
>> -------------------------------------------------------
>> This SF.Net email sponsored by: Free pre-built ASP.NET sites including
>> Data Reports, E-commerce, Portals, and Forums are available now.
>> Download today and enter to win an XBOX or Visual Studio .NET.
>> http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
>> _______________________________________________
>> Spamassassin-talk mailing list
>> [EMAIL PROTECTED]
>> https://lists.sourceforge.net/lists/listinfo/spamassassin-talk
>
-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
_______________________________________________
Spamassassin-talk mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/spamassassin-talk