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

Page principale
Supprimer ce message
Répondre à ce message
Auteur: Axel Rau
Date:  
À: Todd Lyons
CC: exim-dev, 1031
Sujet: 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