Re: [exim] Running a SQL Insert command

Top Page
Delete this message
Reply to this message
Author: Michael da Silva Pereira
Date:  
To: Jeremy Harris, exim-users @ exim. org
CC: 
Subject: Re: [exim] Running a SQL Insert command
No Luck:

Log file genreates:
Warning: ACL "warn" statement skipped: condition test deferred: MYSQL: query
failed: You have an error in your SQL syntax. Check the manual that
corresponds to your MySQL server version for the right syntax to use near
'from, to, host, ctime) values ("msgid", "from", "to", "host" ,"\n


config file looks like:
begin acl
acl_check_rcpt:
accept hosts = :

warn set acl_m9 = ${lookup mysql {INSERT INTO message_log \
(msgid, from, to, host, ctime) \
values \
("msgid", \
"from", \
"to", \
"host" \
,"ctime")}}

  deny    message       = Restricted characters in address
          local_parts   = ^[.] : ^.*[@%!/|]
  deny    message       = Restricted characters in address
          local_parts   = ^[./|] : ^.*[@%!] : ^.*/\\.\\./






----- Original Message -----
From: "Jeremy Harris" <jgh@???>
To: "exim-users @ exim. org" <exim-users@???>
Sent: Thursday, April 07, 2005 2:39 PM
Subject: Re: [exim] Running a SQL Insert command


> Michael da Silva Pereira wrote:
>> Hi all,
>>
>> How would a run a sql query in an acl? I want to log all my mails into a
>> sql database, i was thinking a condition might work, but i also want to
>> log my denied mails so I am scared it might cause a problem no returning
>> a value(since its an insert query it has no output).
>
>
> add_to_watchlist:
>   warn   set acl_m9 =   ${lookup pgsql{ BEGIN; \
>                         DELETE FROM helo_chk \
>                             WHERE ip = 
> '${quote_pgsql:$sender_host_address}' \
>                             AND helo = '${quote_pgsql:$sender_helo_name}' 
> ; \
>                         INSERT INTO helo_chk(ip,helo) \
>                                 VALUES( 
> '${quote_pgsql:$sender_host_address}', \

>
> '${quote_pgsql:$sender_helo_name}' ) ; \
>                         COMMIT } {} { \
>                         }}

>
> --
> ## List details at http://www.exim.org/mailman/listinfo/exim-users ## Exim
> details at http://www.exim.org/
> ## Please use the Wiki with this list - http://www.exim.org/eximwiki/