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. > > I have found > > http://www.ijs.si/software/amavisd/README.sql-mysql.txt > > and > > http://www.ijs.si/software/amavisd/README.sql.txt > > and > > http://www.ijs.si/software/amavisd/README.lookups.txt > > but I don't understand how the query is created. > > any help would be much appreciated. > > 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 spam_lover banned_files_lover bad_header_lover bypass_virus_checks bypass_spam_checks bypass_banned_checks bypass_header_checks spam_modifies_subj virus_quarantine_to spam_quarantine_to banned_quarantine_to bad_header_quarantine_to clean_quarantine_to other_quarantine_to spam_tag_level spam_tag2_level spam_kill_level spam_dsn_cutoff_level spam_quarantine_cutoff_level addr_extension_virus addr_extension_spam addr_extension_banned addr_extension_bad_header warnvirusrecip warnbannedrecip warnbadhrecip newvirus_admin virus_admin banned_admin bad_header_admin spam_admin spam_subject_tag spam_subject_tag2 message_size_limit 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. -- Gary V ------------------------------------------------------------------------- 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/listinfo/amavis-user AMaViS-FAQ:http://www.amavis.org/amavis-faq.php3 AMaViS-HowTos:http://www.amavis.org/howto/