Re: [exim-dev] [Bug 1031] New: Implement database logging of…

Kezdőlap
Üzenet törlése
Válasz az üzenetre
Szerző: Axel Rau
Dátum:  
Címzett: Todd Lyons
CC: exim-dev, 1031
Tárgy: Re: [exim-dev] [Bug 1031] New: Implement database logging of completed remote delivery

Am 15.10.2010 um 17:41 schrieb Todd Lyons:

> In the example in the patch, you put a SELECT statement, but it seems
> like it would be better illustrated by showing a sample INSERT
> instead:
>
> +An example might look like:
> +
> +dbl_delivery_query = \
> +${lookup pgsql {SELECT * FROM record_Delivery( \
> +    '${quote_pgsql:$sender_address_domain}',\
> <snip>

>
> Because that record doesn't exist yet, right?

My example uses a stored procedure. A real world example with a  
normalized
schema would be quite complex, because a couple of tables would be  
queried/
updated/inserted.
A simple INSERT might look like:
-----------
dbl_delivery_query = \
${lookup pgsql {INSERT INTO record_Delivery( \
      sa_d, sa_lp, ra_d, ra_lp, rel_ip, rel_fqdn, msg_id) \
      VALUES ('${quote_pgsql:$sender_address_domain}',\
     '${quote_pgsql:${lc:$sender_address_local_part}}', \
     '${quote_pgsql:$dbl_delivery_domain}', \
     '${quote_pgsql:${lc:$dbl_delivery_local_part}}', \
     '${quote_pgsql:$dbl_delivery_ip}', \
     '${quote_pgsql:${lc:$dbl_delivery_fqdn}}', \
     '${quote_pgsql:$message_exim_id}')}}
-----------


Axel
---
axel.rau@??? PGP-Key:29E99DD6 +49 151 2300 9283 computing @
chaos claudius