Re: [exim] Converting to Mysql?

Páxina inicial
Borrar esta mensaxe
Responder a esta mensaxe
Autor: Phil Pennock
Data:  
Para: exim-users
Asunto: Re: [exim] Converting to Mysql?
On 2006-11-24 at 13:12 +1300, Craig Whitmore wrote:
> And these work fine.. but how do I convert these queries to mysql versions?
> so I can put the data into a database like the domains?
>
> hostlist rbl_whitelist           = net-iplsearch;/etc/exim4/rbl_whitelist


Are you locked into MySQL?

PostgreSQL provides rather more support for other data-types. You could
use "cidr" as a column type to hold cidr blocks in the same format that
Exim uses and then the network address comparators and functions for
doing lookups such as "is contained within". Order and Limit as
desired.

Sections 8.8 and 9.11 of
<URL:http://www.postgresql.org/docs/8.1/static/sql.html>.

> hostlist high_ratelimit          = partial-lsearch;/etc/exim4/high_ratelimit


My SQL-fu is weak enough that I don't think I could write a pure query
for this; instead I'd just write a stored procedure to loop through
replacing leading components with '*' and returning the first match
found, else NULL if none found.

(Not without swearing a lot though, I wouldn't; it's been a couple of
years since I last wrote stored procedures so I'd spend my time with
browser tabs pointed at various bits of the language reference; hence
no example here).

-Phil