OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
Re: A Map Filter Question

From: mouss (mlist.onlyfree.fr)
Date: Tue Jan 23 2007 - 15:38:34 CST


Rich Shepard wrote:
> On Tue, 23 Jan 2007, Noel Jones wrote:
>
>> - your CIDR table didn't match the IP. Test with postmap -q IP
>> cidr:table
>
> Noel,
>
> Uh-oh! I've got big troubles here. It looks like my entire file is
> incorrectly formatted. Here are the first few lines returned from
> 'postmap
> -q 60.209.83.108 cidr:/etc/postfix/badip':
>
> postmap: warning: cidr map /etc/postfix/badip, line 6: bad address
> pattern:
> "67.92.168": skipping this rule
> postmap: warning: cidr map /etc/postfix/badip, line 60: non-null host
> address bits in "61.10.0.0/13", perhaps you should use "61.8.0.0/13"
> instead: skipping this rule
> postmap: warning: cidr map /etc/postfix/badip, line 233: bad address
> pattern: "80.191.97": skipping this rule
> postmap: warning: cidr map /etc/postfix/badip, line 239: bad net/mask
> pattern: "81.292.0.0/16": skipping this rule
> postmap: warning: cidr map /etc/postfix/badip, line 325: bad net/mask
> pattern: "200.108.224/20": skipping this rule
>
> ... and it goes on.
>
> I wonder why the bit masks are incorrect. I used 'range2cidr.pl' to
> calculate them.

either because your source format is not "parsable" or your shell script
is buggy.
post a snippet of your source file and I'll send you perl code to parse it.

PS. You can certainly find python equivalents if you don't feel
confident with perl.