Peter,

> Currently I have network IP addresses stored for postfix in a mysql
> table. Would it be possible to use that table directly from amavisd-new
> to fill @mynetworks

You could use a small code section in your amavisd.conf file,
which would open an SQL access, fetch a list of networks
and build a list out of it, putting it into the @mynetworks
or into @mynetworks_maps. A downside is that this would
not be a dynamic lookup, but a frozen state at the time
of last amavisd restart.

Adding something like the following to amavisd.conf would do:

{ use DBI;
  my $dbh = DBI->connect('DBI:Pg:database=xxx', 'username', 'pwd',
                         { RaiseError => 1 } );
  my $aref = $dbh->selectcol_arrayref('SELECT net FROM mynetworks');
  $aref && @$aref  or die "No networks obtained from SQL";  
  push(@mynetworks, @$aref);
# dump_array(\...@mynetworks);
}


Mark

------------------------------------------------------------------------------
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand 
malware threats, the impact they can have on your business, and how you 
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
AMaViS-user mailing list
AMaViS-user@lists.sourceforge.net 
https://lists.sourceforge.net/lists/listinfo/amavis-user 
 Please visit http://www.ijs.si/software/amavisd/ regularly
 For administrativa requests please send email to rainer at openantivirus dot 
org

Reply via email to