This is a discussion on Re: [AMaViS-user] Question regarding SQL lookups within the Amavis User forums, part of the Anti-Spam and Anti-Virus Related Forums category; -------- Original-Nachricht -------- > Datum: Sat, 25 Aug 2007 00:42:47 +0200 > Von: Mark Martinec <Mark.Martinec+amavis@...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
-------- Original-Nachricht -------- > Datum: Sat, 25 Aug 2007 00:42:47 +0200 > Von: Mark Martinec <Mark.Martinec+amavis@ijs.si> > An: amavis-user@lists.sourceforge.net > Betreff: Re: [AMaViS-user] Question regarding SQL lookups > Steve, > Mark > > Now I would like to use a SQL query for @local_domains_maps to get a > list > > of the domains. But the query would be executed against a totally > different > > database then the one amavis-new is using. > > Not sure what you have in mind, but perhaps the following example > >from amavisd.conf-sample can supply you an idea: > > # Here is an example of a SELECT clause that fabricates an artificial > 'users' > # table from actual table 'postfix_domains' containing a field > 'domain_name'. > # The effect is that domains listed in the 'postfix_domains' table will be > # treated as local by amavisd, and be given settings from a policy id 99 > # if such a policy id exists, or just fall back to static lookups. > # The user.id (with a value 1) is there only to provide a user id (same id > # for all listed domains) when global SQL-based white/blacklisting is > used. > # > # $sql_lookups_no_at_means_domain = 1; > # $sql_select_policy = > # 'SELECT *, user.id'. > # ' FROM (SELECT 1 as id, 99 as policy_id, "Y" AS local'. > # ' FROM postfix_domains WHERE domain_name IN (%k)) AS user'. > # ' LEFT JOIN policy ON policy_id=policy.id'; > I still don't understand. Allow me to be more specific: I have a setup where all the data for Postfix is inside a MySQL database. All the users, aliases, domains, transports, etc. With a cron job I do query the MySQL database to get a list of all domains on the server. Then I sort that result and then I compare the list with what is in amavisd.conf under @local_domains_maps. If the result is not the same as in amavisd.conf, then I push the result into amavisd.conf and restart AMaViS. And I want to avoid this job. I would like to directly specify a SQL query for local_domains_maps instead of using: @local_domains_maps = ( [qw( .$mydomain .domain1.tld .domain2.tld domain2.tld ... At least I don't need to update the @local_domains_maps by hand but still. I would prefer to directly query the SQL database then using my stupid hack. Is this possible? How? > > Mark > Steve > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > AMaViS-user mailing list > AMaViS-user@lists.sourceforge.net > https://lists.sourceforge.net/lists/...fo/amavis-user > AMaViS-FAQ:http://www.amavis.org/amavis-faq.php3 > AMaViS-HowTos:http://www.amavis.org/howto/ -- Ist Ihr Browser Vista-kompatibel? Jetzt die neuesten Browser-Versionen downloaden: http://www.gmx.net/de/go/browser ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ AMaViS-user mailing list AMaViS-user@lists.sourceforge.net https://lists.sourceforge.net/lists/...fo/amavis-user AMaViS-FAQ:http://www.amavis.org/amavis-faq.php3 AMaViS-HowTos:http://www.amavis.org/howto/ |
![]() |
| Thread Tools | |
| Display Modes | |
|
|