Max-Julian, > I am finetuning our spam filter and wondered what exactly will be > substituted in place of %k and %a and what other replacements might be > available. > > But to my surprise, I could not locate any such documentation. > > Could please someone provide a big red, flashing pointer to the place > where such replacements are documented? > I am obviously too challenged by modern search technology.
Use the Source, Luke! :) (actually it was also mentioned in release notes when introduced, and in amavisd.conf-sample (but I see the %a is missing there, will update it) ). # The SQL select clause to fetch per-recipient policy settings. # The %k will be replaced by a comma-separated list of query addresses # for a recipient (e.g. a full address, domain only, catchall), %a will be # replaced by an exact recipient address (same as the first entry in %k, # suitable for pattern matching). Use ORDER, if there is a chance that # multiple records will match - the first match wins (i.e. the first # returned record). If field names are not unique (e.g. 'id'), the later # field overwrites the earlier in a hash returned by lookup, which is why # we use 'users.*, policy.*, users.id', i.e. the id is repeated at the end. # This is a legacy variable for upwards compatibility, now only referenced # by the program through a %sql_clause entry 'sel_policy' - newer config # files may assign directly to $sql_clause{'sel_policy'} if preferred. # $sql_select_policy = 'SELECT users.*, policy.*, users.id'. ' FROM users LEFT JOIN policy ON users.policy_id=policy.id'. ' WHERE users.email IN (%k) ORDER BY users.priority DESC'; > In particular, I was looking for a substitution to put the the email > address value from the RCPT TO smtp command into the sql statement. > (email are sent to amavis from postfix. postfix does a lot of checking > so I consider trustworthy to use) The %a would do just that. Btw, the recipient address is always correct by definition. > But judging from various examples found via google, %a or %k might not > be what I am looking for. I believe the %a is what you are looking for. If not, please explain. Sorry for delay Mark ------------------------------------------------------------------------------ Crystal Reports - New Free Runtime and 30 Day Trial Check out the new simplified licensing option that enables unlimited royalty-free distribution of the report engine for externally facing server and web deployment. http://p.sf.net/sfu/businessobjects _______________________________________________ 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/