On Wednesday 03 October 2007 3:54:20 pm Gary V wrote: > On 10/3/07, Ray wrote: > > On Tuesday 02 October 2007 2:09:04 pm Ray wrote: > > > Hello, > > > I am new to amavis. I am trying to use the sql lookup for some of the > > > @*_*_maps. <...>
> > > Ray > > > > I have gone through the "amavisd.conf-sample" file and have figured out a > > fair amount, but I now have more questions. > > > > 1)the sample file shown above lists at least 11 different *map variables, > > but provides only 3 examples of sql lookups. Can SQL lookups be used for > > only the three specified maps, or can I use lookups for any of the > > others? > > > > 2)If sql lookups are available, what variable name do I use for the sql > > statement? there doesn't seem to be any pattern to link the map and the > > query. > > > > 3)are there any other variables available like %k? > > > > Thanks, > > Ray > > As far as looking up recipient settings is concerned, I think you have > a misconception of what SQL's function is in general (under normal > conditions). The first two samples in amavisd.conf-sample are > defaults, and the third is a work-around for those people that are not > using the amavisd-new schema, but instead are using some foreign data > structure they wish to incorporate in some fashion in order to get > some basic information, such as whether a domain is local or not. If > you use the default $sql_select_policy, the map-like structure is > incorporated into the policy table: > > virus_lover <...> > banned_rulenames > > Each recipient has a policy assigned to them. The data in the > recipient's policy determines whether they are included in one of the > above (or have configured one of the above). As far as > @local_domains_maps is concerned, if a recipient record exists, that > is enough for the recipient to be considered local. For domain-wide > settings, a recipient could be a domain, and for site-wide settings, a > recipient could be a catchall (catchall is not considered local > however). The SQL statement referenced by the $sql_select_policy is > only performed once per message, and the results are cached. Read this > and see if it clarifies any more: > > http://www200.pair.com/mecham/spam/virtualp2.html#policy > > BTW, this link shows how I interpret how this functions, and may not > be perfectly correct. I think I understand a little more about what is going on. The system is set up so that you create one table, that is specific to amavis-new. It then performs it's own lookup on that table with it's own, built in, select statement. (details in documentation) Am I right so far? I am running postfix and dovecot with MySQL tables that provide all information. I would like to let amavis go look at those tables to find out what domains are to be considered local (this is in "amavisd.conf-sample", right) and possibly in the future find custom spam cutoff levels, white/black lists, etc. I guess that I could create the database structure that amavis expects, and repopulate it every 1/2 hour or so from the postfix/dovecot tables, but I would prefer not to. Any other suggestions? Thanks, Ray ------------------------------------------------------------------------- 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 [email protected] https://lists.sourceforge.net/lists/listinfo/amavis-user AMaViS-FAQ:http://www.amavis.org/amavis-faq.php3 AMaViS-HowTos:http://www.amavis.org/howto/
