Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: exim: users

Mysql lookups

 

 

exim users RSS feed   Index | Next | Previous | View Threaded


support at nsnoc

Nov 25, 2009, 3:28 AM

Post #1 of 2 (492 views)
Permalink
Mysql lookups

I've got to a point where guessing isn't working and the documentation
on sql lists is just making my head hurt.

I've a simple table...

domain varchar(50) NOT NULL default '',
greylist char(1) NOT NULL default '',
spamassassin char(1) NOT NULL default '',
avscan char(1) NOT NULL default '',
rbllist varchar(50) NOT NULL default ''

Sample data:

"domain.com","y","y","y","rbl.com : rbl2.com : rbl3.com"


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}}

Please can someone hit me with a bigger clue stick!


--
Hwyl / Regards

John Lyons


--
## List details at http://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/


eximX0902w at linuxwan

Nov 25, 2009, 6:42 AM

Post #2 of 2 (465 views)
Permalink
Re: Mysql lookups [In reply to]

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


--
## List details at http://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/

exim users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.