Re: [Exim] variables in exim.conf; multiple rows sql result

Page principale
Supprimer ce message
Répondre à ce message
Auteur: Philip Hazel
Date:  
À: Tamas TEVESZ
CC: exim-users
Sujet: Re: [Exim] variables in exim.conf; multiple rows sql result
On Thu, 19 Apr 2001, Tamas TEVESZ wrote:

> can i define my own variable in exim.conf ?


There are no variables. There are just macros.

> if not, how to achieve the
> following:
>
> i have this in my received_header_text (broken up in two lines):
>
> ${if def:authenticated_id {(authenticated sender:
> ${md5:${authenticated_id}})\n\t}}\
>
> instead of putting in the md5 hash of ${authenticated_id}, i'd like to
> put in ${md5:${authenticated_id}mysecrethere}
>
> i've tried playing around with several combinations of extract and
> macros, but they didn't work. (preferaby i'd like to put
> ``mysecrethere'' in a variable-like thing so that it's easy to spot,
> comment, remember and change, not ``hardcoding'' it into
> received_header_text.)


If it is fixed text, a macro should work. Without more detail, I can't
understand the problem, I'm afraid.

> === other.


> group = ${lookup mysql{select gid from mail where ...
> user = ${lookup mysql{select uid from mail where ...
> directory = ${lookup mysql{select concat(home, "/", ...
>
> this has been working very fine for almost a year now, it's just that
> it is three sql queries. i'd like to merge these into one query,


Wait for Exim 4. It will be easier.

> something like:
>
>   something = ${lookup mysql{select gid as gidm uid as uid, concat(..)
>                as home from ...}

>
> so that ``something'' would be
>
> ``gid=11231 uid=52321 home="/mails/me"'',
>
> and then use
>
> group = ${extract{gid}{something}}
> user = ${extract{uid}{something}}
> directory = ${extract{home}{something}}


Yup. There will be a feature in Exim 4 that lets you do precisely this.

-- 
Philip Hazel            University of Cambridge Computing Service,
ph10@???      Cambridge, England. Phone: +44 1223 334714.