> For some strange reason (for me out of the blue), my rule file (named
> f:\dnews\nobin.rul) isn't working anymore. The content of the file is;
>
> f(size()>50000) then
>     if(isin("newsgroups","telekabel.cable-gang","news.nb.nu.support"))
then
>         if(size()>250000) reject "large binary's not allowed!"
>  end if
>  else
> reject "Binarys not allowed!"
> end if
>
> accept "Article OK"
>
>
> In newsfeed.conf there is a line;
>
>  rules f:\dnews\nobin.rul
>
> Im 100% sure that the filename is correct, and the rule has worked some
time
> also. Maybe the above script is not ok anymore, because i changed some
lines
> to see what happend. What could be wrong? Is there  a simple way to check?
> Where do i look?

Hi,

The 'isin' command does not accept multiple strings to match, it can only be
uses in the form -

    isin("header","string-not-case-sensitive")

Try using something like this -

$allow_large = "telekabel.cable-gang,news.nb.nu.support"

if(size()>50000) then
    if(matchone("newsgroups",$allow_large)) then
        if(size()>250000) reject "large binaries not allowed!"
    end if
else
    reject "Binaries not allowed!"
end if

accept "Article OK"

The above will allow posts up to 250000 bytes where telekabel.cable-gang or
news.nb.nu.support is posted or cross posted to. If you wish to restrict
these further and disallow crossposts of large posts to other groups (not in
this list), then use matchall() rather than matchone().

You can test rules using the 'rules_trace' command -

    tellnews rules_trace c:\rul.txt c:\test.txt

Where rul.txt is the rule file you wish to test, and test.txt is the full
article to test (including headers).

- Roydon L.



Reply via email to