Re: [exim] Mysql lookups

Páxina inicial
Borrar esta mensaxe
Responder a esta mensaxe
Autor: Ted Cooper
Data:  
Para: exim-users
Asunto: Re: [exim] Mysql lookups
On Wed, 2009-11-25 at 11:28 +0000, Customer Support wrote:
> 1) I'm looking to replace...
> dnslists      = zen.spamhaus.org : combined.njabl.org 
> with the list from sql on a per domain basis.

>
> 2) trying to get $acl_greylist $acl_spamass $acl_avscan variables set from sql so that I can have a condition per test along the lines of....
>
> condition = ${if eq{$acl_greylist}{1}{1}}


First of all, all those variables are going to start with $acl_m_ or
$acl_c_ based on if they're going to be mail scoped (cleared by RSET or
new message) or connection scoped (cleared by process ending).

Somewhere at the start of smtp_acl_rcpt (I think .. I'm taking wild
guesses at how you're using these. Are you taking into account that you
might receive an email for many different domains at the same time?) you
need a block like

warn  set acl_m_greylist = ${extract{greylist}{${lookup mysql{SELECT
greylist, spamassassin, avscan, rbllist FROM table WHERE domain =
${mysql_quote:$domain}}}}{$value}{default-value-goes-here}}
      set acl_m_spamass = ${extract{spamassassin}{...
      set acl_m_avscan = ditto


The query only happens once per domain per connection as it's cached in
the current exim process.

It's 1:30am here so this might not work in the slightest .. your mileage
may vary .. this software is provided as is .. no warranty .. etc etc
etc etc

--
The Exim manual - http://docs.exim.org