Re: [Exim] partial- type lookups for SQL?

Startseite
Nachricht löschen
Nachricht beantworten
Autor: Larry Rosenman
Datum:  
To: Wakko Warner
CC: eli, exim-users
Betreff: Re: [Exim] partial- type lookups for SQL?
--


--On Sunday, December 21, 2003 20:45:45 -0500 Wakko Warner
<wakko@???> wrote:

>> I'll see if anyone else comes up with something (I've been thinking on it
>> for a while..).
>
> If the list is long, you should use files instead of a DB. If it's not
> that long, you can use ${sg}.
>
> Like this (replace mysql with what you use, I only use mysql)
> ${lookup mysql{...}{\
>     ${sg{$value}{ *\\n}{ : }}\
> }

>
> You will have to add *.that.bad.domain.com to match everything under it.
>
> If you want it more complex, you may have to use a script of some sort or
> the embedded perl mechanism.

I wound up cheating.  What I did was write the following script:
$ cat bin/banned_domain2dbm
#!/bin/ksh
PATH=$PATH:/usr/local/pgsql/bin:/usr/exim/bin;export PATH
psql -t -F ' ' -c "SELECT domain,'\t',message FROM banned_domain ORDER BY
domain" exim |
     sed -e 's@|@@g' -e 's@^ @@' | exim_dbmbuild -
/usr/exim/checkfiles/banned_domain
$


and have a table with entries with the leading *. and the plain domain
name.

I then added the following to my ACL:

deny   message        = BANNED_DOMAIN
         log_message    = banned domain
         sender_domains = +banned_domains



With the following host list:
domainlist banned_domains = partial-dbm;/usr/exim/checkfiles/banned_domain

at the top.

Anyone have better idea(s)?

LER


>
> --
> Lab tests show that use of micro$oft causes cancer in lab animals
>
> --
>
>## List details at http://www.exim.org/mailman/listinfo/exim-users Exim
>## details at http://www.exim.org/ ##
>
>




--
Larry Rosenman                     http://www.lerctr.org/~ler
Phone: +1 972-414-9812                 E-Mail: ler@???
US Mail: 1905 Steamboat Springs Drive, Garland, TX 75044-6749
--
[ Content of type application/pgp-signature deleted ]
--