OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
mynetworks from database with pgsql - troubles with netmasks

From: Harakiri (harakiri_23yahoo.com)
Date: Wed May 10 2006 - 13:03:43 CDT


Hi,

there is a limitation within postfix and sql database
backends. Using the pgsql support - postfix only
queries for values and if something is returned than
its valid - if nothing its not - there is no netmask
check for example.

Postfix simply does a

"select * from mynetworks where ip='single_ip'"

Postfix does a simple lookup of the IP address,
instead of investigating if the IP address is included
in any netmasks in the table.

Lets say i send an email from 192.168.0.99 but have
configured my database for the net 192.168.0.1/24

i would have to enter every single IP address into
this database to match postfix query.

Anyone has a SQL procedure that will calculate if
192.168.0.99 is in the net 192.168.0.1/24 for example
?

I found a similar post but the stored procedure does
not really handle this

http://www.irbs.net/internet/postfix/0304/3074.html

I *have* to use a sql database backend, so no other
option is viable.

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam
protection around
http://mail.yahoo.com

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com