Jo, > > A data structure / syntax needs to be devised which can return a > > right-hand-side value from an IP-based lookup (not just a boolean), > > and lookup_ip_acl() would need to be extended to support it. > > I started working on it more than once, but a clean, not too > > convoluted syntax and yet reasonably efficient for a search > > proved hard to come up. > > I'm not sure that non-boolean is required. Why not just replicate > mynetworks? For a quick off the cuff gander, something like this: > @mynetworks = (x,y,z); > @othertrusted = (a,b,c); > remotenet_policy['othertrusted'] = 'TRUSTED';
I'd prefer to avoid Perl's symbolic references or eval. Perhaps the following could do (just a sequential search list of pairs, the first is an argument to lookup_ip_acl, the second is a policy name): my(@some_other_networks) = qw( 10.0.1.0/24 10.0.2.0/24 ); my(@client_ip_addr_policy) = ( [ qw(0.0.0.0/8 127.0.0.1/8 [::] [::1]) ] => 'LOCALHOST', [ qw(!172.16.1.0/24 172.16.0.0/12 192.168.0.0/16) ] => 'MYPRIVATENETS', [ qw(192.0.2.0/25 192.0.2.129 192.0.2.130) ] => 'PARTNER', \...@some_other_networks => 'OTHER', \...@mynetworks => 'MYNETS', ); Mark ------------------------------------------------------------------------------ Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM) software. With Adobe AIR, Ajax developers can use existing skills and code to build responsive, highly engaging applications that combine the power of local resources and data with the reach of the web. Download the Adobe AIR SDK and Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com _______________________________________________ AMaViS-user mailing list AMaViS-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/amavis-user AMaViS-FAQ:http://www.amavis.org/amavis-faq.php3 AMaViS-HowTos:http://www.amavis.org/howto/