Jyri, > I read the documentation and searched the web but found on clear answer to > my problem with amavis-new 2.6.4. The question is, will SQL lookup form > table users take precedence over statically loaded maps?
Yes it will, this is currently not configurable, but there are plans to make a lookup order configurable. An undefined result from SQL however allows the list of lookup tables (the @_maps variables) to be traversed further, until a definite answer is found. > My configuration is like this: > @local_domains_maps = (read_hash('/etc/amavisd.d/local_domains')); > > and local domains are described int that file as: > .local1.com > .local2.com > .local3.com > > This should define that inbound messages sent to previously defined domains > will be considered as local and warning like this "Open relay? Nonlocal > recips but not originating" should not appear in log file. Is this correct > assumption? Correct (unless an SQL lookup provides a definite answer with a value of false for a field 'local'). > If it is then in real life it does not work. I tried to change the format > of data in local_domains file by removing leading dots but that made no > difference. Then I added a new line to users table like this "insert int > users values (xxx,xxx,xxx, '@local1.com','# dummy comment',Y) and > immediately those warning disappeared for this particular domain from log. > This made me think that data read from SQL queries takes precedence over > statically loaded data or there is a third way of formatting data stored in > static maps. For example domains in that file should be formatted like > this: @local1.com The field 'users.local' is somewhat special in its defaults, see file README.lookups, section: Special handling of optional SQL field 'users.local' The following would make a difference: - do you have a 'catchall' entry in SQL, or you don't have it - does a field 'users.local' exist in the schema, or not. The following would allow a fallback to statical lookups for a list of lookup tables @local_domains_maps: - have a field users.local in the schema, and keep its value a NULL in all records; or: - not have a catchall record It is a bit unusual to use SQL lookups but keep the 'local' attribut in a static lookup table. The usual approach when using SQL is to have one record for each local domain. No other fields (besides a key) are necessary, absent (or NULL) fields let a lookup continue with statical settings. Mark ------------------------------------------------------------------------------ The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE: Pinpoint memory and threading errors before they happen. Find and fix more than 250 security defects in the development cycle. Locate bottlenecks in serial and parallel code that limit performance. http://p.sf.net/sfu/intel-dev2devfeb _______________________________________________ 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