Autor: Joachim Wieland Data: A: exim-users Assumpte: [Exim] launching "actions" on events
Hi there,
As some other poster wanted to do recently, I'd like to collect some
statistics about mails (how long they were on the queue, where they went
to, when they got delivered, where they got delivered to...) for a
database-driven tracability so I'd favor a logging that is more easy to
parse and more concise than the mainlog file.
Are there any suggestions on how to do that most easily?
I thought about it and I would favour the following solution so far:
- I'll patch exim and add the following generic options for transports:
These parameters get expanded, but the result is never used, i.e. the
expansion must be an action for itself. It could be ${run...} for a
first approach but a ${logwrite{<file>}{<line>}{<result>}} directive would
be less CPU consuming, so
- exim gets a ${logwrite{<file>}{<line>}{<result>}} directive
that opens and locks a file, adds a line and closes the file again. If
<result> is specified, it is returned, if not, <line> is the result of
the expansion.
That way I can push all the necessary data out of exim and a cronjob
anlyzing the logfiles could write the data into the database every few
minutes (I don't need real-time updates - however this would be possible
as well doing INSERTs directly from an action_* option...)
Any comments? I'm a little bit unsure if this approach is clean enough
since I created options that wouldn't be options in the traditional way
but just have side effects...
Joachim
--
*****PGP key available - send e-mail request***** - ICQ: 37225940
Due to circumstances beyond your control, you are master of your fate
and captain of your soul.