Re: [exim] Tools for SQL export to CDB

Pàgina inicial
Delete this message
Reply to this message
Autor: W B Hacker
Data:  
A: exim users
Assumpte: Re: [exim] Tools for SQL export to CDB
David Saez Padros wrote:

> Hi !!
>
>> Still seeking:
>>
>> - pointers to sample syntax for complex queries, concatenation
>> of returned data, etc. Exim manual very sparse on cdb.
>
>
> cdb is very simple (key/data), you can only lookup keys, no complex
> queries. The returned data is the data associated with 'the' key.
>


More than familiar with that part.....

What I am looking for is samples for the syntax *exim* uses with
cdb calls:

- punctuation, sequencing, placing brackets, building complex
result strings from multiple CDB lookups.

- better yet, avoiding the need to be complex.

Example:

${lookup pgsql{SELECT pg_forward_to FROM mailprof \
  WHERE pg_local_part='${quote_pgsql:$local_part}' \
            AND pg_domain='${quote_pgsql:$domain}' \
              AND pg_do_forward}}



In the example 'mailprof'(ile) is the sole table.
pg_do_forward is a boolean, pg_forward_to the destination info,
rest conventional.

For a CDB, it looks to me as if:

#1

Key: pg_local_part@pg_domain
Value: destination address

#2

Key: pg_local_part@pg_domain
Value: yes / no flag

Or - taking advantage of the change in approach to simplify,

CDB # 1 is populated ONLY with those users who have forwarding
switched ON. Hence one gets either a 'failure' return code or
the needed address. The 'please do it' flag is implied.

Note that it is more practical in the 'master' SQL DB to leave
the address 'parked' and just flip the boolean.

Not so the CDB.

Bill

BTW - ¡Por favor, solo una copia! ¡No me necesito dos!