Re: [exim] Exim remote smtp response code

Inizio della pagina
Delete this message
Reply to this message
Autore: W B Hacker
Data:  
To: exim users
Oggetto: Re: [exim] Exim remote smtp response code
Todd Lyons wrote:
> Please keep all replies on list.
>
> On Fri, Jul 6, 2012 at 9:32 AM, Nguyen Quan<minhquan030@???> wrote:
>>
>> But in the #1 I don't know how to configure "the transport to do a mysql
>> query which inserts the appropriate data".
>> Can you help me a little more?
>
> Maybe someone else can, something has come up and I gotta tend to some things.
>
> Google for exim mysql logging and some discussion about things will
> come up. One relevant conversation seemed to be
> http://www.gossamer-threads.com/lists/exim/users/87737 .
>
> ...Todd


You don't always have to wait for the router/transport. You can do such
parts of stuffing data inot a DB as are in-hand at *any* time in the acl
that is relevant.

Have to await 'DATA phase if you want the message entirety, of course,
and later-yet for far-end final handshakes, but the structure should be
the same for MySQL as it is here for PostgreSQL.

Sample for accumulating info on 'imposters' (IMP) shows just a few
variables being inserted, but the call is similar for 'whatever' Exim
has in-hand:

You can place as many as you need wherever you want them, capture
anything Exim 'knows', or tell Exim anything the DB 'knows' .. that it
can deal with, or at least store, at any given point in time, of course.

This one hapens to sit in the acl_smtp_helo area.

Unwrap the MUA munging to just two lines at the '\' or strip that and
look at it as all on ONE longer line to grok it.

====

set acl_c19 = ${lookup pgsql{INSERT into brownlist (pg_when, pg_why,
pg_ip, pg_host, pg_where) \

VALUES
('$tod_log','IMP','$sender_host_address','$sender_host_name','HELO as
us')}}

====

This one is doing a SELECT, but COULD do an INSERT or UPDATE.

As it sits in the router-transports the 'set acl_xx =' is replaced with
'condition ='.

There are other nuances available...

=====

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


=====

CAVEAT: Don't use an SQL DB just because you 'can'. Breakage of the SQL
engine may prevent Exim doing its job.

Exim has superb tools for logging and statistics that are generally much
lower resource loads, AND less likely to hang the basic smtp job.

HTH,

Bill
--
韓家標