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

Kezdőlap
Üzenet törlése
Válasz az üzenetre
Szerző: Eli
Dátum:  
Címzett: 'Larry Rosenman', exim-users
Tárgy: RE: [Exim] partial- type lookups for SQL?
Doh! Hah, I was even thinking about that and trying to get it right -
goofed up on that one big :)

How about this...

Do a select to return all your domains (this really sucks, but I see no
other way) - store it into a domainlist. Next, you can use an lsearch (can
you do it on a domainlist? If not, read on - maybe the idea is sound but
the method needs changing) with that funky *@ syntax to have it search for
wildcards...

To block ONLY "bad.domain.com" - store it in sql as such. To block
subdomains as well, store it like "*.bad.domain.com" as well as also an
entry for "bad.domain.com".

Lemme know if that gives you any ideas - it was a quick thought since I
fugged up the first try :) I'm sure this can provoke some better ways or
something - seems like the right track though.

Eli.

-----Original Message-----
From: Larry Rosenman [mailto:ler@lerctr.org]
Sent: Sunday, December 21, 2003 7:52 PM
To: eli@???; exim-users@???
Subject: RE: [Exim] partial- type lookups for SQL?



--On Sunday, December 21, 2003 19:49:09 -0500 Eli <eli@???>
wrote:

> You might be able to do this very easily using the LIKE search function in
> SQL.
>
> When you run your check on $domain, rather than doing something like:
>
> "select .... where domain = '${quote_pgsql:$domain}'"
>
> Use instead:
>
> "select .... where domain like '%${quote_pgsql:$domain}'"

The problem is the $domain I get from exim is too long, and I need
to really SHORTEN it, not LENGTHEN it, which is what you suggest here.

Thanks for the reply, however.

LER

>
> Hope that helps, might put a little burden on the SQL server, but it might
> be the easiest/cleanest way of doing it :)
>
> Eli.


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



---
[This E-mail scanned for viruses]