article on blocking by subnets

Graham Wilson bob at decoy.wox.org
Tue Dec 3 02:39:19 CET 2002


On Mon, Dec 02, 2002 at 05:26:56PM -0800, Barry Gould wrote:
> At 04:51 PM 12/2/2002, you wrote:
> >Have you the expertise to write the code?  Would you care to?
> 
> I'm not sure... it's been a LONG time since I've written any C.
> 
> However, I'd be happy to suggest an algorithm:
> 
> if (token is an IP address (in form a.b.c.d) )
> {
>         create a new token for each of:
>         class C net (a.b.c.0)
>         class B net (a.b.0.0)
>         class A net (a.0.0.0) (dunno if this is a good idea or not)
> 
>         and Evaluate or Store/Update them as appropriate, in addition to 
> the original IP
> }

this is the kind of idea i was thinking of. i would say you also want to
return the entire address (a.b.c.d).

> things to beware of:
> mail agent/daemon version numbers can look like IP's

good point.

> Is it possible to use Regular Expressions, or would that involve 
> non-standard C libraries?

i think the code would be added to the lexer, which i believe does use
some form of regular expressions to form tokens.

--
gram




More information about the Bogofilter mailing list