cidr table on mysql database

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

cidr table on mysql database

Jack Knowlton
Hi all.
Is it possible to store a CIDR access table on a mysql database? It would
be very useful so I could have a centralized list to serve all MXs'
instead of rsync'ing files each time.
Thanks,

JK

Reply | Threaded
Open this post in threaded view
|

Re: cidr table on mysql database

Walter Pinto-2
You may be able to use a mysql access map with a template like below:

user           = dbuser
password       = dbpasswd
dbname         = dbname
query          =
 SELECT y
 FROM access
 WHERE x='%s'
Reply | Threaded
Open this post in threaded view
|

Re: cidr table on mysql database

Stan Hoeppner
In reply to this post by Jack Knowlton
Jack Knowlton put forth on 8/15/2010 4:53 PM:

> Is it possible to store a CIDR access table on a mysql database?

I'm pretty sure the answer is, NO.

The solution to your problem is sticking the Postfix access table files you
want shared across your MX farm on an NFS/CIFS server and mounting the share
into, say, the directory

/etc/postfix/tables

on each MX host.

"man 5 cidr_table"

You will need to automount the remote NFS/CIFS share at boot, so you'll need
to add an entry to fstab, use autofs, or execute a startup script with the
appropriate mount command.  I'd recommend doing it via fstab, appending an
entry such as this to the bottom of the /etc/fstab file:

nfsserver_ip:/postfix-access-files  /etc/postfix/tables  nfs

See your operating system's documentation for mounting remote nfs filesystems
via fstab.

--
Stan
Reply | Threaded
Open this post in threaded view
|

Re: cidr table on mysql database

Walter Pinto-2
I completely misunderstood his request, sorry.
Reply | Threaded
Open this post in threaded view
|

Re: cidr table on mysql database

Bill Weiss-5
In reply to this post by Jack Knowlton
Jack Knowlton([hidden email])@Sun, Aug 15, 2010 at 11:53:33PM +0200:
> Hi all.
> Is it possible to store a CIDR access table on a mysql database? It would
> be very useful so I could have a centralized list to serve all MXs'
> instead of rsync'ing files each time.
> Thanks,

If you're comfortable with PostgreSQL, it has a native CIDR type that you
might find useful:
http://www.postgresql.org/docs/8.2/static/datatype-net-types.html

--
Bill Weiss
 
I once bought some crack, now I'm down with the CIA
    -- Sublime