Re: [exim] Log stats to DB?

Top Page
Delete this message
Reply to this message
Author: D. Dante Lorenso
Date:  
To: Ted Cooper
CC: exim-users
Subject: Re: [exim] Log stats to DB?
Ted Cooper wrote:
> D. Dante Lorenso wrote:
>> All,
>>
>> Can someone share an Exim rule that will allow me to log statistics to a
>> database? I want to log the number of messages sent to/from a given
>> user, total messages sent through server, and other various data.
>>
>> I've got Exim connected to PostgreSQL currently and can do queries
>> inside routers / transports etc to qualify 'senders =' and lookup data
>> with 'data =', but I haven't figured out how to just exec a query for
>> the purpose of simply logging.
>>
>> Any pointers would be appreciated. Using Exim 4.63 here.
>
> warn continue ${lookup mysql{insert into whatever (col) values(blip)}}
>
> Not too sure what version that was added though. If you don't have the
> continue condition/command/thingy, you can always just fill a variable
> with crud.
>
> warn set acl_m_moomoo ${lookup ...
>
> Maybe do conditions
>
> warn condition = ${if {in the manual}{$everything}{yes}{no}}
>      continue  = ${lookup mysql{insert whatever}}


It would be nice if Exim included a means of executing queries without
forcing me to use what seems like a side-effect of the 'warn' feature.
I mean, technically it's not a "warning", you know.

> Is there a really good reason to use an old version? There's nothing
> between 4.63 and 4.68 (in a few days+) that could cause a configuration
> conflict.


RedHat 5 package maintainers are still rolling out 4.63 and so that's
what's in CentOS 5 also. Get the upstream guys to update, and I'm on
board with making the config changes. Likely if you change a lot from
4.63 to 4.68 then that upstream change will be a long time coming what
with fear of breaking BC and whatnot.

Now, let me see if I can make this work ...

-- Dante