Re: [exim] Storing Data in MySQL

Pàgina inicial
Delete this message
Reply to this message
Autor: Marcin Mirosław
Data:  
A: exim-users
Assumpte: Re: [exim] Storing Data in MySQL
W dniu 2012-11-27 23:08, Always Learning pisze:
> Exim documentation chapter 9 refers to 'lookup' which doesn't mean
> look-up but 'collect' information. (One has to collect, or try to
> collect, the data before one can verify its existence or its
> compatibility.)
>
> Does Exim permit the storage of information into MySQL ? For example,
> insert into .... If so, what replaces the Exim 'lookup' verb ?


Hi!
You don't have to use output of lookup to anything so it means, yes, you
can do "insert into " in lookup query. E.g.:

[...somewhere in acl_check_data ...]
warn
    condition       = ${lookup pgsql {PGSQL_Q_DODAJ_PUNKTY}}
[...]


# final accept
accept


Where PGSQL_Q_DODAJ_PUNKTY is defined as:
INSERT INTO exim_ipki_scoring (ip,punkty,domena) VALUES
(E'${quote_pgsql:$sender_host_address}' , \
E'${quote_pgsql:$spam_score_int}' , \
E'${quote_pgsql:$sender_address_domain}' )

But please notice if client disconnect after you insert tuple to
database and before client receive final "2xx " then exim throw away
email but you will have tuple in database.
I hope I write it clear enough, I don't speak english well.
Marcin